msdosfs_denode.c (62227) | msdosfs_denode.c (66615) |
---|---|
1/* $FreeBSD: head/sys/fs/msdosfs/msdosfs_denode.c 62227 2000-06-29 01:12:47Z bp $ */ | 1/* $FreeBSD: head/sys/fs/msdosfs/msdosfs_denode.c 66615 2000-10-04 01:29:17Z jasone $ */ |
2/* $NetBSD: msdosfs_denode.c,v 1.28 1998/02/10 14:10:00 mrg Exp $ */ 3 4/*- 5 * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. 6 * Copyright (C) 1994, 1995, 1997 TooLs GmbH. 7 * All rights reserved. 8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). 9 * --- 46 unchanged lines hidden (view full) --- 56#include <sys/proc.h> 57#include <sys/bio.h> 58#include <sys/buf.h> 59#include <sys/vnode.h> 60 61#include <vm/vm.h> 62#include <vm/vm_extern.h> 63 | 2/* $NetBSD: msdosfs_denode.c,v 1.28 1998/02/10 14:10:00 mrg Exp $ */ 3 4/*- 5 * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. 6 * Copyright (C) 1994, 1995, 1997 TooLs GmbH. 7 * All rights reserved. 8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). 9 * --- 46 unchanged lines hidden (view full) --- 56#include <sys/proc.h> 57#include <sys/bio.h> 58#include <sys/buf.h> 59#include <sys/vnode.h> 60 61#include <vm/vm.h> 62#include <vm/vm_extern.h> 63 |
64#include <machine/mutex.h> 65 |
|
64#include <msdosfs/bpb.h> 65#include <msdosfs/msdosfsmount.h> 66#include <msdosfs/direntry.h> 67#include <msdosfs/denode.h> 68#include <msdosfs/fat.h> 69 70static MALLOC_DEFINE(M_MSDOSFSNODE, "MSDOSFS node", "MSDOSFS vnode private part"); 71 --- 61 unchanged lines hidden (view full) --- 133loop: 134 simple_lock(&dehash_slock); 135 for (dep = DEHASH(dev, dirclust, diroff); dep; dep = dep->de_next) { 136 if (dirclust == dep->de_dirclust 137 && diroff == dep->de_diroffset 138 && dev == dep->de_dev 139 && dep->de_refcnt != 0) { 140 vp = DETOV(dep); | 66#include <msdosfs/bpb.h> 67#include <msdosfs/msdosfsmount.h> 68#include <msdosfs/direntry.h> 69#include <msdosfs/denode.h> 70#include <msdosfs/fat.h> 71 72static MALLOC_DEFINE(M_MSDOSFSNODE, "MSDOSFS node", "MSDOSFS vnode private part"); 73 --- 61 unchanged lines hidden (view full) --- 135loop: 136 simple_lock(&dehash_slock); 137 for (dep = DEHASH(dev, dirclust, diroff); dep; dep = dep->de_next) { 138 if (dirclust == dep->de_dirclust 139 && diroff == dep->de_diroffset 140 && dev == dep->de_dev 141 && dep->de_refcnt != 0) { 142 vp = DETOV(dep); |
141 simple_lock(&vp->v_interlock); | 143 mtx_enter(&vp->v_interlock, MTX_DEF); |
142 simple_unlock(&dehash_slock); 143 if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) 144 goto loop; 145 return (dep); 146 } 147 } 148 simple_unlock(&dehash_slock); 149 return (NULL); --- 123 unchanged lines hidden (view full) --- 273 fc_purge(ldep, 0); /* init the fat cache for this denode */ 274 275 /* 276 * Lock the denode so that it can't be accessed until we've read 277 * it in and have done what we need to it. Do this here instead 278 * of at the start of msdosfs_hashins() so that reinsert() can 279 * call msdosfs_hashins() with a locked denode. 280 */ | 144 simple_unlock(&dehash_slock); 145 if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) 146 goto loop; 147 return (dep); 148 } 149 } 150 simple_unlock(&dehash_slock); 151 return (NULL); --- 123 unchanged lines hidden (view full) --- 275 fc_purge(ldep, 0); /* init the fat cache for this denode */ 276 277 /* 278 * Lock the denode so that it can't be accessed until we've read 279 * it in and have done what we need to it. Do this here instead 280 * of at the start of msdosfs_hashins() so that reinsert() can 281 * call msdosfs_hashins() with a locked denode. 282 */ |
281 if (lockmgr(&ldep->de_lock, LK_EXCLUSIVE, (struct simplelock *)0, p)) | 283 if (lockmgr(&ldep->de_lock, LK_EXCLUSIVE, (struct mtx *)0, p)) |
282 panic("deget: unexpected lock failure"); 283 284 /* 285 * Insert the denode into the hash queue. 286 */ 287 msdosfs_hashins(ldep); 288 289 ldep->de_pmp = pmp; --- 365 unchanged lines hidden (view full) --- 655 cache_purge(vp); 656 if (dep->de_devvp) { 657 vrele(dep->de_devvp); 658 dep->de_devvp = 0; 659 } 660#if 0 /* XXX */ 661 dep->de_flag = 0; 662#endif | 284 panic("deget: unexpected lock failure"); 285 286 /* 287 * Insert the denode into the hash queue. 288 */ 289 msdosfs_hashins(ldep); 290 291 ldep->de_pmp = pmp; --- 365 unchanged lines hidden (view full) --- 657 cache_purge(vp); 658 if (dep->de_devvp) { 659 vrele(dep->de_devvp); 660 dep->de_devvp = 0; 661 } 662#if 0 /* XXX */ 663 dep->de_flag = 0; 664#endif |
665 lockdestroy(&dep->de_lock); |
|
663 FREE(dep, M_MSDOSFSNODE); 664 vp->v_data = NULL; 665 666 return (0); 667} 668 669int 670msdosfs_inactive(ap) --- 53 unchanged lines hidden --- | 666 FREE(dep, M_MSDOSFSNODE); 667 vp->v_data = NULL; 668 669 return (0); 670} 671 672int 673msdosfs_inactive(ap) --- 53 unchanged lines hidden --- |