summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_mount.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-06-09 10:31:38 +0000
committerkib <kib@FreeBSD.org>2008-06-09 10:31:38 +0000
commit926d12d0ea65c1b10638efb17de093ecc2fe4063 (patch)
treeab9745925fe55b9a4f33ea4af659d8d13f96cc4f /sys/kern/vfs_mount.c
parent98ec5e76a88638596bb55271c5e91a26f266703d (diff)
downloadFreeBSD-src-926d12d0ea65c1b10638efb17de093ecc2fe4063.zip
FreeBSD-src-926d12d0ea65c1b10638efb17de093ecc2fe4063.tar.gz
Provide the mutual exclusion between the nfs export list modifications
and nfs requests processing. Lockmgr lock provides the shared locking for nfs requests, while exclusive mode is used for modifications. The writer starvation is handled by lockmgr too. Reported by: kris, pho, many Based on the submission by: mohan Tested by: pho MFC after: 2 weeks
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r--sys/kern/vfs_mount.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 0b2bee6..ade918a 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -452,6 +452,7 @@ mount_init(void *mem, int size, int flags)
mp = (struct mount *)mem;
mtx_init(&mp->mnt_mtx, "struct mount mtx", NULL, MTX_DEF);
lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, 0);
+ lockinit(&mp->mnt_explock, PVFS, "explock", 0, 0);
return (0);
}
@@ -461,6 +462,7 @@ mount_fini(void *mem, int size)
struct mount *mp;
mp = (struct mount *)mem;
+ lockdestroy(&mp->mnt_explock);
lockdestroy(&mp->mnt_lock);
mtx_destroy(&mp->mnt_mtx);
}
OpenPOWER on IntegriCloud