]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: add support for MS_LAZYTIME
authorKarel Zak <kzak@redhat.com>
Mon, 30 Mar 2015 10:43:45 +0000 (12:43 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Mar 2015 10:43:45 +0000 (12:43 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/libmount.h.in
libmount/src/optmap.c
sys-utils/mount.8

index 30dc06b6988bd1f2a9b0e6a0c361fb72838392a6..2338cc604ff65b22b433da0167c3c3d5be6aee92 100644 (file)
@@ -832,6 +832,10 @@ extern int mnt_context_set_syscall_status(struct libmnt_context *cxt, int status
 #ifndef MS_STRICTATIME
 #define MS_STRICTATIME (1<<24) /* Always perform atime updates */
 #endif
+#ifndef MS_LAZYTIME
+#define MS_LAZYTIME     (1<<25) /* Update the on-disk [acm]times lazily */
+#endif
+
 
 /*
  * Magic mount flag number. Had to be or-ed to the flag values.
index 5b25b8f292e50e5502f31836ca06f94beeb8fd14..3ad77273e34a887ac0ce6934adb6f59873cc8d7f 100644 (file)
@@ -113,6 +113,10 @@ static const struct libmnt_optmap linux_flags_map[] =
    { "strictatime", MS_STRICTATIME },         /* Strict atime semantics */
    { "nostrictatime", MS_STRICTATIME, MNT_INVERT }, /* kernel default atime */
 #endif
+#ifdef MS_LAZYTIME
+   { "lazytime", MS_LAZYTIME },               /* Update {a,m,c}time on the in-memory inode only */
+   { "nolazytime", MS_LAZYTIME, MNT_INVERT },
+#endif
 #ifdef MS_PROPAGATION
    { "unbindable",  MS_UNBINDABLE,          MNT_NOHLPS | MNT_NOMTAB }, /* Unbindable */
    { "runbindable", MS_UNBINDABLE | MS_REC, MNT_NOHLPS | MNT_NOMTAB },
index fac4b0c9b517440d4d434c9f34e0277021c21189..aaf6b39fd601f9afd894071ea90c5dae3d574d62 100644 (file)
@@ -1043,6 +1043,33 @@ system mount options see /proc/mounts.
 .B nostrictatime
 Use the kernel's default behavior for inode access time updates.
 .TP
+.B lazytime
+Only update times (atime, mtime, ctime) on the in-memory version of the file inode.
+
+This mount option significantly reduces writes to the inode table for
+workloads that perform frequent random writes to preallocated files.
+As at Linux 3.20, this option is supported only on ext4.
+
+The on-disk timestamps are updated only when:
+.sp
+.RS
+- the inode needs to be updated for some change unrelated to file timestamps
+.sp
+- the application employs
+.BR fsync (2),
+.BR syncfs (2),
+or
+.BR sync (2)
+.sp
+- an undeleted inode is evicted from memory
+.sp
+- more than 24 hours have passed since the i-node was written to disk.
+.RE
+.sp
+.TP
+.B nolazytime
+Do not use the nolazytime feature.
+.TP
 .B suid
 Allow set-user-identifier or set-group-identifier bits to take
 effect.