summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Lebleu <pme.lebleu@gmail.com>2018-05-23 10:55:58 +0200
committerJohn Crispin <john@phrozen.org>2018-05-24 09:40:44 +0200
commitdd02dad332958575cc52e60c78ef10ef2b5aaced (patch)
tree00447660af71853581639b713bb0573b66aa5d6c
parent242248cb109d2ffac5962165b7d8f04abfd0e149 (diff)
downloadfstools-dd02dad332958575cc52e60c78ef10ef2b5aaced.tar.gz
fstools: allow the mounting with full access time accounting
In order to allow the mounting of the filesystem with full access time accounting, a new CMake option (eg: CMAKE_OVL_MOUNT_FULL_ACCESS_TIME) has been added. Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
-rw-r--r--CMakeLists.txt4
-rw-r--r--libfstools/overlay.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4844c03..f86a4d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,6 +56,10 @@ IF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
ADD_DEFINITIONS(-DOVL_MOUNT_COMPRESS_ZLIB)
ENDIF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
+IF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
+ ADD_DEFINITIONS(-DOVL_MOUNT_FULL_ACCESS_TIME)
+ENDIF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
+
ADD_EXECUTABLE(mount_root mount_root.c)
TARGET_LINK_LIBRARIES(mount_root fstools)
INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin)
diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index 068afdc..14214a3 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -341,7 +341,12 @@ static int overlay_mount_fs(struct volume *v)
return -1;
}
- if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME,
+ if (mount(v->blk, "/tmp/overlay", fstype,
+#ifdef OVL_MOUNT_FULL_ACCESS_TIME
+ MS_RELATIME,
+#else
+ MS_NOATIME,
+#endif
#ifdef OVL_MOUNT_COMPRESS_ZLIB
"compr=zlib"
#else