diff --git a/fs/F2fs.cpp b/fs/F2fs.cpp index 0d12b07..56369d5 100644 --- a/fs/F2fs.cpp +++ b/fs/F2fs.cpp @@ -18,7 +18,9 @@ #include "Utils.h" #include +#include #include +#include #include #include @@ -72,8 +74,19 @@ status_t Mount(const std::string& source, const std::string& target) { status_t Format(const std::string& source) { std::vector cmd; cmd.push_back(kMkfsPath); - cmd.push_back(source); + cmd.push_back("-f"); + cmd.push_back("-d1"); + + if (android::base::GetBoolProperty("vold.has_quota", false)) { + cmd.push_back("-O"); + cmd.push_back("quota"); + } + if (e4crypt_is_native()) { + cmd.push_back("-O"); + cmd.push_back("encrypt"); + } + cmd.push_back(source); return ForkExecvp(cmd); }