Module Name: src
Committed By: uebayasi
Date: Thu Oct 21 08:45:05 UTC 2010
Modified Files:
src/sbin/mount [uebayasi-xip]: mount.8
src/sbin/mount_ffs [uebayasi-xip]: mount_ffs.c
src/share/man/man5 [uebayasi-xip]: statvfs.5
src/sys/sys [uebayasi-xip]: fstypes.h statvfs.h
src/sys/ufs/ffs [uebayasi-xip]: ffs_vfsops.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.69.2.2 -r1.69.2.3 src/sbin/mount/mount.8
cvs rdiff -u -r1.25.10.2 -r1.25.10.3 src/sbin/mount_ffs/mount_ffs.c
cvs rdiff -u -r1.12 -r1.12.2.1 src/share/man/man5/statvfs.5
cvs rdiff -u -r1.26.14.3 -r1.26.14.4 src/sys/sys/fstypes.h
cvs rdiff -u -r1.15 -r1.15.14.1 src/sys/sys/statvfs.h
cvs rdiff -u -r1.257.2.10 -r1.257.2.11 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/sbin/mount/mount.8
diff -u src/sbin/mount/mount.8:1.69.2.2 src/sbin/mount/mount.8:1.69.2.3
--- src/sbin/mount/mount.8:1.69.2.2 Fri May 28 09:14:55 2010
+++ src/sbin/mount/mount.8 Thu Oct 21 08:45:04 2010
@@ -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
Index: src/sbin/mount_ffs/mount_ffs.c
diff -u src/sbin/mount_ffs/mount_ffs.c:1.25.10.2 src/sbin/mount_ffs/mount_ffs.c:1.25.10.3
--- src/sbin/mount_ffs/mount_ffs.c:1.25.10.2 Fri May 28 09:14:55 2010
+++ src/sbin/mount_ffs/mount_ffs.c Thu Oct 21 08:45:04 2010
@@ -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,
};
Index: src/share/man/man5/statvfs.5
diff -u src/share/man/man5/statvfs.5:1.12 src/share/man/man5/statvfs.5:1.12.2.1
--- src/share/man/man5/statvfs.5:1.12 Mon Mar 22 18:58:32 2010
+++ src/share/man/man5/statvfs.5 Thu Oct 21 08:45:04 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: statvfs.5,v 1.12 2010/03/22 18:58:32 joerg Exp $
+.\" $NetBSD: statvfs.5,v 1.12.2.1 2010/10/21 08:45:04 uebayasi Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)statfs.2 8.5 (Berkeley) 5/24/95
.\"
-.Dd April 10, 2009
+.Dd October 20, 2010
.Dt STATVFS 5
.Os
.Sh NAME
@@ -109,14 +109,16 @@
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_LOG
-Use logging (journalling).
.It Dv ST_LOCAL
The filesystem resides locally.
.It Dv ST_QUOTA
Index: src/sys/sys/fstypes.h
diff -u src/sys/sys/fstypes.h:1.26.14.3 src/sys/sys/fstypes.h:1.26.14.4
--- src/sys/sys/fstypes.h:1.26.14.3 Fri May 28 09:14:55 2010
+++ src/sys/sys/fstypes.h Thu Oct 21 08:45:03 2010
@@ -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 */
#define IMNT_HAS_TRANS 0x00000080 /* supports transactions */
#define IMNT_MPSAFE 0x00000100 /* file system code MP safe */
-#define IMNT_XIP 0x00000200 /* eXecute In Place */
#define __MNT_FLAGS \
__MNT_BASIC_FLAGS \
@@ -227,7 +228,7 @@
"\34MNT_EXNORESPORT" \
"\33MNT_NOATIME" \
"\32MNT_LOG" \
- "\31MNT_UNUSED" \
+ "\31MNT_XIP" \
"\30MNT_UNUSED" \
"\27MNT_GETARGS" \
"\26MNT_UNUSED" \
@@ -255,7 +256,6 @@
#define __IMNT_FLAG_BITS \
"\20" \
- "\30IMNT_XIP" \
"\20IMNT_MPSAFE" \
"\10IMNT_HAS_TRANS" \
"\07IMNT_DTYPE" \
Index: src/sys/sys/statvfs.h
diff -u src/sys/sys/statvfs.h:1.15 src/sys/sys/statvfs.h:1.15.14.1
--- src/sys/sys/statvfs.h:1.15 Thu Jul 31 05:38:06 2008
+++ src/sys/sys/statvfs.h Thu Oct 21 08:45:03 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: statvfs.h,v 1.15 2008/07/31 05:38:06 simonb Exp $ */
+/* $NetBSD: statvfs.h,v 1.15.14.1 2010/10/21 08:45:03 uebayasi Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -114,11 +114,12 @@
#define ST_ASYNC MNT_ASYNC
#define ST_NOCOREDUMP MNT_NOCOREDUMP
#define ST_IGNORE MNT_IGNORE
+#define ST_XIP MNT_XIP
+#define ST_LOG MNT_LOG
#define ST_NOATIME MNT_NOATIME
#define ST_SYMPERM MNT_SYMPERM
#define ST_NODEVMTIME MNT_NODEVMTIME
#define ST_SOFTDEP MNT_SOFTDEP
-#define ST_LOG MNT_LOG
#define ST_EXRDONLY MNT_EXRDONLY
#define ST_EXPORTED MNT_EXPORTED
Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.10 src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.11
--- src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.10 Thu Oct 7 08:54:16 2010
+++ src/sys/ufs/ffs/ffs_vfsops.c Thu Oct 21 08:45:04 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_vfsops.c,v 1.257.2.10 2010/10/07 08:54:16 uebayasi Exp $ */
+/* $NetBSD: ffs_vfsops.c,v 1.257.2.11 2010/10/21 08:45:04 uebayasi 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.257.2.10 2010/10/07 08:54:16 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.257.2.11 2010/10/21 08:45:04 uebayasi Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -1188,16 +1188,14 @@
void *physseg = NULL;
- if ((mp->mnt_flag & MNT_RDONLY) == 0 ||
- (VOP_IOCTL(devvp, DIOCGPHYSSEG, &physseg, FREAD, cred) != 0) ||
- physseg == NULL ||
- !FS_IS_PAGE_ALIGNED_P(fs)) {
- error = ENXIO;
- free(fs->fs_csp, M_UFSMNT);
- goto out;
+ if ((mp->mnt_flag & MNT_XIP) != 0 &&
+ (mp->mnt_flag & MNT_RDONLY) != 0 &&
+ VOP_IOCTL(devvp, DIOCGPHYSSEG, &physseg, FREAD, cred) == 0 &&
+ physseg != NULL &&
+ FS_IS_PAGE_ALIGNED_P(fs)) {
+ mp->mnt_flag |= MNT_XIP;
+ devvp->v_physseg = physseg;
}
- mp->mnt_iflag |= IMNT_XIP;
- devvp->v_physseg = physseg;
#endif
#ifdef FFS_EI
if (needswap)
@@ -1840,7 +1838,7 @@
ufs_vinit(mp, ffs_specop_p, ffs_fifoop_p, &vp);
#ifdef XIP
- if ((vp->v_mount->mnt_iflag & IMNT_XIP) != 0 &&
+ if ((vp->v_mount->mnt_flag & MNT_XIP) != 0 &&
vp->v_type == VREG) {
vp->v_vflag |= VV_XIP;
}