From fb2bf902fd09c8207a743964231b2c19580ac7de Mon Sep 17 00:00:00 2001 From: Daniel Rosenberg Date: Wed, 8 Nov 2023 16:51:55 -0800 Subject: [PATCH] Add support for 16k F2FS Currently F2FS block size must match page size, so this just does that. If we support page size != block size for F2FS, this should be revisited. Bug: 279820706 Test: Boot 16K device Change-Id: I6b3b367cdf76ccf5b2c5d309499027a5e7383a44 Signed-off-by: Daniel Rosenberg --- fs/F2fs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/F2fs.cpp b/fs/F2fs.cpp index 23363e3..07f8480 100644 --- a/fs/F2fs.cpp +++ b/fs/F2fs.cpp @@ -101,7 +101,13 @@ status_t Format(const std::string& source, const std::string& zoned_device) { cmd.emplace_back(zoned_device.c_str()); cmd.emplace_back("-m"); } + + std::string block_size = std::to_string(getpagesize()); + cmd.emplace_back("-b"); + cmd.emplace_back(block_size.c_str()); + cmd.emplace_back(source.c_str()); + return logwrap_fork_execvp(cmd.size(), cmd.data(), nullptr, false, LOG_KLOG, false, nullptr); }