aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_lookup.c
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2008-11-02 10:15:42 +0000
committerAttilio Rao <attilio@FreeBSD.org>2008-11-02 10:15:42 +0000
commit83b3bdbc8a62ff45142dfa354eb6eab7a81a0a6b (patch)
tree904da44fc29dcc675df2dfc69f644d6a90befc3c /sys/kern/vfs_lookup.c
parent0952268ecd3f2e5de535e97dcd9c94e4484edf85 (diff)
downloadsrc-83b3bdbc8a62ff45142dfa354eb6eab7a81a0a6b.tar.gz
src-83b3bdbc8a62ff45142dfa354eb6eab7a81a0a6b.zip
Improve VFS locking:
- Implement real draining for vfs consumers by not relying on the mnt_lock and using instead a refcount in order to keep track of lock requesters. - Due to the change above, remove the mnt_lock lockmgr because it is now useless. - Due to the change above, vfs_busy() is no more linked to a lockmgr. Change so its KPI by removing the interlock argument and defining 2 new flags for it: MBF_NOWAIT which basically replaces the LK_NOWAIT of the old version (which was unlinked from the lockmgr alredy) and MBF_MNTLSTLOCK which provides the ability to drop the mountlist_mtx once the mnt interlock is held (ability still desired by most consumers). - The stub used into vfs_mount_destroy(), that allows to override the mnt_ref if running for more than 3 seconds, make it totally useless. Remove it as it was thought to work into older versions. If a problem of "refcount held never going away" should appear, we will need to fix properly instead than trust on such hackish solution. - Fix a bug where returning (with an error) from dounmount() was still leaving the MNTK_MWAIT flag on even if it the waiters were actually woken up. Just a place in vfs_mount_destroy() is left because it is going to recycle the structure in any case, so it doesn't matter. - Remove the markercnt refcount as it is useless. This patch modifies VFS ABI and breaks KPI for vfs_busy() so manpages and __FreeBSD_version will be modified accordingly. Discussed with: kib Tested by: pho
Notes
Notes: svn path=/head/; revision=184554
Diffstat (limited to 'sys/kern/vfs_lookup.c')
-rw-r--r--sys/kern/vfs_lookup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index aa9cfbf9237b..f009dac4ad65 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -684,7 +684,7 @@ unionlookup:
*/
while (dp->v_type == VDIR && (mp = dp->v_mountedhere) &&
(cnp->cn_flags & NOCROSSMOUNT) == 0) {
- if (vfs_busy(mp, 0, 0))
+ if (vfs_busy(mp, 0))
continue;
vput(dp);
VFS_UNLOCK_GIANT(vfslocked);