From ed64b8d0fc945ce49041f313c453b6b21d68b832 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Fri, 27 Mar 2009 00:47:22 +0000 Subject: [PATCH] mount: Add strictatime support 2.6.30 adds (patch d0adde574b8487ef30f69e2d08bba769e4be513f) support for a strictatime mount parameter, used to request strict atime update semantics. The following patch adds support for it to mount. Signed-off-by: Matthew Garrett --- mount/mount.8 | 7 +++++++ mount/mount.c | 4 ++++ mount/mount_constants.h | 3 +++ 3 files changed, 14 insertions(+) diff --git a/mount/mount.8 b/mount/mount.8 index e3eb8104..8da67689 100644 --- a/mount/mount.8 +++ b/mount/mount.8 @@ -807,6 +807,13 @@ Do not use feature (e.g, for systems where the feature is enabled by default, for more details see mount options in /proc/mounts). .TP +.B strictatime +Update inode access times whenever a file is accessed. Disables noatime and +.B relatime. +.TP +.B nostrictatime +Use the kernel's default behaviour for inode access time updates. +.TP .B suid Allow set-user-identifier or set-group-identifier bits to take effect. diff --git a/mount/mount.c b/mount/mount.c index 94fa94fb..f48f9d40 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -187,6 +187,10 @@ static const struct opt_map opt_map[] = { mtime/ctime */ { "norelatime", 0, 1, MS_RELATIME }, /* Update access time without regard to mtime/ctime */ +#endif +#ifdef MS_STRICTATIME + { "strictatime", 0, 0, MS_STRICTATIME }, /* Strict atime semantics */ + { "nostrictatime", 0, 1, MS_STRICTATIME }, /* kernel default atime */ #endif { "nofail", 0, 0, MS_COMMENT}, /* Do not fail if ENOENT on dev */ { NULL, 0, 0, 0 } diff --git a/mount/mount_constants.h b/mount/mount_constants.h index 41311c05..81686f1d 100644 --- a/mount/mount_constants.h +++ b/mount/mount_constants.h @@ -59,6 +59,9 @@ #ifndef MS_I_VERSION #define MS_I_VERSION (1<<23) /* update inode I_version field */ #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. */ -- 2.39.5