Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Remove now redundant calls to fstrans_start()/fstrans_do...



details:   https://anonhg.NetBSD.org/src/rev/976f84993a02
branches:  trunk
changeset: 822098:976f84993a02
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Mar 01 10:41:28 2017 +0000

description:
Remove now redundant calls to fstrans_start()/fstrans_done().

diffstat:

 sys/fs/msdosfs/msdosfs_denode.c |  11 ++---------
 sys/fs/msdosfs/msdosfs_vfsops.c |   7 ++-----
 sys/fs/msdosfs/msdosfs_vnops.c  |  38 ++------------------------------------
 sys/ufs/ffs/ffs_alloc.c         |   5 ++---
 sys/ufs/ffs/ffs_snapshot.c      |   6 ++----
 sys/ufs/ffs/ffs_vfsops.c        |  14 ++------------
 sys/ufs/ffs/ffs_vnops.c         |  29 ++---------------------------
 sys/ufs/ufs/ufs_bmap.c          |   7 ++-----
 sys/ufs/ufs/ufs_inode.c         |   8 ++------
 sys/ufs/ufs/ufs_quota2.c        |   5 ++---
 sys/ufs/ufs/ufs_readwrite.c     |  17 ++---------------
 sys/ufs/ufs/ufs_vnops.c         |  39 ++-------------------------------------
 sys/ufs/ufs/ufs_wapbl.c         |   5 ++---
 13 files changed, 26 insertions(+), 165 deletions(-)

diffs (truncated from 1177 to 300 lines):

diff -r e4ba3a8223b8 -r 976f84993a02 sys/fs/msdosfs/msdosfs_denode.c
--- a/sys/fs/msdosfs/msdosfs_denode.c   Wed Mar 01 10:32:09 2017 +0000
+++ b/sys/fs/msdosfs/msdosfs_denode.c   Wed Mar 01 10:41:28 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_denode.c,v 1.52 2016/08/20 12:37:07 hannken Exp $      */
+/*     $NetBSD: msdosfs_denode.c,v 1.53 2017/03/01 10:41:28 hannken Exp $      */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,12 +48,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.52 2016/08/20 12:37:07 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.53 2017/03/01 10:41:28 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/mount.h>
-#include <sys/fstrans.h>
 #include <sys/malloc.h>
 #include <sys/pool.h>
 #include <sys/proc.h>
@@ -537,10 +536,8 @@
                struct vnode *a_vp;
        } */ *ap = v;
        struct vnode *vp = ap->a_vp;
-       struct mount *mp = vp->v_mount;
        struct denode *dep = VTODE(vp);
 
-       fstrans_start(mp, FSTRANS_LAZY);
 #ifdef MSDOSFS_DEBUG
        printf("msdosfs_reclaim(): dep %p, file %s, refcnt %ld\n",
            dep, dep->de_Name, dep->de_refcnt);
@@ -566,7 +563,6 @@
        vp->v_data = NULL;
        mutex_exit(vp->v_interlock);
        pool_put(&msdosfs_denode_pool, dep);
-       fstrans_done(mp);
        return (0);
 }
 
@@ -578,7 +574,6 @@
                bool *a_recycle;
        } */ *ap = v;
        struct vnode *vp = ap->a_vp;
-       struct mount *mp = vp->v_mount;
        struct denode *dep = VTODE(vp);
        int error = 0;
 
@@ -586,7 +581,6 @@
        printf("msdosfs_inactive(): dep %p, de_Name[0] %x\n", dep, dep->de_Name[0]);
 #endif
 
-       fstrans_start(mp, FSTRANS_LAZY);
        /*
         * Get rid of denodes related to stale file handles.
         */
@@ -623,7 +617,6 @@
 #endif
        *ap->a_recycle = (dep->de_Name[0] == SLOT_DELETED);
        VOP_UNLOCK(vp);
-       fstrans_done(mp);
        return (error);
 }
 
