summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-01-21 14:51:38 +0000
committerkib <kib@FreeBSD.org>2009-01-21 14:51:38 +0000
commit44eef9d9bb82bfa3434a676ef8796afa45b737fc (patch)
tree5e4f9659247270ac18f95245b70228992605c361 /sys/ufs
parentdc43531891e4226acd560977e364ab94ea62c9e9 (diff)
downloadFreeBSD-src-44eef9d9bb82bfa3434a676ef8796afa45b737fc.zip
FreeBSD-src-44eef9d9bb82bfa3434a676ef8796afa45b737fc.tar.gz
Move the code from ufs_lookup.c used to do dotdot lookup, into
the helper function. It is supposed to be useful for any filesystem that has to unlock dvp to walk to the ".." entry in lookup routine. Requested by: jhb Tested by: pho MFC after: 1 month
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_lookup.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index 65ab0da..bc11a6a 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -157,7 +157,6 @@ ufs_lookup(ap)
int nameiop = cnp->cn_nameiop;
ino_t ino;
int ltype;
- struct mount *mp;
bp = NULL;
slotoffset = -1;
@@ -578,27 +577,7 @@ found:
*/
pdp = vdp;
if (flags & ISDOTDOT) {
- ltype = VOP_ISLOCKED(pdp);
- mp = pdp->v_mount;
- for (;;) {
- error = vfs_busy(mp, MBF_NOWAIT);
- if (error == 0)
- break;
- VOP_UNLOCK(pdp, 0);
- pause("ufs_dd", 1);
- vn_lock(pdp, ltype | LK_RETRY);
- if (pdp->v_iflag & VI_DOOMED)
- return (ENOENT);
- }
- VOP_UNLOCK(pdp, 0); /* race to get the inode */
- error = VFS_VGET(mp, ino, cnp->cn_lkflags, &tdp);
- vfs_unbusy(mp);
- vn_lock(pdp, ltype | LK_RETRY);
- if (pdp->v_iflag & VI_DOOMED) {
- if (error == 0)
- vput(tdp);
- error = ENOENT;
- }
+ error = vn_vget_ino(pdp, ino, cnp->cn_lkflags, &tdp);
if (error)
return (error);
*vpp = tdp;
OpenPOWER on IntegriCloud