summaryrefslogtreecommitdiffstats
path: root/sys/msdosfs
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2000-10-04 01:29:17 +0000
committerjasone <jasone@FreeBSD.org>2000-10-04 01:29:17 +0000
commit4e290e67b7310d906f113850fddfdf1017a9d15b (patch)
treebae3e99c848c6e38aee34a7cf61ffa9ca55b0095 /sys/msdosfs
parentbea51a4aa1bf67a183bd1d4a6227fa891345af60 (diff)
downloadFreeBSD-src-4e290e67b7310d906f113850fddfdf1017a9d15b.zip
FreeBSD-src-4e290e67b7310d906f113850fddfdf1017a9d15b.tar.gz
Convert lockmgr locks from using simple locks to using mutexes.
Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed.
Diffstat (limited to 'sys/msdosfs')
-rw-r--r--sys/msdosfs/msdosfs_denode.c7
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c6
-rw-r--r--sys/msdosfs/msdosfs_vnops.c6
3 files changed, 13 insertions, 6 deletions
diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c
index 4e237bf..0122f6b 100644
--- a/sys/msdosfs/msdosfs_denode.c
+++ b/sys/msdosfs/msdosfs_denode.c
@@ -61,6 +61,8 @@
#include <vm/vm.h>
#include <vm/vm_extern.h>
+#include <machine/mutex.h>
+
#include <msdosfs/bpb.h>
#include <msdosfs/msdosfsmount.h>
#include <msdosfs/direntry.h>
@@ -138,7 +140,7 @@ loop:
&& dev == dep->de_dev
&& dep->de_refcnt != 0) {
vp = DETOV(dep);
- simple_lock(&vp->v_interlock);
+ mtx_enter(&vp->v_interlock, MTX_DEF);
simple_unlock(&dehash_slock);
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p))
goto loop;
@@ -278,7 +280,7 @@ deget(pmp, dirclust, diroffset, depp)
* of at the start of msdosfs_hashins() so that reinsert() can
* call msdosfs_hashins() with a locked denode.
*/
- if (lockmgr(&ldep->de_lock, LK_EXCLUSIVE, (struct simplelock *)0, p))
+ if (lockmgr(&ldep->de_lock, LK_EXCLUSIVE, (struct mtx *)0, p))
panic("deget: unexpected lock failure");
/*
@@ -660,6 +662,7 @@ msdosfs_reclaim(ap)
#if 0 /* XXX */
dep->de_flag = 0;
#endif
+ lockdestroy(&dep->de_lock);
FREE(dep, M_MSDOSFSNODE);
vp->v_data = NULL;
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index 33b5cd7..8af88d4 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -62,6 +62,8 @@
#include <sys/malloc.h>
#include <sys/stat.h> /* defines ALLPERMS */
+#include <machine/mutex.h>
+
#include <msdosfs/bpb.h>
#include <msdosfs/bootsect.h>
#include <msdosfs/direntry.h>
@@ -873,14 +875,14 @@ loop:
if (vp->v_mount != mp)
goto loop;
- simple_lock(&vp->v_interlock);
+ mtx_enter(&vp->v_interlock, MTX_DEF);
nvp = vp->v_mntvnodes.le_next;
dep = VTODE(vp);
if (vp->v_type == VNON ||
((dep->de_flag &
(DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0 &&
(TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY))) {
- simple_unlock(&vp->v_interlock);
+ mtx_exit(&vp->v_interlock, MTX_DEF);
continue;
}
simple_unlock(&mntvnode_slock);
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index f8426de..37a57ea 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -68,6 +68,8 @@
#include <vm/vm_extern.h>
#include <vm/vnode_pager.h>
+#include <machine/mutex.h>
+
#include <msdosfs/bpb.h>
#include <msdosfs/direntry.h>
#include <msdosfs/denode.h>
@@ -231,12 +233,12 @@ msdosfs_close(ap)
struct denode *dep = VTODE(vp);
struct timespec ts;
- simple_lock(&vp->v_interlock);
+ mtx_enter(&vp->v_interlock, MTX_DEF);
if (vp->v_usecount > 1) {
getnanotime(&ts);
DETIMES(dep, &ts, &ts, &ts);
}
- simple_unlock(&vp->v_interlock);
+ mtx_exit(&vp->v_interlock, MTX_DEF);
return 0;
}
OpenPOWER on IntegriCloud