Source-Changes-HG archive

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

[src/trunk]: src/sys - collect the long (and sometimes incomplete) lists of b...



details:   https://anonhg.NetBSD.org/src/rev/68bd1e7e0b62
branches:  trunk
changeset: 771305:68bd1e7e0b62
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Nov 18 21:17:45 2011 +0000

description:
- collect the long (and sometimes incomplete) lists of basic flags into
  the header file and use that.
- sort the list of basic flags
- add MNT_RELATIME, ST_RELATIME
- mask all the op flags, for symmetry.

The real bit difference is (which is harmless):
    - mount was missing MNT_EXTATTR
    - update sets MNT_RDONLY twice
    - ops also could or in MNT_GETARGS, but this is impossible because the
      code would have chosen to do getargs then.

diffstat:

 sys/kern/vfs_mount.c    |  10 +++-------
 sys/kern/vfs_syscalls.c |  19 +++++--------------
 sys/sys/fstypes.h       |  39 ++++++++++++++++++++++-----------------
 sys/sys/statvfs.h       |   3 ++-
 4 files changed, 32 insertions(+), 39 deletions(-)

diffs (173 lines):

diff -r e34986ba35d7 -r 68bd1e7e0b62 sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c      Fri Nov 18 21:04:21 2011 +0000
+++ b/sys/kern/vfs_mount.c      Fri Nov 18 21:17:45 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_mount.c,v 1.11 2011/10/14 09:23:31 hannken Exp $   */
+/*     $NetBSD: vfs_mount.c,v 1.12 2011/11/18 21:17:45 christos 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.11 2011/10/14 09:23:31 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.12 2011/11/18 21:17:45 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -696,11 +696,7 @@
         *
         * Set the mount level flags.
         */
-       mp->mnt_flag = flags &
-          (MNT_FORCE | MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
-           MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
-           MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
-           MNT_LOG | MNT_IGNORE | MNT_RDONLY);
+       mp->mnt_flag = flags & (MNT_BASIC_FLAGS | MNT_FORCE | MNT_IGNORE);
 
        mutex_enter(&mp->mnt_updating);
        error = VFS_MOUNT(mp, path, data, data_len);
diff -r e34986ba35d7 -r 68bd1e7e0b62 sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Fri Nov 18 21:04:21 2011 +0000
+++ b/sys/kern/vfs_syscalls.c   Fri Nov 18 21:17:45 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.440 2011/10/14 09:23:31 hannken Exp $       */
+/*     $NetBSD: vfs_syscalls.c,v 1.441 2011/11/18 21:17:45 christos Exp $      */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.440 2011/10/14 09:23:31 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.441 2011/11/18 21:17:45 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -221,7 +221,7 @@
        mutex_enter(&mp->mnt_updating);
 
        mp->mnt_flag &= ~MNT_OP_FLAGS;
-       mp->mnt_flag |= flags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE);
+       mp->mnt_flag |= flags & MNT_OP_FLAGS;
 
        /*
         * Set the mount level flags.
@@ -230,17 +230,8 @@
                mp->mnt_flag |= MNT_RDONLY;
        else if (mp->mnt_flag & MNT_RDONLY)
                mp->mnt_iflag |= IMNT_WANTRDWR;
-       mp->mnt_flag &=
-         ~(MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
-           MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
-           MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
-           MNT_LOG | MNT_EXTATTR);
-       mp->mnt_flag |= flags &
-          (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
-           MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOCOREDUMP |
-           MNT_NOATIME | MNT_NODEVMTIME | MNT_SYMPERM | MNT_SOFTDEP |
-           MNT_LOG | MNT_EXTATTR | MNT_IGNORE);
-
+       mp->mnt_flag &= ~MNT_BASIC_FLAGS;
+       mp->mnt_flag |= flags & MNT_BASIC_FLAGS;
        error = VFS_MOUNT(mp, path, data, data_len);
 
        if (error && data != NULL) {
diff -r e34986ba35d7 -r 68bd1e7e0b62 sys/sys/fstypes.h
--- a/sys/sys/fstypes.h Fri Nov 18 21:04:21 2011 +0000
+++ b/sys/sys/fstypes.h Fri Nov 18 21:17:45 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fstypes.h,v 1.29 2011/06/17 14:23:51 manu Exp $        */
+/*     $NetBSD: fstypes.h,v 1.30 2011/11/18 21:17:45 christos Exp $    */
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -83,9 +83,8 @@
  * one of the __MNT_UNUSED flags.
  */
 
-#define        __MNT_UNUSED1   0x00020000
-#define        __MNT_UNUSED2   0x00200000
-#define        __MNT_UNUSED3   0x00800000
+#define        __MNT_UNUSED1   0x00200000
+#define        __MNT_UNUSED2   0x00800000
 
 #define        MNT_RDONLY      0x00000001      /* read only filesystem */
 #define        MNT_SYNCHRONOUS 0x00000002      /* file system written synchronously */