diff -r e4ba3a8223b8 -r 976f84993a02 sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c   Wed Mar 01 10:32:09 2017 +0000
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c   Wed Mar 01 10:41:28 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vfsops.c,v 1.123 2017/02/22 09:50:13 hannken Exp $     */
+/*     $NetBSD: msdosfs_vfsops.c,v 1.124 2017/03/01 10:41:28 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.123 2017/02/22 09:50:13 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.124 2017/03/01 10:41:28 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -69,7 +69,6 @@
 #include <sys/device.h>
 #include <sys/disklabel.h>
 #include <sys/disk.h>
-#include <sys/fstrans.h>
 #include <sys/ioctl.h>
 #include <sys/malloc.h>
 #include <sys/dirent.h>
@@ -1002,7 +1001,6 @@
                        /* update FATs here */
                }
        }
-       fstrans_start(mp, FSTRANS_SHARED);
        /*
         * Write back each (modified) denode.
         */
@@ -1031,7 +1029,6 @@
            waitfor == MNT_WAIT ? FSYNC_WAIT : 0, 0, 0)) != 0)
                allerror = error;
        VOP_UNLOCK(pmp->pm_devvp);
-       fstrans_done(mp);
        return (allerror);
 }
 
diff -r e4ba3a8223b8 -r 976f84993a02 sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c    Wed Mar 01 10:32:09 2017 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c    Wed Mar 01 10:41:28 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vnops.c,v 1.96 2016/02/01 16:53:23 christos Exp $      */
+/*     $NetBSD: msdosfs_vnops.c,v 1.97 2017/03/01 10:41:28 hannken Exp $       */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.96 2016/02/01 16:53:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.97 2017/03/01 10:41:28 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -60,7 +60,6 @@
 #include <sys/buf.h>
 #include <sys/proc.h>
 #include <sys/mount.h>
-#include <sys/fstrans.h>
 #include <sys/vnode.h>
 #include <sys/signalvar.h>
 #include <sys/malloc.h>
@@ -120,7 +119,6 @@
        printf("msdosfs_create(cnp %p, vap %p\n", cnp, ap->a_vap);
 #endif
 
-       fstrans_start(ap->a_dvp->v_mount, FSTRANS_SHARED);
        /*
         * If this is the root directory and there is no space left we
         * can't do anything.  This is because the root directory can not
@@ -153,13 +151,11 @@
        DETIMES(&ndirent, NULL, NULL, NULL, pdep->de_pmp->pm_gmtoff);
        if ((error = createde(&ndirent, pdep, &dep, cnp)) != 0)
                goto bad;
-       fstrans_done(ap->a_dvp->v_mount);
        VN_KNOTE(ap->a_dvp, NOTE_WRITE);
        *ap->a_vpp = DETOV(dep);
        return (0);
 
 bad:
-       fstrans_done(ap->a_dvp->v_mount);
        return (error);
 }
 
@@ -174,12 +170,10 @@
        struct vnode *vp = ap->a_vp;
        struct denode *dep = VTODE(vp);
 
-       fstrans_start(vp->v_mount, FSTRANS_SHARED);
        mutex_enter(vp->v_interlock);
        if (vp->v_usecount > 1)
                DETIMES(dep, NULL, NULL, NULL, dep->de_pmp->pm_gmtoff);
        mutex_exit(vp->v_interlock);
-       fstrans_done(vp->v_mount);
        return (0);
 }
 
@@ -262,7 +256,6 @@
        u_long dirsperblk = pmp->pm_BytesPerSec / sizeof(struct direntry);
        ino_t fileid;
 
-       fstrans_start(ap->a_vp->v_mount, FSTRANS_SHARED);
        DETIMES(dep, NULL, NULL, NULL, pmp->pm_gmtoff);
        vap->va_fsid = dep->de_dev;
        /*
@@ -313,7 +306,6 @@
        vap->va_bytes =
            (dep->de_FileSize + pmp->pm_crbomask) & ~pmp->pm_crbomask;
        vap->va_type = ap->a_vp->v_type;
-       fstrans_done(ap->a_vp->v_mount);
        return (0);
 }
 
@@ -361,7 +353,6 @@
        if (ap->a_vp->v_type == VDIR)
                return 0;
 
-       fstrans_start(vp->v_mount, FSTRANS_SHARED);
        if (vap->va_size != VNOVAL) {
                if (vp->v_mount->mnt_flag & MNT_RDONLY) {
                        error = EROFS;
@@ -441,7 +432,6 @@
        }
 
 bad:
-       fstrans_done(vp->v_mount);
        return error;
 }
 
@@ -478,7 +468,6 @@
        if (uio->uio_offset >= dep->de_FileSize)
                return (0);
 
-       fstrans_start(vp->v_mount, FSTRANS_SHARED);
        if (vp->v_type == VREG) {
                const int advice = IO_ADV_DECODE(ap->a_ioflag);
 
@@ -503,7 +492,6 @@
                on = uio->uio_offset & pmp->pm_crbomask;
                n = MIN(pmp->pm_bpcluster - on, uio->uio_resid);
                if (uio->uio_offset >= dep->de_FileSize) {
-                       fstrans_done(vp->v_mount);
                        return (0);
                }
                /* file size (and hence diff) may be up to 4GB */
