Source-Changes-HG archive

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

[src/uebayasi-xip]: src After consideration, put back "xip" mount option.



details:   https://anonhg.NetBSD.org/src/rev/de0f9a12467d
branches:  uebayasi-xip
changeset: 751806:de0f9a12467d
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Thu Oct 21 08:45:03 2010 +0000

description:
After consideration, put back "xip" mount option.

The internal behavior is totally different between with and without
the option; automatic detection and/or fall-through are not user
friendly.  mount(8) returning the "xip" flag is also informative.

diffstat:

 sbin/mount/mount.8         |    4 +-
 sbin/mount_ffs/mount_ffs.c |    5 +-
 share/man/man5/statvfs.5   |  191 +++++++++++++++++++++++++++++++++++++++++++++
 sys/sys/fstypes.h          |   18 ++--
 sys/sys/statvfs.h          |    5 +-
 sys/ufs/ffs/ffs_vfsops.c   |   22 ++--
 6 files changed, 219 insertions(+), 26 deletions(-)

diffs (truncated from 397 to 300 lines):

diff -r 33b1d263de69 -r de0f9a12467d sbin/mount/mount.8
--- a/sbin/mount/mount.8        Thu Oct 07 08:54:16 2010 +0000
+++ b/sbin/mount/mount.8        Thu Oct 21 08:45:03 2010 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: mount.8,v 1.69.2.2 2010/05/28 09:14:55 uebayasi Exp $
+.\"    $NetBSD: mount.8,v 1.69.2.3 2010/10/21 08:45:04 uebayasi Exp $
 .\"
 .\" Copyright (c) 1980, 1989, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -299,6 +299,8 @@
 The same as
 .Fl u ;
 indicate that the status of an already mounted file system should be changed.
+.It Cm xip
+Enable eXecute-In-Place if the block device supports it.
 .El
 .Pp
 Any additional options specific to a given file system type (see the
diff -r 33b1d263de69 -r de0f9a12467d sbin/mount_ffs/mount_ffs.c
--- a/sbin/mount_ffs/mount_ffs.c        Thu Oct 07 08:54:16 2010 +0000
+++ b/sbin/mount_ffs/mount_ffs.c        Thu Oct 21 08:45:03 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mount_ffs.c,v 1.25.10.2 2010/05/28 09:14:55 uebayasi Exp $     */
+/*     $NetBSD: mount_ffs.c,v 1.25.10.3 2010/10/21 08:45:04 uebayasi Exp $     */
 
 /*-
  * Copyright (c) 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)mount_ufs.c        8.4 (Berkeley) 4/26/95";
 #else
-__RCSID("$NetBSD: mount_ffs.c,v 1.25.10.2 2010/05/28 09:14:55 uebayasi Exp $");
+__RCSID("$NetBSD: mount_ffs.c,v 1.25.10.3 2010/10/21 08:45:04 uebayasi Exp $");
 #endif
 #endif /* not lint */
 
@@ -74,6 +74,7 @@
        MOPT_SOFTDEP,
        MOPT_LOG,
        MOPT_GETARGS,
+       MOPT_XIP,
        MOPT_NULL,
 };
 
