Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs Field "layerm_vfs" of "struct layer_mount" got su...



details:   https://anonhg.NetBSD.org/src/rev/721e419656c2
branches:  trunk
changeset: 352807:721e419656c2
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Apr 11 07:51:37 2017 +0000

description:
Field "layerm_vfs" of "struct layer_mount" got superseded by "mnt_lower".
Adapt consumers and remove the now unused field.

Ride 7.99.68

diffstat:

 sys/miscfs/genfs/layer.h            |   3 +--
 sys/miscfs/genfs/layer_vfsops.c     |  18 +++++++++---------
 sys/miscfs/nullfs/null.h            |   3 +--
 sys/miscfs/nullfs/null_vfsops.c     |  12 ++++++------
 sys/miscfs/overlay/overlay.h        |   3 +--
 sys/miscfs/overlay/overlay_vfsops.c |  12 ++++++------
 sys/miscfs/umapfs/umap.h            |   3 +--
 sys/miscfs/umapfs/umap_vfsops.c     |  12 ++++++------
 8 files changed, 31 insertions(+), 35 deletions(-)

diffs (266 lines):

diff -r 8ec598b37e94 -r 721e419656c2 sys/miscfs/genfs/layer.h
--- a/sys/miscfs/genfs/layer.h  Tue Apr 11 07:46:37 2017 +0000
+++ b/sys/miscfs/genfs/layer.h  Tue Apr 11 07:51:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: layer.h,v 1.16 2014/05/28 10:51:20 hannken Exp $       */
+/*     $NetBSD: layer.h,v 1.17 2017/04/11 07:51:37 hannken Exp $       */
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -79,7 +79,6 @@
 #ifdef _KERNEL
 
 struct layer_mount {
-       struct mount            *layerm_vfs;
        struct vnode            *layerm_rootvp; /* Ref to root layer_node */
        u_int                   layerm_flags;   /* mount point layer flags */
        u_int                   layerm_size;    /* size of fs's struct node */
diff -r 8ec598b37e94 -r 721e419656c2 sys/miscfs/genfs/layer_vfsops.c
--- a/sys/miscfs/genfs/layer_vfsops.c   Tue Apr 11 07:46:37 2017 +0000
+++ b/sys/miscfs/genfs/layer_vfsops.c   Tue Apr 11 07:51:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: layer_vfsops.c,v 1.48 2017/03/30 09:16:52 hannken Exp $        */
+/*     $NetBSD: layer_vfsops.c,v 1.49 2017/04/11 07:51:37 hannken Exp $        */
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: layer_vfsops.c,v 1.48 2017/03/30 09:16:52 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: layer_vfsops.c,v 1.49 2017/04/11 07:51:37 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/sysctl.h>
@@ -127,7 +127,7 @@
 {
 
 #ifdef notyet
-       return VFS_START(MOUNTTOLAYERMOUNT(mp)->layerm_vfs, flags);
+       return VFS_START(mp->mnt_lower, flags);
 #else
        return 0;
 #endif
@@ -156,7 +156,7 @@
 layerfs_quotactl(struct mount *mp, struct quotactl_args *args)
 {
 
-       return VFS_QUOTACTL(MOUNTTOLAYERMOUNT(mp)->layerm_vfs, args);
+       return VFS_QUOTACTL(mp->mnt_lower, args);
 }
 
 int
@@ -169,7 +169,7 @@
        if (sbuf == NULL) {
                return ENOMEM;
        }
-       error = VFS_STATVFS(MOUNTTOLAYERMOUNT(mp)->layerm_vfs, sbuf);
+       error = VFS_STATVFS(mp->mnt_lower, sbuf);
        if (error) {
                goto done;
        }
@@ -249,7 +249,7 @@
        struct vnode *vp;
        int error;
 
-       error = VFS_VGET(MOUNTTOLAYERMOUNT(mp)->layerm_vfs, ino, &vp);
+       error = VFS_VGET(mp->mnt_lower, ino, &vp);
        if (error) {
                *vpp = NULL;
                return error;
@@ -276,7 +276,7 @@
        struct vnode *vp;
        int error;
 
-       error = VFS_FHTOVP(MOUNTTOLAYERMOUNT(mp)->layerm_vfs, fidp, &vp);
+       error = VFS_FHTOVP(mp->mnt_lower, fidp, &vp);
        if (error) {
                *vpp = NULL;
                return error;
@@ -381,12 +381,12 @@
 layerfs_renamelock_enter(struct mount *mp)
 {
 
-       return VFS_RENAMELOCK_ENTER(MOUNTTOLAYERMOUNT(mp)->layerm_vfs);
+       return VFS_RENAMELOCK_ENTER(mp->mnt_lower);
 }
 
 void
 layerfs_renamelock_exit(struct mount *mp)
 {
 
-       VFS_RENAMELOCK_EXIT(MOUNTTOLAYERMOUNT(mp)->layerm_vfs);
+       VFS_RENAMELOCK_EXIT(mp->mnt_lower);
 }
diff -r 8ec598b37e94 -r 721e419656c2 sys/miscfs/nullfs/null.h
--- a/sys/miscfs/nullfs/null.h  Tue Apr 11 07:46:37 2017 +0000
+++ b/sys/miscfs/nullfs/null.h  Tue Apr 11 07:51:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: null.h,v 1.19 2010/07/02 03:16:01 rmind Exp $  */
+/*     $NetBSD: null.h,v 1.20 2017/04/11 07:51:37 hannken Exp $        */
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -83,7 +83,6 @@
 struct null_mount {
        struct  layer_mount     lm;     /* generic layerfs mount stuff */
 };
-#define        nullm_vfs               lm.layerm_vfs
 #define        nullm_rootvp            lm.layerm_rootvp
 #define        nullm_export            lm.layerm_export
 #define        nullm_flags             lm.layerm_flags
diff -r 8ec598b37e94 -r 721e419656c2 sys/miscfs/nullfs/null_vfsops.c
--- a/sys/miscfs/nullfs/null_vfsops.c   Tue Apr 11 07:46:37 2017 +0000
+++ b/sys/miscfs/nullfs/null_vfsops.c   Tue Apr 11 07:51:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: null_vfsops.c,v 1.93 2017/03/30 09:13:01 hannken Exp $ */
+/*     $NetBSD: null_vfsops.c,v 1.94 2017/04/11 07:51:37 hannken Exp $ */
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.93 2017/03/30 09:13:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.94 2017/04/11 07:51:37 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -140,9 +140,6 @@
        /* Create the mount point. */
        nmp = kmem_zalloc(sizeof(struct null_mount), KM_SLEEP);
        mp->mnt_data = nmp;
-       nmp->nullm_vfs = lowerrootvp->v_mount;
-       if (nmp->nullm_vfs->mnt_flag & MNT_LOCAL)
-               mp->mnt_flag |= MNT_LOCAL;
 
        /*
         * Make sure that the mount point is sufficiently initialized
@@ -177,7 +174,10 @@
            UIO_USERSPACE, mp->mnt_op->vfs_name, mp, curlwp);
        if (error)
                return error;
-       mp->mnt_lower = nmp->nullm_vfs;
+
+       mp->mnt_lower = lowerrootvp->v_mount;
+       if (mp->mnt_lower->mnt_flag & MNT_LOCAL)
+               mp->mnt_flag |= MNT_LOCAL;
        return 0;
 }
 
diff -r 8ec598b37e94 -r 721e419656c2 sys/miscfs/overlay/overlay.h
--- a/sys/miscfs/overlay/overlay.h      Tue Apr 11 07:46:37 2017 +0000
+++ b/sys/miscfs/overlay/overlay.h      Tue Apr 11 07:51:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: overlay.h,v 1.8 2008/06/28 01:34:06 rumble Exp $       */
+/*     $NetBSD: overlay.h,v 1.9 2017/04/11 07:51:37 hannken Exp $      */
 
 /*
  * Copyright (c) 1999 National Aeronautics & Space Administration
@@ -86,7 +86,6 @@
 struct overlay_mount {
        struct  layer_mount     lm;     /* generic layerfs mount stuff */
 };
-#define        ovm_vfs                 lm.layerm_vfs
 #define        ovm_rootvp              lm.layerm_rootvp
 #define        ovm_export              lm.layerm_export
 #define        ovm_flags               lm.layerm_flags
diff -r 8ec598b37e94 -r 721e419656c2 sys/miscfs/overlay/overlay_vfsops.c
--- a/sys/miscfs/overlay/overlay_vfsops.c       Tue Apr 11 07:46:37 2017 +0000
+++ b/sys/miscfs/overlay/overlay_vfsops.c       Tue Apr 11 07:51:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: overlay_vfsops.c,v 1.66 2017/03/30 09:13:01 hannken Exp $      */
+/*     $NetBSD: overlay_vfsops.c,v 1.67 2017/04/11 07:51:37 hannken Exp $      */
 
 /*
  * Copyright (c) 1999, 2000 National Aeronautics & Space Administration
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.66 2017/03/30 09:13:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.67 2017/04/11 07:51:37 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -149,9 +149,6 @@
        nmp = kmem_zalloc(sizeof(struct overlay_mount), KM_SLEEP);
 
        mp->mnt_data = nmp;
-       nmp->ovm_vfs = lowerrootvp->v_mount;
-       if (nmp->ovm_vfs->mnt_flag & MNT_LOCAL)
-               mp->mnt_flag |= MNT_LOCAL;
 
        /*
         * Make sure that the mount point is sufficiently initialized
@@ -191,7 +188,10 @@
            UIO_USERSPACE, mp->mnt_op->vfs_name, mp, l);
        if (error)
                return error;
-       mp->mnt_lower = nmp->ovm_vfs;
+
+       mp->mnt_lower = lowerrootvp->v_mount;
+       if (mp->mnt_lower->mnt_flag & MNT_LOCAL)
+               mp->mnt_flag |= MNT_LOCAL;
 #ifdef OVERLAYFS_DIAGNOSTIC
        printf("ov_mount: lower %s, alias at %s\n",
            mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname);
diff -r 8ec598b37e94 -r 721e419656c2 sys/miscfs/umapfs/umap.h
--- a/sys/miscfs/umapfs/umap.h  Tue Apr 11 07:46:37 2017 +0000
+++ b/sys/miscfs/umapfs/umap.h  Tue Apr 11 07:51:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umap.h,v 1.16 2008/06/28 01:34:06 rumble Exp $ */
+/*     $NetBSD: umap.h,v 1.17 2017/04/11 07:51:37 hannken Exp $        */
 
 /*
  * Copyright (c) 1992, 1993
@@ -64,7 +64,6 @@
        u_long          info_gmapdata[GMAPFILEENTRIES][2]; /*mapping data for
            group mapping in ficus */
 };
-#define        umapm_vfs               lm.layerm_vfs
 #define        umapm_rootvp            lm.layerm_rootvp
 #define        umapm_export            lm.layerm_export
 #define        umapm_flags             lm.layerm_flags
diff -r 8ec598b37e94 -r 721e419656c2 sys/miscfs/umapfs/umap_vfsops.c
--- a/sys/miscfs/umapfs/umap_vfsops.c   Tue Apr 11 07:46:37 2017 +0000
+++ b/sys/miscfs/umapfs/umap_vfsops.c   Tue Apr 11 07:51:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umap_vfsops.c,v 1.98 2017/03/30 09:13:01 hannken Exp $ */
+/*     $NetBSD: umap_vfsops.c,v 1.99 2017/04/11 07:51:37 hannken Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umap_vfsops.c,v 1.98 2017/03/30 09:13:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umap_vfsops.c,v 1.99 2017/04/11 07:51:37 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -145,9 +145,6 @@
 
        amp = kmem_zalloc(sizeof(struct umap_mount), KM_SLEEP);
        mp->mnt_data = amp;
-       amp->umapm_vfs = lowerrootvp->v_mount;
-       if (amp->umapm_vfs->mnt_flag & MNT_LOCAL)
-               mp->mnt_flag |= MNT_LOCAL;
 
        /*
         * Now copy in the number of entries and maps for umap mapping.
@@ -226,7 +223,10 @@
            UIO_USERSPACE, mp->mnt_op->vfs_name, mp, l);
        if (error)
                return error;
-       mp->mnt_lower = amp->umapm_vfs;
+
+       mp->mnt_lower = lowerrootvp->v_mount;
+       if (mp->mnt_lower->mnt_flag & MNT_LOCAL)
+               mp->mnt_flag |= MNT_LOCAL;
 #ifdef UMAPFS_DIAGNOSTIC
        printf("umapfs_mount: lower %s, alias at %s\n",
                mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname);



Home | Main Index | Thread Index | Old Index