[Ocfs2-tools-devel] [PATCH 1/1] ocfs2-tools: add strictatime support
Tiger Yang
tiger.yang at oracle.com
Fri Mar 19 03:34:36 PDT 2010
This patch adds support for a new mount option stricatime.
In ocfs2, there are three types of mount options about atime now.
noatime - never update access time.
relatime - only updates the atime if the previous atime
is older than the mtime or ctime. This is the default option.
strictatime, atime_quantum=nrsec - only update atime unless
specified number of seconds has passed since the last update.
Signed-off-by: Tiger Yang <tiger.yang at oracle.com>
---
mount.ocfs2/mount.ocfs2.8.in | 15 ++++++++++-----
mount.ocfs2/mount_constants.h | 3 +++
mount.ocfs2/opts.c | 3 +++
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/mount.ocfs2/mount.ocfs2.8.in b/mount.ocfs2/mount.ocfs2.8.in
index ffc5e5a..d69cc9c 100644
--- a/mount.ocfs2/mount.ocfs2.8.in
+++ b/mount.ocfs2/mount.ocfs2.8.in
@@ -20,17 +20,22 @@ specify this mount option to delay the system from mounting the volume until
after the network has been enabled.
.TP
-\fBatime\_quantum=nrsec\fR
-The file system will not update atime unless this number of seconds has passed
-since the last update. Set to zero to always update atime. It defaults to 60 secs.
+\fBnoatime\fR
+The file system will not update access time.
.TP
\fBrelatime\fR
The file system only update atime if the previous atime is older than mtime or ctime.
.TP
-\fBnoatime\fR
-The file system will not update access time.
+\fBstrictatime\fR
+The file system will always perform atime updates.
+
+.TP
+\fBatime\_quantum=nrsec\fR
+The file system will not update atime unless this number of seconds has passed
+since the last update. Set to zero to always update atime. It defaults to 60 secs.
+This option need work together with \fBstricatime\fR.
.TP
\fBacl / noacl\fR
diff --git a/mount.ocfs2/mount_constants.h b/mount.ocfs2/mount_constants.h
index ed475db..feffe8f 100644
--- a/mount.ocfs2/mount_constants.h
+++ b/mount.ocfs2/mount_constants.h
@@ -60,6 +60,9 @@ if we have a stack or plain mount - mount atop of it, forming a stack. */
#ifndef MS_RELATIME
#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
#endif
+#ifndef MS_STRICTATIME
+#define MS_STRICTATIME (1<<24) /* Strict atime semantics */
+#endif
/*
* Magic mount flag number. Had to be or-ed to the flag values.
*/
diff --git a/mount.ocfs2/opts.c b/mount.ocfs2/opts.c
index 5ecd36b..5077c54 100644
--- a/mount.ocfs2/opts.c
+++ b/mount.ocfs2/opts.c
@@ -82,8 +82,11 @@ static const struct opt_map opt_map[] = {
{ "noatime", 0, 0, MS_NOATIME }, /* Do not update access time */
{ "relatime", 0, 0, MS_RELATIME }, /* only update atime if previous */
/* atime is older than mtime/ctime */
+ { "norelatime", 0, 1, MS_NORELATIME },/* update atime without regard mtime/ctime */
{ "diratime", 0, 1, MS_NODIRATIME }, /* Update dir access times */
{ "nodiratime", 0, 0, MS_NODIRATIME },/* Do not update dir access times */
+ { "strictatime", 0, 0, MS_STRICTATIME },/* Strict atime semantics */
+ { "nostrictatime", 0, 1, MS_STRICTATIME },/* Disable strictatime */
{ "kudzu", 0, 0, MS_COMMENT }, /* Silently remove this option (backwards compat use only) */
{ "managed", 0, 0, MS_COMMENT }, /* Silently remove this option */
{ NULL, 0, 0, 0 }
--
1.5.4.3
More information about the Ocfs2-tools-devel
mailing list