util-linux: Add new mount options flushonfsync and noflushonfsyncto mount

From: Fernando Luis Vázquez Cao
Date: Thu Feb 12 2009 - 05:37:34 EST


This mount flag will be used to determine whether the block device's write
cache should be flush or not on fsync()/fdatasync().

Signed-off-by: Fernando Luis Vazquez Cao <fernando@xxxxxxxxxxxxx>
---

diff -urp mount-orig/mount.c mount/mount.c
--- mount-orig/mount.c 2009-01-29 15:50:50.000000000 +0900
+++ mount/mount.c 2009-01-29 14:56:19.000000000 +0900
@@ -185,6 +185,13 @@ static const struct opt_map opt_map[] =
{ "norelatime", 0, 1, MS_RELATIME }, /* Update access time without regard
to mtime/ctime */
#endif
+#ifdef MS_FLUSHONFSYNC
+ { "flushonfsync", 0, 0, MS_FLUSHONFSYNC }, /* Force block device flush on
+ fsync()/fdatasync() */
+ { "noflushonfsync", 0, 1, MS_FLUSHONFSYNC }, /* Do not force block device
+ flush on
+ fsync()/fdatasync() */
+#endif
{ "nofail", 0, 0, MS_COMMENT}, /* Do not fail if ENOENT on dev */
{ NULL, 0, 0, 0 }
};
diff -urp mount-orig/mount_constants.h mount/mount_constants.h
--- mount-orig/mount_constants.h 2008-04-22 17:59:53.000000000 +0900
+++ mount/mount_constants.h 2009-01-29 13:40:42.000000000 +0900
@@ -56,6 +56,10 @@
#ifndef MS_SHARED
#define MS_SHARED (1<<20) /* 1048576 Shared*/
#endif
+#ifndef MS_FLUSHONFSYNC
+#define MS_FLUSHONFSYNC (1<<24) /* Force block device flush on
+ fsync()/fdatasync() */
+#endif
/*
* Magic mount flag number. Had to be or-ed to the flag values.
*/


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/