diff options
author | jeff <jeff@FreeBSD.org> | 2005-03-13 12:18:25 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2005-03-13 12:18:25 +0000 |
commit | 0d9df2e12d6a83b8934322f557844cc0bb7bd488 (patch) | |
tree | aa27ba510f7c723270e0278e561283b717a36c7b /sys/fs/nullfs | |
parent | 5d7c91ddde246cd0d3f506a01bb53ba5fb41dd5d (diff) | |
download | FreeBSD-src-0d9df2e12d6a83b8934322f557844cc0bb7bd488.zip FreeBSD-src-0d9df2e12d6a83b8934322f557844cc0bb7bd488.tar.gz |
- The VI_DOOMED flag now signals the end of a vnode's relationship with
the filesystem. Check that rather than VI_XLOCK.
- VOP_INACTIVE should no longer drop the vnode lock.
- The vnode lock is required around calls to vrecycle() and vgone().
Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/fs/nullfs')
-rw-r--r-- | sys/fs/nullfs/null_subr.c | 4 | ||||
-rw-r--r-- | sys/fs/nullfs/null_vnops.c | 16 |
2 files changed, 8 insertions, 12 deletions
diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c index ac54c21..f6543b2 100644 --- a/sys/fs/nullfs/null_subr.c +++ b/sys/fs/nullfs/null_subr.c @@ -128,7 +128,7 @@ loop: * recycling the nullfs vnode or another thread * in vrele() waiting for the vnode lock. */ - if ((vp->v_iflag & VI_XLOCK) != 0) { + if ((vp->v_iflag & VI_DOOMED) != 0) { VI_UNLOCK(vp); continue; } @@ -177,7 +177,7 @@ loop: * recycling the nullfs vnode or another thread * in vrele() waiting for the vnode lock. */ - if ((ovp->v_iflag & VI_XLOCK) != 0) { + if ((ovp->v_iflag & VI_DOOMED) != 0) { VI_UNLOCK(ovp); continue; } diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index f02adbc5..bee46ee 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -537,6 +537,10 @@ null_lock(struct vop_lock_args *ap) return (error); } + if ((flags & LK_INTERLOCK) == 0) { + VI_LOCK(vp); + flags |= LK_INTERLOCK; + } if (vp->v_vnlock != NULL) { /* * The lower level has exported a struct lock to us. Use @@ -546,10 +550,6 @@ null_lock(struct vop_lock_args *ap) * going away doesn't mean the struct lock below us is. * LK_EXCLUSIVE is fine. */ - if ((flags & LK_INTERLOCK) == 0) { - VI_LOCK(vp); - flags |= LK_INTERLOCK; - } nn = VTONULL(vp); if ((flags & LK_TYPE_MASK) == LK_DRAIN) { NULLFSDEBUG("null_lock: avoiding LK_DRAIN\n"); @@ -558,7 +558,7 @@ null_lock(struct vop_lock_args *ap) * pending locks to complete. Afterwards the * lockmgr call might block, but no other threads * will attempt to use this nullfs vnode due to the - * VI_XLOCK flag. + * VI_DOOMED flag. */ while (nn->null_pending_locks > 0) { nn->null_drain_wakeup = 1; @@ -580,7 +580,7 @@ null_lock(struct vop_lock_args *ap) * and another process might have initiated a recycle * operation. When that happens, just back out. */ - if (error == 0 && (vp->v_iflag & VI_XLOCK) != 0 && + if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0 && td != vp->v_vxthread) { lockmgr(vp->v_vnlock, (flags & ~LK_TYPE_MASK) | LK_RELEASE, @@ -598,9 +598,6 @@ null_lock(struct vop_lock_args *ap) nn->null_drain_wakeup = 0; wakeup(&nn->null_pending_locks); } - if (error == ENOENT && (vp->v_iflag & VI_XLOCK) != 0 && - vp->v_vxthread != curthread) - vx_waitl(vp); VI_UNLOCK(vp); return error; } else { @@ -695,7 +692,6 @@ null_inactive(struct vop_inactive_args *ap) struct thread *td = ap->a_td; vp->v_object = NULL; - VOP_UNLOCK(vp, 0, td); /* * If this is the last reference, then free up the vnode |