diff options
author | jeff <jeff@FreeBSD.org> | 2005-03-28 09:34:36 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2005-03-28 09:34:36 +0000 |
commit | b136fd4eeec08b4463f68e065e6aa2a33f14b660 (patch) | |
tree | 3389742b8c4fd07ec495c3a6df23823b2153cd70 /sys/fs/ntfs/ntfs_vnops.c | |
parent | 0afa18e58f0050e8bf00de7ba60dd9a366b273b5 (diff) | |
download | FreeBSD-src-b136fd4eeec08b4463f68e065e6aa2a33f14b660.zip FreeBSD-src-b136fd4eeec08b4463f68e065e6aa2a33f14b660.tar.gz |
- We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.
Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/fs/ntfs/ntfs_vnops.c')
-rw-r--r-- | sys/fs/ntfs/ntfs_vnops.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c index 1c0a0bb..5451175 100644 --- a/sys/fs/ntfs/ntfs_vnops.c +++ b/sys/fs/ntfs/ntfs_vnops.c @@ -622,13 +622,12 @@ ntfs_lookup(ap) struct componentname *cnp = ap->a_cnp; struct ucred *cred = cnp->cn_cred; int error; - int lockparent = cnp->cn_flags & LOCKPARENT; #if NTFS_DEBUG int wantparent = cnp->cn_flags & (LOCKPARENT|WANTPARENT); #endif - dprintf(("ntfs_lookup: \"%.*s\" (%ld bytes) in %d, lp: %d, wp: %d \n", + dprintf(("ntfs_lookup: \"%.*s\" (%ld bytes) in %d, wp: %d \n", (int)cnp->cn_namelen, cnp->cn_nameptr, cnp->cn_namelen, - dip->i_number, lockparent, wantparent)); + dip->i_number, wantparent)); error = VOP_ACCESS(dvp, VEXEC, cred, cnp->cn_thread); if(error) @@ -657,27 +656,15 @@ ntfs_lookup(ap) return (error); VOP_UNLOCK(dvp,0,cnp->cn_thread); - cnp->cn_flags |= PDIRUNLOCK; - dprintf(("ntfs_lookup: parentdir: %d\n", vap->va_a_name->n_pnumber)); error = VFS_VGET(ntmp->ntm_mountp, vap->va_a_name->n_pnumber, LK_EXCLUSIVE, ap->a_vpp); ntfs_ntvattrrele(vap); if (error) { - if (vn_lock(dvp,LK_EXCLUSIVE|LK_RETRY,cnp->cn_thread)==0) - cnp->cn_flags &= ~PDIRUNLOCK; + vn_lock(dvp,LK_EXCLUSIVE|LK_RETRY,cnp->cn_thread); return (error); } - - if (lockparent && (cnp->cn_flags & ISLASTCN)) { - error = vn_lock(dvp, LK_EXCLUSIVE, cnp->cn_thread); - if (error) { - vput( *(ap->a_vpp) ); - return (error); - } - cnp->cn_flags &= ~PDIRUNLOCK; - } } else { error = ntfs_ntlookupfile(ntmp, dvp, cnp, ap->a_vpp); if (error) { @@ -687,9 +674,6 @@ ntfs_lookup(ap) dprintf(("ntfs_lookup: found ino: %d\n", VTONT(*ap->a_vpp)->i_number)); - - if(!lockparent || !(cnp->cn_flags & ISLASTCN)) - VOP_UNLOCK(dvp, 0, cnp->cn_thread); } if (cnp->cn_flags & MAKEENTRY) |