diff options
author | Matthew Garrett <mjg@redhat.com> | 2009-03-26 13:49:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-26 13:56:35 -0400 |
commit | d0adde574b8487ef30f69e2d08bba769e4be513f (patch) | |
tree | fa8b98978bc9ebe607cbdf78c4ed13eeb545ba80 | |
parent | 11ff6f05f1e836a6a02369a4c4b64757e484adc1 (diff) |
Add a strictatime mount option
Add support for explicitly requesting full atime updates. This makes it
possible for kernels to default to relatime but still allow userspace to
override it.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/namespace.c | 6 | ||||
-rw-r--r-- | include/linux/fs.h | 1 | ||||
-rw-r--r-- | include/linux/mount.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 06f8e63f6cb1..d0659ec291c9 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -780,6 +780,7 @@ static void show_mnt_opts(struct seq_file *m, struct vfsmount *mnt) | |||
780 | { MNT_NOATIME, ",noatime" }, | 780 | { MNT_NOATIME, ",noatime" }, |
781 | { MNT_NODIRATIME, ",nodiratime" }, | 781 | { MNT_NODIRATIME, ",nodiratime" }, |
782 | { MNT_RELATIME, ",relatime" }, | 782 | { MNT_RELATIME, ",relatime" }, |
783 | { MNT_STRICTATIME, ",strictatime" }, | ||
783 | { 0, NULL } | 784 | { 0, NULL } |
784 | }; | 785 | }; |
785 | const struct proc_fs_info *fs_infop; | 786 | const struct proc_fs_info *fs_infop; |
@@ -1932,11 +1933,14 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, | |||
1932 | mnt_flags |= MNT_NODIRATIME; | 1933 | mnt_flags |= MNT_NODIRATIME; |
1933 | if (flags & MS_RELATIME) | 1934 | if (flags & MS_RELATIME) |
1934 | mnt_flags |= MNT_RELATIME; | 1935 | mnt_flags |= MNT_RELATIME; |
1936 | if (flags & MS_STRICTATIME) | ||
1937 | mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME); | ||
1935 | if (flags & MS_RDONLY) | 1938 | if (flags & MS_RDONLY) |
1936 | mnt_flags |= MNT_READONLY; | 1939 | mnt_flags |= MNT_READONLY; |
1937 | 1940 | ||
1938 | flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | | 1941 | flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | |
1939 | MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT); | 1942 | MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT | |
1943 | MS_STRICTATIME); | ||
1940 | 1944 | ||
1941 | /* ... and get the mountpoint */ | 1945 | /* ... and get the mountpoint */ |
1942 | retval = kern_path(dir_name, LOOKUP_FOLLOW, &path); | 1946 | retval = kern_path(dir_name, LOOKUP_FOLLOW, &path); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 92734c0012e6..5bc81c4a98c1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -141,6 +141,7 @@ struct inodes_stat_t { | |||
141 | #define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */ | 141 | #define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */ |
142 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ | 142 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ |
143 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ | 143 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ |
144 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ | ||
144 | #define MS_ACTIVE (1<<30) | 145 | #define MS_ACTIVE (1<<30) |
145 | #define MS_NOUSER (1<<31) | 146 | #define MS_NOUSER (1<<31) |
146 | 147 | ||
diff --git a/include/linux/mount.h b/include/linux/mount.h index cab2a85e2ee8..51f55f903aff 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -27,6 +27,7 @@ struct mnt_namespace; | |||
27 | #define MNT_NODIRATIME 0x10 | 27 | #define MNT_NODIRATIME 0x10 |
28 | #define MNT_RELATIME 0x20 | 28 | #define MNT_RELATIME 0x20 |
29 | #define MNT_READONLY 0x40 /* does the user want this to be r/o? */ | 29 | #define MNT_READONLY 0x40 /* does the user want this to be r/o? */ |
30 | #define MNT_STRICTATIME 0x80 | ||
30 | 31 | ||
31 | #define MNT_SHRINKABLE 0x100 | 32 | #define MNT_SHRINKABLE 0x100 |
32 | #define MNT_IMBALANCED_WRITE_COUNT 0x200 /* just for debugging */ | 33 | #define MNT_IMBALANCED_WRITE_COUNT 0x200 /* just for debugging */ |