@@ -95,6 +94,7 @@
 #define        MNT_UNION       0x00000020      /* union with underlying filesystem */
 #define        MNT_ASYNC       0x00000040      /* file system written asynchronously */
 #define        MNT_NOCOREDUMP  0x00008000      /* don't write core dumps to this FS */
+#define        MNT_RELATIME    0x00020000      /* only update access time if mod/ch */
 #define        MNT_IGNORE      0x00100000      /* don't show entry in df */
 #define        MNT_EXTATTR     0x01000000      /* enable extended attributes */
 #define        MNT_LOG         0x02000000      /* Use logging */
@@ -104,22 +104,27 @@
 #define        MNT_SOFTDEP     0x80000000      /* Use soft dependencies */
 
 #define        __MNT_BASIC_FLAGS \
-       { MNT_RDONLY,           0,      "read-only" }, \
-       { MNT_SYNCHRONOUS,      0,      "synchronous" }, \
+       { MNT_ASYNC,            0,      "asynchronous" }, \
+       { MNT_EXTATTR,          0,      "extattr" }, \
+       { MNT_IGNORE,           0,      "hidden" }, \
+       { MNT_LOG,              0,      "log" }, \
+       { MNT_NOATIME,          0,      "noatime" }, \
+       { MNT_NOCOREDUMP,       0,      "nocoredump" }, \
+       { MNT_NODEV,            0,      "nodev" }, \
+       { MNT_NODEVMTIME,       0,      "nodevmtime" }, \
        { MNT_NOEXEC,           0,      "noexec" }, \
        { MNT_NOSUID,           0,      "nosuid" }, \
-       { MNT_NODEV,            0,      "nodev" }, \
+       { MNT_RDONLY,           0,      "read-only" }, \
+       { MNT_RELATIME,         0,      "relatime" }, \
+       { MNT_SOFTDEP,          0,      "soft dependencies" }, \
+       { MNT_SYMPERM,          0,      "symperm" }, \
+       { MNT_SYNCHRONOUS,      0,      "synchronous" }, \
        { MNT_UNION,            0,      "union" }, \
-       { MNT_ASYNC,            0,      "asynchronous" }, \
-       { MNT_NOCOREDUMP,       0,      "nocoredump" }, \
-       { MNT_IGNORE,           0,      "hidden" }, \
-       { MNT_NOATIME,          0,      "noatime" }, \
-       { MNT_SYMPERM,          0,      "symperm" }, \
-       { MNT_NODEVMTIME,       0,      "nodevmtime" }, \
-       { MNT_SOFTDEP,          0,      "soft dependencies" }, \
-       { MNT_LOG,              0,      "log" }, \
-       { MNT_EXTATTR,          0,      "extattr" }, 
 
+#define MNT_BASIC_FLAGS (MNT_ASYNC | MNT_EXTATTR | MNT_LOG | MNT_NOATIME | \
+    MNT_NOCOREDUMP | MNT_NODEV | MNT_NODEVMTIME | MNT_NOEXEC | MNT_NOSUID | \
+    MNT_RDONLY | MNT_RELATIME | MNT_SOFTDEP | MNT_SYMPERM | \
+    MNT_SYNCHRONOUS | MNT_UNION)
 /*
  * exported mount flags.
  */
@@ -236,7 +241,7 @@
        "\25MNT_IGNORE" \
        "\24MNT_FORCE" \
        "\23MNT_RELOAD" \
-       "\22MNT_UNUSED" \
+       "\22MNT_RELATIME" \
        "\21MNT_UPDATE" \
        "\20MNT_NOCOREDUMP" \
        "\17MNT_ROOTFS" \
diff -r e34986ba35d7 -r 68bd1e7e0b62 sys/sys/statvfs.h
--- a/sys/sys/statvfs.h Fri Nov 18 21:04:21 2011 +0000
+++ b/sys/sys/statvfs.h Fri Nov 18 21:17:45 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: statvfs.h,v 1.16 2011/06/17 14:23:51 manu Exp $         */
+/*     $NetBSD: statvfs.h,v 1.17 2011/11/18 21:17:45 christos Exp $     */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -113,6 +113,7 @@
 #define        ST_UNION        MNT_UNION
 #define        ST_ASYNC        MNT_ASYNC
 #define        ST_NOCOREDUMP   MNT_NOCOREDUMP
+#define        ST_RELATIME     MNT_RELATIME
 #define        ST_IGNORE       MNT_IGNORE
 #define        ST_NOATIME      MNT_NOATIME
 #define        ST_SYMPERM      MNT_SYMPERM



Home | Main Index | Thread Index | Old Index