diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2005-03-28 09:26:17 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2005-03-28 09:26:17 +0000 |
commit | ee5a0a2d7c4d91d1365f66ea704018fd07e30558 (patch) | |
tree | f00108c18331d06895c07ae67a8821eb055d7943 /sys/kern/vfs_cache.c | |
parent | d36f0a4ff852b3aa094db48e1511ad6aff4320d6 (diff) | |
download | src-ee5a0a2d7c4d91d1365f66ea704018fd07e30558.tar.gz src-ee5a0a2d7c4d91d1365f66ea704018fd07e30558.zip |
- We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.
Sponsored by: Isilon Systems, Inc.
Notes
Notes:
svn path=/head/; revision=144205
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r-- | sys/kern/vfs_cache.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 9d32ca6c6815..b54126a61736 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -666,24 +666,19 @@ vfs_cache_lookup(ap) vp = *vpp; vpid = vp->v_id; - cnp->cn_flags &= ~PDIRUNLOCK; if (dvp == vp) { /* lookup on "." */ VREF(vp); error = 0; } else if (flags & ISDOTDOT) { VOP_UNLOCK(dvp, 0, td); - cnp->cn_flags |= PDIRUNLOCK; #ifdef LOOKUP_SHARED if ((flags & ISLASTCN) && (flags & LOCKSHARED)) error = vget(vp, LK_SHARED, td); else #endif error = vget(vp, LK_EXCLUSIVE, td); - - if (!error && lockparent && (flags & ISLASTCN)) { - if ((error = vn_lock(dvp, LK_EXCLUSIVE, td)) == 0) - cnp->cn_flags &= ~PDIRUNLOCK; - } + if (error) + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); } else { #ifdef LOOKUP_SHARED if ((flags & ISLASTCN) && (flags & LOCKSHARED)) @@ -691,10 +686,6 @@ vfs_cache_lookup(ap) else #endif error = vget(vp, LK_EXCLUSIVE, td); - if (!lockparent || error || !(flags & ISLASTCN)) { - VOP_UNLOCK(dvp, 0, td); - cnp->cn_flags |= PDIRUNLOCK; - } } /* * Check that the capability number did not change @@ -704,16 +695,8 @@ vfs_cache_lookup(ap) if (vpid == vp->v_id) return (0); vput(vp); - if (lockparent && dvp != vp && (flags & ISLASTCN)) { - VOP_UNLOCK(dvp, 0, td); - cnp->cn_flags |= PDIRUNLOCK; - } - } - if (cnp->cn_flags & PDIRUNLOCK) { - error = vn_lock(dvp, LK_EXCLUSIVE, td); - if (error) - return (error); - cnp->cn_flags &= ~PDIRUNLOCK; + if (flags & ISDOTDOT) + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); } error = VOP_CACHEDLOOKUP(dvp, vpp, cnp); #ifdef LOOKUP_SHARED |