diff -r 33b1d263de69 -r de0f9a12467d share/man/man5/statvfs.5
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man5/statvfs.5  Thu Oct 21 08:45:03 2010 +0000
@@ -0,0 +1,191 @@
+.\"    $NetBSD: statvfs.5,v 1.12.2.2 2010/10/21 08:45:04 uebayasi Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 1993
+.\"    The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"    @(#)statfs.2    8.5 (Berkeley) 5/24/95
+.\"
+.Dd October 20, 2010
+.Dt STATVFS 5
+.Os
+.Sh NAME
+.Nm statvfs
+.Nd file system statistics
+.Sh SYNOPSIS
+.In sys/types.h
+.In sys/statvfs.h
+.Sh DESCRIPTION
+The
+.In sys/statvfs.h
+header defines the structures and functions that
+return information about a mounted file system.
+The
+.Nm statvfs
+structure is defined as follows:
+.Bd -literal
+typedef struct { int32_t val[2]; } fsid_t;     /* file system id type */
+
+#define VFS_NAMELEN  32        /* length of fs type name, including nul */
+#define VFS_MNAMELEN 1024      /* length of buffer for returned name */
+
+struct statvfs {
+       unsigned long   f_flag;   /* copy of mount exported flags */
+       unsigned long   f_bsize;  /* system block size */
+       unsigned long   f_frsize; /* system fragment size */
+       unsigned long   f_iosize; /* optimal file system block size */
+
+       fsblkcnt_t      f_blocks; /* number of blocks in file system */
+       fsblkcnt_t      f_bfree;  /* free blocks avail in file system */
+       fsblkcnt_t      f_bavail; /* free blocks avail to non-root */
+       fsblkcnt_t      f_bresvd; /* blocks reserved for root */
+
+       fsfilcnt_t      f_files;  /* total file nodes in file system */
+       fsfilcnt_t      f_ffree;  /* free file nodes in file system */
+       fsfilcnt_t      f_favail; /* free file nodes avail to non-root */
+       fsfilcnt_t      f_fresvd; /* file nodes reserved for root */
+
+       uint64_t  f_syncreads;    /* count of sync reads since mount */
+       uint64_t  f_syncwrites;   /* count of sync writes since mount */
+
+       uint64_t  f_asyncreads;   /* count of async reads since mount */
+       uint64_t  f_asyncwrites;  /* count of async writes since mount */
+
+       unsigned long   f_fsid;   /* POSIX compliant file system id */
+       fsid_t          f_fsidx;  /* NetBSD compatible file system id */
+
+       unsigned long   f_namemax;/* maximum filename length */
+       uid_t           f_owner; /* user that mounted the file system */
+
+       uint32_t        f_spare[4]; /* spare space */
+
+       char    f_fstypename[VFS_NAMELEN]; /* fs type name */
+       char    f_mntonname[VFS_MNAMELEN]; /* directory on which mounted */
+       char    f_mntfromname[VFS_MNAMELEN]; /* mounted file system */
+};
+.Ed
+.Pp
+The
+.Fa f_flag
+argument can have the following bits set:
+.Bl -tag -width ST_SYNCHRONOUS
+.It Dv ST_RDONLY
+The filesystem is mounted read-only;
+Even the super-user may not write on it.
+.It Dv ST_NOEXEC
+Files may not be executed from the filesystem.
+.It Dv ST_NOSUID
+Setuid and setgid bits on files are not honored when they are executed.
+.It Dv ST_NODEV
+Special files in the filesystem may not be opened.
+.It Dv ST_UNION
+Union with underlying filesystem instead of obscuring it.
+.It Dv ST_SYNCHRONOUS
+All I/O to the filesystem is done synchronously.
+.It Dv ST_ASYNC
+No filesystem I/O is done synchronously.
+.It Dv ST_NOCOREDUMP
+Don't write core dumps to this file system.
+.It Dv ST_XIP
+Use XIP (eXecute-In-Place).
+.It Dv ST_LOG
+Use logging (journalling).
+.It Dv ST_NOATIME
+Never update access times.
+.It Dv ST_SYMPERM
+Recognize symbolic link permission.
+.It Dv ST_NODEVMTIME
+Never update modification times for device files.
+.It Dv ST_LOCAL
+The filesystem resides locally.
+.It Dv ST_QUOTA
+The filesystem has quotas enabled on it.
+.It Dv ST_ROOTFS
+Identifies the root filesystem.
+.It Dv ST_EXRDONLY
+The filesystem is exported read-only.
+.It Dv ST_EXPORTED
+The filesystem is exported for both reading and writing.
+.It Dv ST_DEFEXPORTED
+The filesystem is exported for both reading and writing to any Internet host.
+.It Dv ST_EXPORTANON
+The filesystem maps all remote accesses to the anonymous user.
+.It Dv ST_EXKERB
+The filesystem is exported with Kerberos uid mapping.
+.It Dv ST_EXNORESPORT
+Don't enforce reserved ports (NFS).
+.It Dv ST_EXPUBLIC
+Public export (WebNFS).
+.El
+.Pp
+Fields that are undefined for a particular file system are set to \-1.
+.Sh NOTES
+.Bl -tag -width f_bavail
+.It f_flag
+The
+.Fa f_flag
+field is the same as the
+.Fa f_flags
+field in the
+.Bx 4.3
+.Xr statfs 2
+system call.
+.It f_fsid
+Is defined to be
+.Ft unsigned long
+by the X/Open standard.
+Unfortunately this is not enough space to store our
+.Ft fsid_t ,
+so we define an additional
+.Fa f_fsidx
+field.
+.It f_bavail
+Could historically be negative (in the
+.Xr statfs 2
+system call) when the used space has exceeded
+the non-superuser free space.
+In order to comply with the X/Open standard, we have to define
+.Ft fsblkcnt_t
+as an unsigned type, so in all cases where
+.Fa f_bavail
+would have been negative, we set it to 0.
+In addition we provide
+.Fa f_bresvd
+which contains the amount of reserved blocks for the superuser, so
+the old value of
+.Fa f_bavail
+can be easily computed as:
+.Bd -literal
+       old_bavail = f_bfree - f_bresvd;
+.Ed
+.El
+.Sh SEE ALSO
+.Xr statvfs 2
+.Sh HISTORY
+The
+.In sys/statvfs.h
+header first appeared in
+.Nx 3.0 .
diff -r 33b1d263de69 -r de0f9a12467d sys/sys/fstypes.h
--- a/sys/sys/fstypes.h Thu Oct 07 08:54:16 2010 +0000
+++ b/sys/sys/fstypes.h Thu Oct 21 08:45:03 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fstypes.h,v 1.26.14.3 2010/05/28 09:14:55 uebayasi Exp $       */
+/*     $NetBSD: fstypes.h,v 1.26.14.4 2010/10/21 08:45:03 uebayasi Exp $       */
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -86,7 +86,6 @@
 #define        __MNT_UNUSED1   0x00020000
 #define        __MNT_UNUSED2   0x00200000
 #define        __MNT_UNUSED3   0x00800000
-#define        __MNT_UNUSED4   0x01000000
 
 #define        MNT_RDONLY      0x00000001      /* read only filesystem */
 #define        MNT_SYNCHRONOUS 0x00000002      /* file system written synchronously */
@@ -97,6 +96,7 @@
 #define        MNT_ASYNC       0x00000040      /* file system written asynchronously */
 #define        MNT_NOCOREDUMP  0x00008000      /* don't write core dumps to this FS */
 #define        MNT_IGNORE      0x00100000      /* don't show entry in df */
+#define        MNT_XIP         0x01000000      /* eXecute-In-Place */
 #define        MNT_LOG         0x02000000      /* Use logging */
 #define        MNT_NOATIME     0x04000000      /* Never update access times in fs */
 #define        MNT_SYMPERM     0x20000000      /* recognize symlink permission */
@@ -113,11 +113,12 @@
        { MNT_ASYNC,            0,      "asynchronous" }, \
        { MNT_NOCOREDUMP,       0,      "nocoredump" }, \
        { MNT_IGNORE,           0,      "hidden" }, \
+       { MNT_XIP,              0,      "xip" }, \
+       { MNT_LOG,              0,      "log" }, \
        { MNT_NOATIME,          0,      "noatime" }, \
        { MNT_SYMPERM,          0,      "symperm" }, \
        { MNT_NODEVMTIME,       0,      "nodevmtime" }, \
-       { MNT_SOFTDEP,          0,      "soft dependencies" }, \
-       { MNT_LOG,              0,      "log" },
+       { MNT_SOFTDEP,          0,      "soft dependencies" },
 
 /*
  * exported mount flags.
@@ -164,6 +165,8 @@
      MNT_ASYNC | \
      MNT_NOCOREDUMP | \
      MNT_IGNORE | \
+     MNT_XIP | \
+     MNT_LOG | \
      MNT_NOATIME | \
      MNT_SYMPERM | \
      MNT_NODEVMTIME | \
@@ -177,8 +180,7 @@
      MNT_EXPUBLIC | \
      MNT_LOCAL | \
      MNT_QUOTA | \
-     MNT_ROOTFS | \
-     MNT_LOG)
+     MNT_ROOTFS)
 
 /*
  * External filesystem control flags.
@@ -210,7 +212,6 @@
 #define        IMNT_DTYPE      0x00000040      /* returns d_type fields */



Home | Main Index | Thread Index | Old Index