fstools: allow the mounting with full access time accounting
authorPierre Lebleu <pme.lebleu@gmail.com>
Wed, 23 May 2018 08:55:58 +0000 (10:55 +0200)
committerJohn Crispin <john@phrozen.org>
Thu, 24 May 2018 07:40:44 +0000 (09:40 +0200)
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>
CMakeLists.txt
libfstools/overlay.c

index 4844c0381840e048582e95ba24b5daad15a53ef9..f86a4d5af4477903f3b1a595c67fb5f5ee785134 100644 (file)
@@ -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)
index 068afdc44392c433294a2c0fbe6a281f54d87e6d..14214a3104d9c6ae670437c570c46200db259ed4 100644 (file)
@@ -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