cd9660_node.c (66571) | cd9660_node.c (66615) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1994, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley 6 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 7 * Support code is derived from software contributed to Berkeley 8 * by Atsushi Murai (amurai@spec.co.jp). --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94 | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1994, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley 6 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 7 * Support code is derived from software contributed to Berkeley 8 * by Atsushi Murai (amurai@spec.co.jp). --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94 |
39 * $FreeBSD: head/sys/fs/cd9660/cd9660_node.c 66571 2000-10-03 04:39:50Z bp $ | 39 * $FreeBSD: head/sys/fs/cd9660/cd9660_node.c 66615 2000-10-04 01:29:17Z jasone $ |
40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/mount.h> 45#include <sys/proc.h> 46#include <sys/bio.h> 47#include <sys/buf.h> 48#include <sys/vnode.h> 49#include <sys/malloc.h> 50#include <sys/stat.h> 51 | 40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/mount.h> 45#include <sys/proc.h> 46#include <sys/bio.h> 47#include <sys/buf.h> 48#include <sys/vnode.h> 49#include <sys/malloc.h> 50#include <sys/stat.h> 51 |
52#include <machine/mutex.h> 53 |
|
52#include <isofs/cd9660/iso.h> 53#include <isofs/cd9660/cd9660_node.h> 54#include <isofs/cd9660/cd9660_mount.h> 55 56/* 57 * Structures associated with iso_node caching. 58 */ 59static struct iso_node **isohashtbl; --- 43 unchanged lines hidden (view full) --- 103 struct iso_node *ip; 104 struct vnode *vp; 105 106loop: 107 simple_lock(&cd9660_ihash_slock); 108 for (ip = isohashtbl[INOHASH(dev, inum)]; ip; ip = ip->i_next) { 109 if (inum == ip->i_number && dev == ip->i_dev) { 110 vp = ITOV(ip); | 54#include <isofs/cd9660/iso.h> 55#include <isofs/cd9660/cd9660_node.h> 56#include <isofs/cd9660/cd9660_mount.h> 57 58/* 59 * Structures associated with iso_node caching. 60 */ 61static struct iso_node **isohashtbl; --- 43 unchanged lines hidden (view full) --- 105 struct iso_node *ip; 106 struct vnode *vp; 107 108loop: 109 simple_lock(&cd9660_ihash_slock); 110 for (ip = isohashtbl[INOHASH(dev, inum)]; ip; ip = ip->i_next) { 111 if (inum == ip->i_number && dev == ip->i_dev) { 112 vp = ITOV(ip); |
111 simple_lock(&vp->v_interlock); | 113 mtx_enter(&vp->v_interlock, MTX_DEF); |
112 simple_unlock(&cd9660_ihash_slock); 113 if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) 114 goto loop; 115 return (vp); 116 } 117 } 118 simple_unlock(&cd9660_ihash_slock); 119 return (NULL); --- 13 unchanged lines hidden (view full) --- 133 ipp = &isohashtbl[INOHASH(ip->i_dev, ip->i_number)]; 134 if ((iq = *ipp) != NULL) 135 iq->i_prev = &ip->i_next; 136 ip->i_next = iq; 137 ip->i_prev = ipp; 138 *ipp = ip; 139 simple_unlock(&cd9660_ihash_slock); 140 | 114 simple_unlock(&cd9660_ihash_slock); 115 if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) 116 goto loop; 117 return (vp); 118 } 119 } 120 simple_unlock(&cd9660_ihash_slock); 121 return (NULL); --- 13 unchanged lines hidden (view full) --- 135 ipp = &isohashtbl[INOHASH(ip->i_dev, ip->i_number)]; 136 if ((iq = *ipp) != NULL) 137 iq->i_prev = &ip->i_next; 138 ip->i_next = iq; 139 ip->i_prev = ipp; 140 *ipp = ip; 141 simple_unlock(&cd9660_ihash_slock); 142 |
141 lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, (struct simplelock *)0, p); | 143 lockmgr(&ip->i_vnode->v_lock, LK_EXCLUSIVE, (struct mtx *)0, p); |
142} 143 144/* 145 * Remove the inode from the hash table. 146 */ 147static void 148cd9660_ihashrem(ip) 149 register struct iso_node *ip; --- 63 unchanged lines hidden (view full) --- 213 /* 214 * Purge old data structures associated with the inode. 215 */ 216 cache_purge(vp); 217 if (ip->i_devvp) { 218 vrele(ip->i_devvp); 219 ip->i_devvp = 0; 220 } | 144} 145 146/* 147 * Remove the inode from the hash table. 148 */ 149static void 150cd9660_ihashrem(ip) 151 register struct iso_node *ip; --- 63 unchanged lines hidden (view full) --- 215 /* 216 * Purge old data structures associated with the inode. 217 */ 218 cache_purge(vp); 219 if (ip->i_devvp) { 220 vrele(ip->i_devvp); 221 ip->i_devvp = 0; 222 } |
223 lockdestroy(&ip->i_vnode->v_lock); |
|
221 FREE(vp->v_data, M_ISOFSNODE); 222 vp->v_data = NULL; 223 return (0); 224} 225 226/* 227 * File attributes 228 */ --- 211 unchanged lines hidden --- | 224 FREE(vp->v_data, M_ISOFSNODE); 225 vp->v_data = NULL; 226 return (0); 227} 228 229/* 230 * File attributes 231 */ --- 211 unchanged lines hidden --- |