summaryrefslogtreecommitdiffstats
path: root/sys/isofs/cd9660/cd9660_lookup.c
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>2000-10-03 04:39:50 +0000
committerbp <bp@FreeBSD.org>2000-10-03 04:39:50 +0000
commite9f8d8bbf5793b12704c2d1912cfd9fb069cab59 (patch)
tree1e2d9e41cea01af40144c4db1520f02166944b23 /sys/isofs/cd9660/cd9660_lookup.c
parent87071b03a6f71c73de6713e461caaf4980b8afe3 (diff)
downloadFreeBSD-src-e9f8d8bbf5793b12704c2d1912cfd9fb069cab59.zip
FreeBSD-src-e9f8d8bbf5793b12704c2d1912cfd9fb069cab59.tar.gz
Make cd9660 filesystem PDIRUNLOCK aware. Now it can be used in vnode stacks
and nullfs mounts. Remove now unnecessary i_lock field from the iso_node structure.
Diffstat (limited to 'sys/isofs/cd9660/cd9660_lookup.c')
-rw-r--r--sys/isofs/cd9660/cd9660_lookup.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/isofs/cd9660/cd9660_lookup.c b/sys/isofs/cd9660/cd9660_lookup.c
index 1b58f44..b2d5057 100644
--- a/sys/isofs/cd9660/cd9660_lookup.c
+++ b/sys/isofs/cd9660/cd9660_lookup.c
@@ -129,6 +129,7 @@ cd9660_lookup(ap)
imp = dp->i_mnt;
lockparent = flags & LOCKPARENT;
wantparent = flags & (LOCKPARENT|WANTPARENT);
+ cnp->cn_flags &= ~PDIRUNLOCK;
/*
* We now have a segment name to search for, and a directory to search.
@@ -358,11 +359,14 @@ found:
vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p);
return (error);
}
- if (lockparent && (flags & ISLASTCN) &&
- (error = vn_lock(pdp, LK_EXCLUSIVE, p))) {
- vput(tdp);
- return (error);
- }
+ if (lockparent && (flags & ISLASTCN)) {
+ if ((error = vn_lock(pdp, LK_EXCLUSIVE, p)) != 0) {
+ cnp->cn_flags |= PDIRUNLOCK;
+ vput(tdp);
+ return (error);
+ }
+ } else
+ cnp->cn_flags |= PDIRUNLOCK;
*vpp = tdp;
} else if (dp->i_number == dp->i_ino) {
brelse(bp);
@@ -374,8 +378,10 @@ found:
brelse(bp);
if (error)
return (error);
- if (!lockparent || !(flags & ISLASTCN))
+ if (!lockparent || !(flags & ISLASTCN)) {
+ cnp->cn_flags |= PDIRUNLOCK;
VOP_UNLOCK(pdp, 0, p);
+ }
*vpp = tdp;
}
OpenPOWER on IntegriCloud