Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Enable fstrans on all file systems.
details: https://anonhg.NetBSD.org/src/rev/58e2a363e5f4
branches: trunk
changeset: 351682:58e2a363e5f4
user: hannken <hannken%NetBSD.org@localhost>
date: Wed Feb 22 09:50:13 2017 +0000
description:
Enable fstrans on all file systems.
Welcome to 7.99.61
diffstat:
sys/fs/msdosfs/msdosfs_vfsops.c | 10 ++--------
sys/kern/vfs_mount.c | 15 +++++++++++++--
sys/sys/param.h | 4 ++--
sys/ufs/ffs/ffs_vfsops.c | 12 ++----------
4 files changed, 19 insertions(+), 22 deletions(-)
diffs (174 lines):
diff -r 88843d653177 -r 58e2a363e5f4 sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c Wed Feb 22 09:47:18 2017 +0000
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c Wed Feb 22 09:50:13 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vfsops.c,v 1.122 2017/02/17 08:31:24 hannken Exp $ */
+/* $NetBSD: msdosfs_vfsops.c,v 1.123 2017/02/22 09:50:13 hannken Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.122 2017/02/17 08:31:24 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.123 2017/02/22 09:50:13 hannken Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -478,10 +478,6 @@
bp = NULL; /* both used in error_exit */
pmp = NULL;
- error = fstrans_mount(mp);
- if (error)
- goto error_exit;
-
error = getdisksize(devvp, &psize, &secsize);
if (error) {
if (argp->flags & MSDOSFSMNT_GEMDOSFS)
@@ -858,7 +854,6 @@
return (0);
error_exit:
- fstrans_unmount(mp);
if (bp)
brelse(bp, BC_AGE);
if (pmp) {
@@ -923,7 +918,6 @@
free(pmp, M_MSDOSFSMNT);
mp->mnt_data = NULL;
mp->mnt_flag &= ~MNT_LOCAL;
- fstrans_unmount(mp);
return (0);
}
diff -r 88843d653177 -r 58e2a363e5f4 sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c Wed Feb 22 09:47:18 2017 +0000
+++ b/sys/kern/vfs_mount.c Wed Feb 22 09:50:13 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_mount.c,v 1.47 2017/01/27 10:50:10 hannken Exp $ */
+/* $NetBSD: vfs_mount.c,v 1.48 2017/02/22 09:50:13 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.47 2017/01/27 10:50:10 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.48 2017/02/22 09:50:13 hannken Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -82,6 +82,7 @@
#include <sys/kmem.h>
#include <sys/module.h>
#include <sys/mount.h>
+#include <sys/fstrans.h>
#include <sys/namei.h>
#include <sys/extattr.h>
#include <sys/syscallargs.h>
@@ -710,6 +711,12 @@
return ENOMEM;
}
+ if ((error = fstrans_mount(mp)) != 0) {
+ vfs_unbusy(mp, false, NULL);
+ vfs_destroy(mp);
+ return error;
+ }
+
mp->mnt_stat.f_owner = kauth_cred_geteuid(l->l_cred);
/*
@@ -794,6 +801,7 @@
err_unmounted:
vp->v_mountedhere = NULL;
mutex_exit(&mp->mnt_updating);
+ fstrans_unmount(mp);
vfs_unbusy(mp, false, NULL);
vfs_destroy(mp);
@@ -919,6 +927,7 @@
mutex_exit(&syncer_mutex);
vfs_hooks_unmount(mp);
+ fstrans_unmount(mp);
vfs_destroy(mp); /* reference from mount() */
if (coveredvp != NULLVP) {
vrele(coveredvp);
@@ -1200,6 +1209,8 @@
mp = TAILQ_FIRST(&mountlist);
mp->mnt_flag |= MNT_ROOTFS;
mp->mnt_op->vfs_refcount++;
+ error = fstrans_mount(mp);
+ KASSERT(error == 0);
/*
* Get the vnode for '/'. Set cwdi0.cwdi_cdir to
diff -r 88843d653177 -r 58e2a363e5f4 sys/sys/param.h
--- a/sys/sys/param.h Wed Feb 22 09:47:18 2017 +0000
+++ b/sys/sys/param.h Wed Feb 22 09:50:13 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.527 2017/02/17 08:32:04 hannken Exp $ */
+/* $NetBSD: param.h,v 1.528 2017/02/22 09:50:13 hannken Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
* 2.99.9 (299000900)
*/
-#define __NetBSD_Version__ 799006000 /* NetBSD 7.99.60 */
+#define __NetBSD_Version__ 799006100 /* NetBSD 7.99.61 */
#define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \
(m) * 1000000) + (p) * 100) <= __NetBSD_Version__)
diff -r 88843d653177 -r 58e2a363e5f4 sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c Wed Feb 22 09:47:18 2017 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c Wed Feb 22 09:50:13 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_vfsops.c,v 1.345 2017/02/17 08:31:26 hannken Exp $ */
+/* $NetBSD: ffs_vfsops.c,v 1.346 2017/02/22 09:50:13 hannken Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.345 2017/02/17 08:31:26 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.346 2017/02/22 09:50:13 hannken Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -1115,12 +1115,6 @@
ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
- error = fstrans_mount(mp);
- if (error) {
- DPRINTF("fstrans_mount returned %d", error);
- return error;
- }
-
ump = kmem_zalloc(sizeof(*ump), KM_SLEEP);
mutex_init(&ump->um_lock, MUTEX_DEFAULT, IPL_NONE);
error = ffs_snapshot_init(ump);
@@ -1536,7 +1530,6 @@
}
#endif
- fstrans_unmount(mp);
if (fs)
kmem_free(fs, fs->fs_sbsize);
spec_node_setmountedfs(devvp, NULL);
@@ -1739,7 +1732,6 @@
kmem_free(ump, sizeof(*ump));
mp->mnt_data = NULL;
mp->mnt_flag &= ~MNT_LOCAL;
- fstrans_unmount(mp);
return (0);
}
Home |
Main Index |
Thread Index |
Old Index