summaryrefslogtreecommitdiffstats
path: root/sys/fs/nwfs
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/fs/nwfs
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/fs/nwfs')
-rw-r--r--sys/fs/nwfs/nwfs_node.c1
-rw-r--r--sys/fs/nwfs/nwfs_vnops.c16
2 files changed, 10 insertions, 7 deletions
diff --git a/sys/fs/nwfs/nwfs_node.c b/sys/fs/nwfs/nwfs_node.c
index 2d34600..03d3e86 100644
--- a/sys/fs/nwfs/nwfs_node.c
+++ b/sys/fs/nwfs/nwfs_node.c
@@ -83,6 +83,7 @@ nwfs_hash_init(void) {
void
nwfs_hash_free(void) {
+ lockdestroy(&nwhashlock);
free(nwhashtbl, M_NWFSHASH);
}
diff --git a/sys/fs/nwfs/nwfs_vnops.c b/sys/fs/nwfs/nwfs_vnops.c
index e309785..e7c7fa6 100644
--- a/sys/fs/nwfs/nwfs_vnops.c
+++ b/sys/fs/nwfs/nwfs_vnops.c
@@ -46,6 +46,8 @@
#include <vm/vm.h>
#include <vm/vm_extern.h>
+#include <machine/mutex.h>
+
#include <netncp/ncp.h>
#include <netncp/ncp_conn.h>
#include <netncp/ncp_subr.h>
@@ -255,24 +257,24 @@ nwfs_close(ap)
if (vp->v_type == VDIR) return 0; /* nothing to do now */
error = 0;
- simple_lock(&vp->v_interlock);
+ mtx_enter(&vp->v_interlock, MTX_DEF);
if (np->opened == 0) {
- simple_unlock(&vp->v_interlock);
+ mtx_exit(&vp->v_interlock, MTX_DEF);
return 0;
}
- simple_unlock(&vp->v_interlock);
+ mtx_exit(&vp->v_interlock, MTX_DEF);
error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 1);
- simple_lock(&vp->v_interlock);
+ mtx_enter(&vp->v_interlock, MTX_DEF);
if (np->opened == 0) {
- simple_unlock(&vp->v_interlock);
+ mtx_exit(&vp->v_interlock, MTX_DEF);
return 0;
}
if (--np->opened == 0) {
- simple_unlock(&vp->v_interlock);
+ mtx_exit(&vp->v_interlock, MTX_DEF);
error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh,
ap->a_p, ap->a_cred);
} else
- simple_unlock(&vp->v_interlock);
+ mtx_exit(&vp->v_interlock, MTX_DEF);
np->n_atime = 0;
return (error);
}
OpenPOWER on IntegriCloud