@@ -540,7 +528,6 @@
                        error = uerror;
        }
 bad:
-       fstrans_done(vp->v_mount);
        return (error);
 }
 
@@ -599,7 +586,6 @@
        if (uio->uio_offset + uio->uio_resid > MSDOSFS_FILESIZE_MAX)
                return (EFBIG);
 
-       fstrans_start(vp->v_mount, FSTRANS_SHARED);
        /*
         * If the offset we are starting the write at is beyond the end of
         * the file, then they've done a seek.  Unix filesystems allow
@@ -608,7 +594,6 @@
         */
        if (uio->uio_offset > dep->de_FileSize) {
                if ((error = deextend(dep, uio->uio_offset, cred)) != 0) {
-                       fstrans_done(vp->v_mount);
                        return (error);
                }
        }
@@ -685,7 +670,6 @@
                uio->uio_resid = resid;
        } else if ((ioflag & IO_SYNC) == IO_SYNC)
                error = deupdat(dep, 1);
-       fstrans_done(vp->v_mount);
        KASSERT(vp->v_size == dep->de_FileSize);
        return (error);
 }
@@ -740,7 +724,6 @@
        struct denode *ddep = VTODE(ap->a_dvp);
        int error;
 
-       fstrans_start(ap->a_dvp->v_mount, FSTRANS_SHARED);
        if (ap->a_vp->v_type == VDIR)
                error = EPERM;
        else
@@ -757,7 +740,6 @@
                vput(ap->a_vp); /* causes msdosfs_inactive() to be called
                                 * via vrele() */
        vput(ap->a_dvp);
-       fstrans_done(ap->a_dvp->v_mount);
        return (error);
 }
 
@@ -832,7 +814,6 @@
        struct vnode *tdvp = ap->a_tdvp;
        struct vnode *fvp = ap->a_fvp;
        struct vnode *fdvp = ap->a_fdvp;
-       struct mount *mp = fdvp->v_mount;
        struct componentname *tcnp = ap->a_tcnp;
        struct componentname *fcnp = ap->a_fcnp;
        struct denode *ip, *xp, *dp, *zp;
@@ -910,7 +891,6 @@
        }
        VN_KNOTE(fdvp, NOTE_WRITE);             /* XXXLUKEM/XXX: right place? */
 
-       fstrans_start(mp, FSTRANS_SHARED);
        /*
         * When the target exists, both the directory
         * and target vnodes are returned locked.
@@ -997,7 +977,6 @@
         * file/directory.
         */
        if ((error = uniqdosname(VTODE(tdvp), tcnp, toname)) != 0) {
-               fstrans_done(mp);
                goto abortit;
        }
 
@@ -1013,7 +992,6 @@
                VOP_UNLOCK(fdvp);
                vrele(ap->a_fvp);
                vrele(tdvp);
-               fstrans_done(mp);
                return (error);
        }
        if (fvp == NULL) {
@@ -1025,7 +1003,6 @@
                vput(fdvp);
                vrele(ap->a_fvp);



Home | Main Index | Thread Index | Old Index