summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-06-26 14:09:00 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2012-06-26 14:09:00 (GMT)
commit9ad8979ff15e1b894ee1f4bb6a2535a1a2c20d65 (patch)
tree3fccc38fb33635f61d456eb4dc0232a9863dc0d2
parentea664dde87d8e52df7d4003d988352a66562a945 (diff)
downloadbusybox-9ad8979ff15e1b894ee1f4bb6a2535a1a2c20d65.tar.gz
busybox-9ad8979ff15e1b894ee1f4bb6a2535a1a2c20d65.tar.bz2
mount: support strictatime option. Closes 5240
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--util-linux/mount.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index b6c94d7..525fdcc 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -113,6 +113,12 @@
#ifndef MS_RELATIME
# define MS_RELATIME (1 << 21)
#endif
+#ifndef MS_STRICTATIME
+# define MS_STRICTATIME (1 << 24)
+#endif
+
+/* Any ~MS_FOO value has this bit set: */
+#define BB_MS_INVERTED_VALUE (1u << 31)
#include "libbb.h"
#if ENABLE_FEATURE_MOUNT_LABEL
@@ -240,6 +246,7 @@ static const int32_t mount_options[] = {
/* "nomand" */ ~MS_MANDLOCK,
/* "relatime" */ MS_RELATIME,
/* "norelatime" */ ~MS_RELATIME,
+ /* "strictatime" */ MS_STRICTATIME,
/* "loud" */ ~MS_SILENT,
/* "rbind" */ MS_BIND|MS_RECURSIVE,
@@ -297,6 +304,7 @@ static const char mount_option_str[] =
"nomand\0"
"relatime\0"
"norelatime\0"
+ "strictatime\0"
"loud\0"
"rbind\0"
@@ -473,7 +481,7 @@ static unsigned long parse_mount_options(char *options, char **unrecognized)
&& (options[opt_len] == '\0' || options[opt_len] == '=')
) {
unsigned long fl = mount_options[i];
- if ((long)fl < 0)
+ if (fl & BB_MS_INVERTED_VALUE)
flags &= fl;
else
flags |= fl;