summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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