* Linus Torvalds <[EMAIL PROTECTED]> wrote:

> Well, we could make it the default for the kernel (possibly under a 
> "fast-atime" config option), and then people can add "atime" or 
> "noatime" as they wish, since mount has supported _those_ options for 
> a long time.

the patch below implements this, but there's a problem: we only have 
MNT_NOATIME, we have no MNT_ATIME option AFAICS. So there's no good way 
to detect it when a user _does_ want to have atime :-( Perhaps a boot 
option to turn this off? [sucks a bit but keeps the solution within the 
kernel.]

        Ingo

--------------------------------->
Subject: [patch] add CONFIG_FASTATIME
From: Ingo Molnar <[EMAIL PROTECTED]>

add the CONFIG_FASTATIME kernel option, which makes "relatime" the
default for all mounts.

Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 fs/Kconfig     |   10 ++++++++++
 fs/namespace.c |    4 ++++
 2 files changed, 14 insertions(+)

Index: linux/fs/Kconfig
===================================================================
--- linux.orig/fs/Kconfig
+++ linux/fs/Kconfig
@@ -2060,6 +2060,16 @@ config 9P_FS
 
 endmenu
 
+config FASTATIME
+       bool "Fast atime support by default"
+       default y
+       help
+         If you say Y here, all your filesystems that do not have
+         the "noatime" or "atime" mount option specified will get
+         the "relatime" option by default, which speeds up atime
+         updates. (atime will only be updated if ctime or mtime
+         is more recent than atime)
+
 if BLOCK
 menu "Partition Types"
 
Index: linux/fs/namespace.c
===================================================================
--- linux.orig/fs/namespace.c
+++ linux/fs/namespace.c
@@ -1409,6 +1409,10 @@ long do_mount(char *dev_name, char *dir_
                mnt_flags |= MNT_NODIRATIME;
        if (flags & MS_RELATIME)
                mnt_flags |= MNT_RELATIME;
+#ifdef CONFIG_FASTATIME
+       if (!(flags & (MNT_NOATIME | MNT_NODIRATIME)))
+               mnt_flags |= MNT_RELATIME;
+#endif
 
        flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE |
                   MS_NOATIME | MS_NODIRATIME | MS_RELATIME);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to