Module Name: src Committed By: hannken Date: Wed Feb 22 09:50:13 UTC 2017
Modified Files: src/sys/fs/msdosfs: msdosfs_vfsops.c src/sys/kern: vfs_mount.c src/sys/sys: param.h src/sys/ufs/ffs: ffs_vfsops.c Log Message: Enable fstrans on all file systems. Welcome to 7.99.61 To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/sys/fs/msdosfs/msdosfs_vfsops.c cvs rdiff -u -r1.47 -r1.48 src/sys/kern/vfs_mount.c cvs rdiff -u -r1.527 -r1.528 src/sys/sys/param.h cvs rdiff -u -r1.345 -r1.346 src/sys/ufs/ffs/ffs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/fs/msdosfs/msdosfs_vfsops.c diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.122 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.123 --- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.122 Fri Feb 17 08:31:24 2017 +++ src/sys/fs/msdosfs/msdosfs_vfsops.c Wed Feb 22 09:50:13 2017 @@ -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 @@ msdosfs_mountfs(struct vnode *devvp, str 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 @@ msdosfs_mountfs(struct vnode *devvp, str return (0); error_exit: - fstrans_unmount(mp); if (bp) brelse(bp, BC_AGE); if (pmp) { @@ -923,7 +918,6 @@ msdosfs_unmount(struct mount *mp, int mn free(pmp, M_MSDOSFSMNT); mp->mnt_data = NULL; mp->mnt_flag &= ~MNT_LOCAL; - fstrans_unmount(mp); return (0); } Index: src/sys/kern/vfs_mount.c diff -u src/sys/kern/vfs_mount.c:1.47 src/sys/kern/vfs_mount.c:1.48 --- src/sys/kern/vfs_mount.c:1.47 Fri Jan 27 10:50:10 2017 +++ src/sys/kern/vfs_mount.c Wed Feb 22 09:50:13 2017 @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_mount.c, #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 @@ mount_domount(struct lwp *l, vnode_t **v 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_mounted: 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 @@ dounmount(struct mount *mp, int flags, s 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 @@ done: 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 Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.527 src/sys/sys/param.h:1.528 --- src/sys/sys/param.h:1.527 Fri Feb 17 08:32:04 2017 +++ src/sys/sys/param.h Wed Feb 22 09:50:13 2017 @@ -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__) Index: src/sys/ufs/ffs/ffs_vfsops.c diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.345 src/sys/ufs/ffs/ffs_vfsops.c:1.346 --- src/sys/ufs/ffs/ffs_vfsops.c:1.345 Fri Feb 17 08:31:26 2017 +++ src/sys/ufs/ffs/ffs_vfsops.c Wed Feb 22 09:50:13 2017 @@ -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 @@ ffs_mountfs(struct vnode *devvp, struct 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 @@ out: } #endif - fstrans_unmount(mp); if (fs) kmem_free(fs, fs->fs_sbsize); spec_node_setmountedfs(devvp, NULL); @@ -1739,7 +1732,6 @@ ffs_unmount(struct mount *mp, int mntfla kmem_free(ump, sizeof(*ump)); mp->mnt_data = NULL; mp->mnt_flag &= ~MNT_LOCAL; - fstrans_unmount(mp); return (0); }