summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@cyanogenmod.org>2016-01-20 22:06:11 +0200
committerRashed Abdel-Tawab <rashed@linux.com>2017-12-05 17:25:44 -0800
commitb8a53705ee43306e689d620fbfb8775fec784f3d (patch)
tree86f5078db948e1a0c8b20b83b38a81b82f1c2b05
parentaf654a8a05f5bd2b453834511a15b4d9c5a528c3 (diff)
downloadandroid_system_vold-b8a53705ee43306e689d620fbfb8775fec784f3d.tar.gz
android_system_vold-b8a53705ee43306e689d620fbfb8775fec784f3d.tar.bz2
android_system_vold-b8a53705ee43306e689d620fbfb8775fec784f3d.zip
vold: Honor mount options for f2fs partitions
* Based on 1436fc7ea3b349283a021e75fdd4f3478a2ca2e8 Change-Id: Id9491ada3bd34275a95ef9855167db6ae7a9b30f
-rw-r--r--PrivateVolume.cpp2
-rw-r--r--PublicVolume.cpp2
-rw-r--r--fs/F2fs.cpp5
-rw-r--r--fs/F2fs.h2
4 files changed, 6 insertions, 5 deletions
diff --git a/PrivateVolume.cpp b/PrivateVolume.cpp
index e628a91..72dcf41 100644
--- a/PrivateVolume.cpp
+++ b/PrivateVolume.cpp
@@ -128,7 +128,7 @@ status_t PrivateVolume::doMount() {
return -EIO;
}
- if (f2fs::Mount(mDmDevPath, mPath)) {
+ if (f2fs::Mount(mDmDevPath, mPath, "")) {
PLOG(ERROR) << getId() << " failed to mount";
return -EIO;
}
diff --git a/PublicVolume.cpp b/PublicVolume.cpp
index 4ac166f..ddee430 100644
--- a/PublicVolume.cpp
+++ b/PublicVolume.cpp
@@ -155,7 +155,7 @@ status_t PublicVolume::doMount() {
} else if (mFsType == "ext4") {
ret = ext4::Mount(mDevPath, mRawPath, false, false, true, mMntOpts);
} else if (mFsType == "f2fs") {
- ret = f2fs::Mount(mDevPath, mRawPath);
+ ret = f2fs::Mount(mDevPath, mRawPath, mMntOpts);
} else if (mFsType == "ntfs") {
ret = ntfs::Mount(mDevPath, mRawPath, false, false, false,
AID_MEDIA_RW, AID_MEDIA_RW, 0007, true);
diff --git a/fs/F2fs.cpp b/fs/F2fs.cpp
index 4faa34a..b7eb1bb 100644
--- a/fs/F2fs.cpp
+++ b/fs/F2fs.cpp
@@ -49,12 +49,13 @@ status_t Check(const std::string& source, bool trusted) {
return ForkExecvp(cmd, trusted ? sFsckContext : sFsckUntrustedContext);
}
-status_t Mount(const std::string& source, const std::string& target) {
+status_t Mount(const std::string& source, const std::string& target, const std::string& opts /* = "" */) {
const char* c_source = source.c_str();
const char* c_target = target.c_str();
+ const char* c_opts = opts.c_str();
unsigned long flags = MS_NOATIME | MS_NODEV | MS_NOSUID | MS_DIRSYNC;
- int res = mount(c_source, c_target, "f2fs", flags, NULL);
+ int res = mount(c_source, c_target, "f2fs", flags, c_opts);
if (res != 0) {
PLOG(ERROR) << "Failed to mount " << source;
if (errno == EROFS) {
diff --git a/fs/F2fs.h b/fs/F2fs.h
index eb34afa..227b8bb 100644
--- a/fs/F2fs.h
+++ b/fs/F2fs.h
@@ -28,7 +28,7 @@ namespace f2fs {
bool IsSupported();
status_t Check(const std::string& source, bool trusted);
-status_t Mount(const std::string& source, const std::string& target);
+status_t Mount(const std::string& source, const std::string& target, const std::string& opts = "");
status_t Format(const std::string& source);
} // namespace f2fs