Add quota / casefold options to f2fs if needed.

These were only added for ext4.

Bug: 150935323
Test: when creating a private f2fs volume, things work as expected.
Change-Id: I11ee04bfddecb6c95e223e66c9bf532c425e6fac
This commit is contained in:
Martijn Coenen 2020-03-10 09:28:39 +01:00
parent cbd458bb35
commit 2f1c983240

View file

@ -89,6 +89,19 @@ status_t Format(const std::string& source) {
cmd.push_back("-O");
cmd.push_back("verity");
const bool needs_casefold =
android::base::GetBoolProperty("ro.emulated_storage.casefold", false);
const bool needs_projid = android::base::GetBoolProperty("ro.emulated_storage.projid", false);
if (needs_projid) {
cmd.push_back("-O");
cmd.push_back("project_quota,extra_attr");
}
if (needs_casefold) {
cmd.push_back("-O");
cmd.push_back("casefold");
cmd.push_back("-C");
cmd.push_back("utf8");
}
cmd.push_back(source);
return ForkExecvp(cmd);
}