Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern No need to keep a not yet visible mount busy. Move...
details: https://anonhg.NetBSD.org/src/rev/72f10463e0b3
branches: trunk
changeset: 823257:72f10463e0b3
user: hannken <hannken%NetBSD.org@localhost>
date: Mon Apr 17 08:32:55 2017 +0000
description:
No need to keep a not yet visible mount busy. Move vfs_busy()
from vfs_mountalloc() to vfs_rootmountalloc().
XXX: Do we really need to vfs_busy() for vfs_mountroot?
diffstat:
sys/kern/vfs_mount.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diffs (76 lines):
diff -r 8d13ce8d21cc -r 72f10463e0b3 sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c Mon Apr 17 08:32:00 2017 +0000
+++ b/sys/kern/vfs_mount.c Mon Apr 17 08:32:55 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_mount.c,v 1.56 2017/04/17 08:32:01 hannken Exp $ */
+/* $NetBSD: vfs_mount.c,v 1.57 2017/04/17 08:32:55 hannken Exp $ */
/*-
* Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.56 2017/04/17 08:32:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.57 2017/04/17 08:32:55 hannken Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -148,7 +148,6 @@
vfs_mountalloc(struct vfsops *vfsops, vnode_t *vp)
{
struct mount *mp;
- int error __diagused;
mp = kmem_zalloc(sizeof(*mp), KM_SLEEP);
if (mp == NULL)
@@ -160,8 +159,6 @@
mutex_init(&mp->mnt_unmounting, MUTEX_DEFAULT, IPL_NONE);
mutex_init(&mp->mnt_renamelock, MUTEX_DEFAULT, IPL_NONE);
mutex_init(&mp->mnt_updating, MUTEX_DEFAULT, IPL_NONE);
- error = vfs_busy(mp);
- KASSERT(error == 0);
mp->mnt_vnodecovered = vp;
mount_initspecific(mp);
@@ -184,6 +181,7 @@
{
struct vfsops *vfsp = NULL;
struct mount *mp;
+ int error __diagused;
mutex_enter(&vfs_list_lock);
LIST_FOREACH(vfsp, &vfs_list, vfs_list)
@@ -199,6 +197,8 @@
if ((mp = vfs_mountalloc(vfsp, NULL)) == NULL)
return ENOMEM;
+ error = vfs_busy(mp);
+ KASSERT(error == 0);
mp->mnt_flag = MNT_RDONLY;
(void)strlcpy(mp->mnt_stat.f_fstypename, vfsp->vfs_name,
sizeof(mp->mnt_stat.f_fstypename));
@@ -721,7 +721,6 @@
}
if ((error = fstrans_mount(mp)) != 0) {
- vfs_unbusy(mp);
vfs_rele(mp);
return error;
}
@@ -789,7 +788,6 @@
/* Hold an additional reference to the mount across VFS_START(). */
vfs_ref(mp);
- vfs_unbusy(mp);
(void) VFS_STATVFS(mp, &mp->mnt_stat);
error = VFS_START(mp, 0);
if (error) {
@@ -810,7 +808,6 @@
vp->v_mountedhere = NULL;
mutex_exit(&mp->mnt_updating);
fstrans_unmount(mp);
- vfs_unbusy(mp);
vfs_rele(mp);
return error;
Home |
Main Index |
Thread Index |
Old Index