diff options
| author | Ian Dowse <iedowse@FreeBSD.org> | 2001-05-16 18:04:37 +0000 |
|---|---|---|
| committer | Ian Dowse <iedowse@FreeBSD.org> | 2001-05-16 18:04:37 +0000 |
| commit | 0864ef1e8a449b1533c7e0ea673e9614aaa9a81f (patch) | |
| tree | d7aaca11b211abc1efdc147eb5280e6a31ca436e /sys/nfs | |
| parent | 73cf2c3089f11d4b82c44eef06de12f8f86cc47e (diff) | |
Notes
Diffstat (limited to 'sys/nfs')
| -rw-r--r-- | sys/nfs/nfs_vfsops.c | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index d5e89726e54aa..3c76ed5739dea 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -953,8 +953,6 @@ nfs_unmount(mp, mntflags, p) struct proc *p; { register struct nfsmount *nmp; - struct nfsnode *np; - struct vnode *vp; int error, flags = 0; if (mntflags & MNT_FORCE) @@ -962,36 +960,20 @@ nfs_unmount(mp, mntflags, p) nmp = VFSTONFS(mp); /* * Goes something like this.. - * - Check for activity on the root vnode (other than ourselves). - * - Call vflush() to clear out vnodes for this file system, - * except for the root vnode. - * - Decrement reference on the vnode representing remote root. + * - Call vflush() to clear out vnodes for this file system * - Close the socket * - Free up the data structures */ /* - * We need to decrement the ref. count on the nfsnode representing - * the remote root. See comment in mountnfs(). The VFS unmount() - * has done vput on this vnode, otherwise we would get deadlock! - */ - error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np); - if (error) - return(error); - vp = NFSTOV(np); - if (vp->v_usecount > 2) { - vput(vp); - return (EBUSY); - } - - /* * Must handshake with nqnfs_clientd() if it is active. */ nmp->nm_state |= NFSSTA_DISMINPROG; while (nmp->nm_inprog != NULLVP) (void) tsleep((caddr_t)&lbolt, PSOCK, "nfsdism", 0); - error = vflush(mp, vp, flags); + + /* We hold 1 extra ref on the root vnode; see comment in mountnfs(). */ + error = vflush(mp, 1, flags); if (error) { - vput(vp); nmp->nm_state &= ~NFSSTA_DISMINPROG; return (error); } @@ -1003,12 +985,6 @@ nfs_unmount(mp, mntflags, p) if (nmp->nm_flag & (NFSMNT_NQNFS | NFSMNT_KERB)) nmp->nm_state |= NFSSTA_DISMNT; - /* - * There are two reference counts and one lock to get rid of here. - */ - vput(vp); - vrele(vp); - vgone(vp); nfs_disconnect(nmp); FREE(nmp->nm_nam, M_SONAME); |
