summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@cyanogenmod.org>2016-01-20 22:06:11 +0200
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-01-23 12:12:25 +0200
commit06ed7f971697d10aced18ab8f2bef355a7c67f1f (patch)
treeaac4f1297fd197806f15b93343fdb873bd4a7ab9
parent30c6a385dad478a4bbee17907490df078039872e (diff)
downloadandroid_system_vold-06ed7f971697d10aced18ab8f2bef355a7c67f1f.tar.gz
android_system_vold-06ed7f971697d10aced18ab8f2bef355a7c67f1f.tar.bz2
android_system_vold-06ed7f971697d10aced18ab8f2bef355a7c67f1f.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 15fdb3d..6b8f800 100644
--- a/PrivateVolume.cpp
+++ b/PrivateVolume.cpp
@@ -127,7 +127,7 @@ status_t PrivateVolume::doMount() {
return -EIO;
}
- if (f2fs::Mount(mDmDevPath, mPath, true)) {
+ if (f2fs::Mount(mDmDevPath, mPath, "", true)) {
PLOG(ERROR) << getId() << " failed to mount";
return -EIO;
}
diff --git a/PublicVolume.cpp b/PublicVolume.cpp
index cbdc8f7..e6fda8f 100644
--- a/PublicVolume.cpp
+++ b/PublicVolume.cpp
@@ -173,7 +173,7 @@ status_t PublicVolume::doMount() {
ret = ext4::Mount(mDevPath, mRawPath, false, false, true, mMntOpts,
false);
} else if (mFsType == "f2fs") {
- ret = f2fs::Mount(mDevPath, mRawPath, false);
+ ret = f2fs::Mount(mDevPath, mRawPath, mMntOpts, false);
} 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 e5bcf4c..4ddccf9 100644
--- a/fs/F2fs.cpp
+++ b/fs/F2fs.cpp
@@ -50,9 +50,10 @@ status_t Check(const std::string& source, bool trusted) {
}
status_t Mount(const std::string& source, const std::string& target,
- bool trusted) {
+ const std::string& opts /* = "" */, bool trusted) {
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;
// Only use MS_DIRSYNC if we're not mounting adopted storage
@@ -60,7 +61,7 @@ status_t Mount(const std::string& source, const std::string& target,
flags |= 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 0950552..e035a71 100644
--- a/fs/F2fs.h
+++ b/fs/F2fs.h
@@ -29,7 +29,7 @@ bool IsSupported();
status_t Check(const std::string& source, bool trusted);
status_t Mount(const std::string& source, const std::string& target,
- bool trusted);
+ const std::string& opts = "", bool trusted = false);
status_t Format(const std::string& source);
} // namespace f2fs