diff options
author | bp <bp@FreeBSD.org> | 2000-10-03 04:39:50 +0000 |
---|---|---|
committer | bp <bp@FreeBSD.org> | 2000-10-03 04:39:50 +0000 |
commit | e9f8d8bbf5793b12704c2d1912cfd9fb069cab59 (patch) | |
tree | 1e2d9e41cea01af40144c4db1520f02166944b23 /sys/fs/cd9660 | |
parent | 87071b03a6f71c73de6713e461caaf4980b8afe3 (diff) | |
download | FreeBSD-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/fs/cd9660')
-rw-r--r-- | sys/fs/cd9660/cd9660_lookup.c | 18 | ||||
-rw-r--r-- | sys/fs/cd9660/cd9660_node.c | 2 | ||||
-rw-r--r-- | sys/fs/cd9660/cd9660_node.h | 1 | ||||
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 6 |
4 files changed, 18 insertions, 9 deletions
diff --git a/sys/fs/cd9660/cd9660_lookup.c b/sys/fs/cd9660/cd9660_lookup.c index 1b58f44..b2d5057 100644 --- a/sys/fs/cd9660/cd9660_lookup.c +++ b/sys/fs/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; } diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c index 4c95977..54bace3 100644 --- a/sys/fs/cd9660/cd9660_node.c +++ b/sys/fs/cd9660/cd9660_node.c @@ -138,7 +138,7 @@ cd9660_ihashins(ip) *ipp = ip; simple_unlock(&cd9660_ihash_slock); - lockmgr(&ip->i_lock, LK_EXCLUSIVE, (struct simplelock *)0, p); + lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, (struct simplelock *)0, p); } /* diff --git a/sys/fs/cd9660/cd9660_node.h b/sys/fs/cd9660/cd9660_node.h index 9f56150..100c08e 100644 --- a/sys/fs/cd9660/cd9660_node.h +++ b/sys/fs/cd9660/cd9660_node.h @@ -61,7 +61,6 @@ typedef struct { struct iso_node { - struct lock i_lock; /* node lock > Keep this first< */ struct iso_node *i_next, **i_prev; /* hash chain */ struct vnode *i_vnode; /* vnode associated with this inode */ struct vnode *i_devvp; /* vnode for block I/O */ diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 50f3883..0934730 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -725,7 +725,11 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir) MALLOC(ip, struct iso_node *, sizeof(struct iso_node), M_ISOFSNODE, M_WAITOK); bzero((caddr_t)ip, sizeof(struct iso_node)); - lockinit(&ip->i_lock, PINOD, "isonode", 0, 0); + lockinit(&vp->v_lock, PINOD, "isonode", 0, 0); + /* + * ISOFS uses stdlock and can share lock structure + */ + vp->v_vnlock = &vp->v_lock; vp->v_data = ip; ip->i_vnode = vp; ip->i_dev = dev; |