LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Valerie Henson <val_henson@linux.intel.com>
To: Andrew Morton <akpm@osdl.org>
Cc: mark.fasheh@oracle.com, steve@chygwyn.com,
	linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	linux-fsdevel@vger.kernel.org, viro@ftp.linux.org.uk,
	Karel Zak <kzak@redhat.com>
Subject: Re: Relative atime (was Re: What's in ocfs2.git)
Date: Fri, 8 Dec 2006 19:15:14 -0800	[thread overview]
Message-ID: <20061209031513.GB8515@goober> (raw)
In-Reply-To: <20061205205802.92b91ce1.akpm@osdl.org>

On Tue, Dec 05, 2006 at 08:58:02PM -0800, Andrew Morton wrote:
> That's the easy part.   How are we going to get mount(8) patched?

Karel, interested in taking a look at the following patch?  The kernel
bits are in -mm currently.

-VAL

Add the "relatime" (relative atime) option support to mount.  Relative
atime only updates the atime if the previous atime is older than the
mtime or ctime.  Like noatime, but useful for applications like mutt
that need to know when a file has been read since it was last
modified.

Cc: Adrian Bunk <bunk@stusta.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Karel Zak <kzak@redhat.com>

Signed-off-by: Valerie Henson <val_henson@linux.intel.com>

---
 mount/mount.8           |    7 +++++++
 mount/mount.c           |    6 ++++++
 mount/mount_constants.h |    4 ++++
 3 files changed, 17 insertions(+)

--- util-linux-2.13-pre7.orig/mount/mount.8
+++ util-linux-2.13-pre7/mount/mount.8
@@ -586,6 +586,13 @@ access on the news spool to speed up new
 .B nodiratime
 Do not update directory inode access times on this filesystem.
 .TP
+.B relatime
+Update inode access times relative to modify or change time.  Access
+time is only updated if the previous access time was earlier than the
+current modify or change time. (Similar to noatime, but doesn't break
+mutt or other applications that need to know if a file has been read
+since the last time it was modified.)
+.TP
 .B noauto
 Can only be mounted explicitly (i.e., the
 .B \-a
--- util-linux-2.13-pre7.orig/mount/mount.c
+++ util-linux-2.13-pre7/mount/mount.c
@@ -164,6 +164,12 @@ static const struct opt_map opt_map[] = 
   { "diratime",	0, 1, MS_NODIRATIME },	/* Update dir access times */
   { "nodiratime", 0, 0, MS_NODIRATIME },/* Do not update dir access times */
 #endif
+#ifdef MS_RELATIME
+  { "relatime", 0, 0, MS_RELATIME },	/* Update access times relative to
+					   mtime/ctime */
+  { "norelatime", 0, 1, MS_RELATIME },	/* Update access time without regard
+					   to mtime/ctime */
+#endif
   { NULL,	0, 0, 0		}
 };
 
--- util-linux-2.13-pre7.orig/mount/mount_constants.h
+++ util-linux-2.13-pre7/mount/mount_constants.h
@@ -57,6 +57,10 @@ if we have a stack or plain mount - moun
 #ifndef MS_VERBOSE
 #define MS_VERBOSE	0x8000	/* 32768 */
 #endif
+#ifndef MS_RELATIME
+#define MS_RELATIME   0x200000	/* 200000: Update access times relative
+				   to mtime/ctime */
+#endif
 /*
  * Magic mount flag number. Had to be or-ed to the flag values.
  */

  parent reply	other threads:[~2006-12-09  3:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-03 20:31 What's in ocfs2.git Mark Fasheh
2006-12-04 10:54 ` Steven Whitehouse
2006-12-05  0:10   ` Mark Fasheh
2006-12-05  0:36     ` Relative atime (was Re: What's in ocfs2.git) Valerie Henson
2006-12-05  0:56       ` Valerie Henson
2006-12-05 22:20       ` Mark Fasheh
2006-12-06  6:11         ` Andrew Morton
2006-12-06  4:58       ` Andrew Morton
2006-12-06  8:58         ` Valerie Henson
2006-12-06  9:42         ` Eric Dumazet
2006-12-06 12:48           ` Arjan van de Ven
2006-12-09  3:15         ` Valerie Henson [this message]
2006-12-12  9:30           ` Karel Zak

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=20061209031513.GB8515@goober \
    --to=val_henson@linux.intel.com \
    --cc=akpm@osdl.org \
    --cc=kzak@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.fasheh@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=steve@chygwyn.com \
    --cc=viro@ftp.linux.org.uk \
    --subject='Re: Relative atime (was Re: What'\''s in ocfs2.git)' \
    /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

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).