From: Tiger Yang <tiger.yang@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/1] ocfs2-tools: support strictatime in ocfs2
Date: Wed, 2 Mar 2011 19:30:37 +0800 [thread overview]
Message-ID: <1299065437-6594-1-git-send-email-tiger.yang@oracle.com> (raw)
In-Reply-To: <4D6E2994.1050302@oracle.com>
Strictatime was introduced into vfs, so this patch adding support
to it in ocfs2. Now we have three types behavior about update atime,
noatime, relatime and strictatime. With strictatime, the minimum
update interval is specified by atime_quantum, which defaults to 60 secs.
Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
---
mount.ocfs2/mount.ocfs2.8.in | 11 ++++++-----
mount.ocfs2/mount_constants.h | 3 +++
mount.ocfs2/opts.c | 2 +-
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/mount.ocfs2/mount.ocfs2.8.in b/mount.ocfs2/mount.ocfs2.8.in
index b367bf1..3bd1d09 100644
--- a/mount.ocfs2/mount.ocfs2.8.in
+++ b/mount.ocfs2/mount.ocfs2.8.in
@@ -20,17 +20,18 @@ 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,atime\_quantum=nrsec\fR
+The file system will always perform atime updates, but the minimum update
+interval is specified by atime_quantum. Atime_quantum defaults to 60 secs,
+set it to zero to always update atime. These two options need work together.
.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..96037da 100644
--- a/mount.ocfs2/opts.c
+++ b/mount.ocfs2/opts.c
@@ -78,12 +78,12 @@ static const struct opt_map opt_map[] = {
{ "mand", 0, 0, MS_MANDLOCK }, /* Allow mandatory locks on this FS */
{ "nomand", 0, 1, MS_MANDLOCK }, /* Forbid mandatory locks on this FS */
{ "loop", 1, 0, MS_LOOP }, /* use a loop device */
- { "atime", 0, 1, MS_NOATIME }, /* Update access time */
{ "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 */
{ "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 */
{ "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.7.2.1
next prev parent reply other threads:[~2011-03-02 11:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 11:27 [Ocfs2-devel] [PATCH 0/2] support strictatime in ocfs2 Tiger Yang
2011-03-02 11:30 ` Tiger Yang [this message]
2011-03-26 21:42 ` [Ocfs2-devel] [PATCH 1/1] ocfs2-tools: " Joel Becker
2011-03-28 8:37 ` Tiger Yang
2011-03-02 11:32 ` [Ocfs2-devel] [PATCH 1/1] ocfs2: clean up mount option about atime in ocfs2.txt Tiger Yang
2011-03-26 21:44 ` Joel Becker
2011-03-28 8:50 ` Tiger Yang
2011-05-24 6:56 ` Joel Becker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1299065437-6594-1-git-send-email-tiger.yang@oracle.com \
--to=tiger.yang@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).