aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nwfs
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2001-05-16 18:04:37 +0000
committerIan Dowse <iedowse@FreeBSD.org>2001-05-16 18:04:37 +0000
commit0864ef1e8a449b1533c7e0ea673e9614aaa9a81f (patch)
treed7aaca11b211abc1efdc147eb5280e6a31ca436e /sys/fs/nwfs
parent73cf2c3089f11d4b82c44eef06de12f8f86cc47e (diff)
Notes
Diffstat (limited to 'sys/fs/nwfs')
-rw-r--r--sys/fs/nwfs/nwfs_vfsops.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/sys/fs/nwfs/nwfs_vfsops.c b/sys/fs/nwfs/nwfs_vfsops.c
index c9084ef9d2e30..c978722c6ab8d 100644
--- a/sys/fs/nwfs/nwfs_vfsops.c
+++ b/sys/fs/nwfs/nwfs_vfsops.c
@@ -237,35 +237,16 @@ nwfs_unmount(struct mount *mp, int mntflags, struct proc *p)
{
struct nwmount *nmp = VFSTONWFS(mp);
struct ncp_conn *conn;
- struct vnode *vp;
int error, flags;
NCPVODEBUG("nwfs_unmount: flags=%04x\n",mntflags);
flags = 0;
if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
- error = VFS_ROOT(mp,&vp);
- if (error) return (error);
- if (vp->v_usecount > 2) {
- printf("nwfs_unmount: usecnt=%d\n",vp->v_usecount);
- vput(vp);
- return (EBUSY);
- }
- error = vflush(mp, vp, flags);
- if (error) {
- vput(vp);
+ /* There is 1 extra root vnode reference from nwfs_mount(). */
+ error = vflush(mp, 1, flags);
+ if (error)
return (error);
- }
- /*
- * There are two reference counts and one lock to get rid of here.
- */
- NCPVODEBUG("v_use: %d\n",vp->v_usecount);
- vput(vp);
- NCPVODEBUG("v_use after vput: %d\n",vp->v_usecount);
- vrele(vp);
- NCPVODEBUG("v_use after vrele: %d\n",vp->v_usecount);
- vgone(vp);
- NCPVODEBUG("v_gone finished !!!!\n");
conn = NWFSTOCONN(nmp);
ncp_conn_puthandle(nmp->connh,NULL,0);
if (ncp_conn_lock(conn,p,p->p_ucred,NCPM_WRITE | NCPM_EXECUTE) == 0) {