[OpenWrt-Devel] [PATCH v2 2/2] fstools: allow the mounting with full access time accounting

Pierre Lebleu pme.lebleu at gmail.com
Tue May 22 13:04:47 EDT 2018


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 at gmail.com>
---
v2: change the option name
 CMakeLists.txt       | 6 ++++++
 libfstools/overlay.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b98ba6..dead65f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,12 @@ ELSE(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
 	ADD_DEFINITIONS(-DOVL_MOUNT_OPTION=NULL)
 ENDIF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
 
+IF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
+	ADD_DEFINITIONS(-DOVL_MOUNT_FLAGS=MS_RELATIME)
+ELSE(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
+	ADD_DEFINITIONS(-DOVL_MOUNT_FLAGS=MS_NOATIME)
+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 5d5a985..b201679 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -341,7 +341,7 @@ static int overlay_mount_fs(struct volume *v)
 		return -1;
 	}
 
-	if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, OVL_MOUNT_OPTION)) {
+	if (mount(v->blk, "/tmp/overlay", fstype, OVL_MOUNT_FLAGS, OVL_MOUNT_OPTION)) {
 		ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %m\n",
 		         fstype, v->blk);
 		return -1;
-- 
1.9.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list