diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-04-23 19:40:29 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-04-23 19:40:29 +0000 |
commit | df437cd43a9c7475beb3f892c3cb1a530e3edaad (patch) | |
tree | bbf30fe59e6d8c7a9d46ac88694f0f7dec1c9fa1 /sys | |
parent | 40c3518aefd420580d257271e0b1dd4f1bcf779f (diff) |
simple_lock -> XXXLOCKING comments.
This is a similar case to the ntfs commit just made, howerver things a
somewhat more hard to audit because cd9660 actually implements vnode
locking (using lockmgr still due to vnode recursion *vomit*). No rwlock
on the hash table though so these locks can probably be converted to
mutexes fairly simply to prevent reentering the list code.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/isofs/cd9660/cd9660_node.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c index 193b7ea5ed5..6184ca617df 100644 --- a/sys/isofs/cd9660/cd9660_node.c +++ b/sys/isofs/cd9660/cd9660_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_node.c,v 1.20 2007/10/29 13:02:19 chl Exp $ */ +/* $OpenBSD: cd9660_node.c,v 1.21 2010/04/23 19:40:28 oga Exp $ */ /* $NetBSD: cd9660_node.c,v 1.17 1997/05/05 07:13:57 mycroft Exp $ */ /*- @@ -60,7 +60,6 @@ struct iso_node **isohashtbl; u_long isohash; #define INOHASH(device, inum) (((device) + ((inum)>>12)) & isohash) -struct simplelock cd9660_ihash_slock; #ifdef ISODEVMAP struct iso_node **idvhashtbl; @@ -81,7 +80,6 @@ cd9660_init(vfsp) { isohashtbl = hashinit(desiredvnodes, M_ISOFSMNT, M_WAITOK, &isohash); - simple_lock_init(&cd9660_ihash_slock); #ifdef ISODEVMAP idvhashtbl = hashinit(desiredvnodes / 8, M_ISOFSMNT, M_WAITOK, &idvhash); #endif @@ -158,17 +156,17 @@ cd9660_ihashget(dev, inum) struct vnode *vp; loop: - simple_lock(&cd9660_ihash_slock); + /* XXX locking lock hash list? */ for (ip = isohashtbl[INOHASH(dev, inum)]; ip; ip = ip->i_next) { if (inum == ip->i_number && dev == ip->i_dev) { vp = ITOV(ip); - simple_unlock(&cd9660_ihash_slock); + /* XXX locking unlock hash list? */ if (vget(vp, LK_EXCLUSIVE, p)) goto loop; return (vp); } } - simple_unlock(&cd9660_ihash_slock); + /* XXX locking unlock hash list? */ return (NULL); } @@ -181,7 +179,7 @@ cd9660_ihashins(ip) { struct iso_node **ipp, *iq; - simple_lock(&cd9660_ihash_slock); + /* XXX locking lock hash list? */ ipp = &isohashtbl[INOHASH(ip->i_dev, ip->i_number)]; for (iq = *ipp; iq; iq = iq->i_next) { @@ -195,7 +193,7 @@ cd9660_ihashins(ip) ip->i_next = iq; ip->i_prev = ipp; *ipp = ip; - simple_unlock(&cd9660_ihash_slock); + /* XXX locking unlock hash list? */ lockmgr(&ip->i_lock, LK_EXCLUSIVE, NULL); @@ -214,7 +212,7 @@ cd9660_ihashrem(ip) if (ip->i_prev == NULL) return; - simple_lock(&cd9660_ihash_slock); + /* XXX locking lock hash list? */ if ((iq = ip->i_next) != NULL) iq->i_prev = ip->i_prev; *ip->i_prev = iq; @@ -222,7 +220,7 @@ cd9660_ihashrem(ip) ip->i_next = NULL; ip->i_prev = NULL; #endif - simple_unlock(&cd9660_ihash_slock); + /* XXX locking unlock hash list? */ } /* |