OSDN Git Service

Add noatime to vfat and exfat
authorRavisankar Reddy <ravisankar.reddy@sony.com>
Mon, 3 Jul 2017 02:25:33 +0000 (11:25 +0900)
committerSzuWei Lin <szuweilin@google.com>
Mon, 31 Jul 2017 10:12:30 +0000 (18:12 +0800)
testNoAtime is new cts testcase, which verifies all writable
block filesystems are mounted "noatime" toavoid unnecessary
flash churn. So add noatime for vfat.

Bug: 64137815
Test: run cts -m m CtsOsTestCases -t android.os.cts.EnvironmentTest#testNoAtime
Change-Id: I4f42b54ed0d66e09964351da26d0d3bf38d573d6

fs/Vfat.cpp

index 1803c4b..dc1fe33 100644 (file)
@@ -133,7 +133,7 @@ status_t Mount(const std::string& source, const std::string& target, bool ro,
     const char* c_source = source.c_str();
     const char* c_target = target.c_str();
 
-    flags = MS_NODEV | MS_NOSUID | MS_DIRSYNC;
+    flags = MS_NODEV | MS_NOSUID | MS_DIRSYNC | MS_NOATIME;
 
     flags |= (executable ? 0 : MS_NOEXEC);
     flags |= (ro ? MS_RDONLY : 0);