From 10f666af84d48e89e4e2960415c9b616fce4077f Mon Sep 17 00:00:00 2001 From: dyson Date: Mon, 10 Feb 1997 02:22:35 +0000 Subject: This is the kernel Lite/2 commit. There are some requisite userland changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu --- sys/nfs/nfs_node.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'sys/nfs/nfs_node.c') diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 2ddb4a6..8403f55 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -33,10 +33,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)nfs_node.c 8.2 (Berkeley) 12/30/93 + * @(#)nfs_node.c 8.6 (Berkeley) 5/22/95 * $FreeBSD$ */ + #include #include #include @@ -108,7 +109,8 @@ nfs_nget(mntp, fhp, fhsize, npp) int fhsize; struct nfsnode **npp; { - register struct nfsnode *np; + struct proc *p = curproc; /* XXX */ + struct nfsnode *np; struct nfsnodehashhead *nhpp; register struct vnode *vp; struct vnode *nvp; @@ -121,7 +123,7 @@ loop: bcmp((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize)) continue; vp = NFSTOV(np); - if (vget(vp, 1)) + if (vget(vp, LK_EXCLUSIVE, p)) goto loop; *npp = np; return(0); @@ -178,7 +180,7 @@ loop: /* * Lock the new nfsnode. */ - VOP_LOCK(vp); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); return (0); } @@ -187,6 +189,7 @@ int nfs_inactive(ap) struct vop_inactive_args /* { struct vnode *a_vp; + struct proc *a_p; } */ *ap; { register struct nfsnode *np; @@ -213,6 +216,7 @@ nfs_inactive(ap) } np->n_flag &= (NMODIFIED | NFLUSHINPROG | NFLUSHWANT | NQNFSEVICTED | NQNFSNONCACHE | NQNFSWRITE); + VOP_UNLOCK(ap->a_vp, 0, ap->a_p); return (0); } @@ -265,6 +269,7 @@ nfs_reclaim(ap) return (0); } +#if 0 /* * Lock an nfsnode */ @@ -355,6 +360,7 @@ nfs_islocked(ap) { return VTONFS(ap->a_vp)->n_flag & NLOCKED ? 1 : 0; } +#endif /* * Nfs abort op, called after namei() when a CREATE/DELETE isn't actually -- cgit v1.1