blob: 4f184650870d5bdb172f491f8465a812e5545cfb [file] [log] [blame]
From 28cf7fcb735698ef8d96d73ef35e1a19c050add6 Mon Sep 17 00:00:00 2001
From: Dongjin Kim <dongjin_.kim@samsung.com>
Date: Sat, 24 Jul 2021 01:38:18 +0900
Subject: [PATCH 4/5] [f2fs] Configure deivce size as minimum size for f2fs
Change-Id: I0e15a43953c03ff4dc94e75898942c0c62d8fe4d
---
src/storage/fs_test/directory_large.cc | 6 ++++++
src/storage/fs_test/rw.cc | 4 ++++
src/storage/fs_test/truncate_large.cc | 7 ++++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/storage/fs_test/directory_large.cc b/src/storage/fs_test/directory_large.cc
index 9d0d1710356..e9b85e424ac 100644
--- a/src/storage/fs_test/directory_large.cc
+++ b/src/storage/fs_test/directory_large.cc
@@ -59,6 +59,12 @@ INSTANTIATE_TEST_SUITE_P(
// memory is the limiting factor).
if (options.filesystem->GetTraits().in_memory)
return std::nullopt;
+
+ if (options.filesystem->GetTraits().name == "f2fs") {
+ options.device_block_count = 204800;
+ return options;
+ }
+
if (!options.filesystem->GetTraits().has_directory_size_limit) {
// Fatfs is slow and, other than the root directory on FAT12/16, is limited by the size
// of the ram-disk rather than a directory size limit, so use a small ram-disk to keep
diff --git a/src/storage/fs_test/rw.cc b/src/storage/fs_test/rw.cc
index be5727fc470..19a703f862e 100644
--- a/src/storage/fs_test/rw.cc
+++ b/src/storage/fs_test/rw.cc
@@ -209,6 +209,10 @@ INSTANTIATE_TEST_SUITE_P(
return std::nullopt;
}
// Run on a smaller ram-disk to keep run-time reasonable.
+ if (options.filesystem->GetTraits().name == "f2fs") {
+ options.device_block_count = 204800;
+ return options;
+ }
options.device_block_count = 8192;
options.fvm_slice_size = 32768;
return options;
diff --git a/src/storage/fs_test/truncate_large.cc b/src/storage/fs_test/truncate_large.cc
index 9f6f785d0f9..4e373193632 100644
--- a/src/storage/fs_test/truncate_large.cc
+++ b/src/storage/fs_test/truncate_large.cc
@@ -24,7 +24,12 @@ std::vector<LargeTruncateTestParamType> GetTestCombinations(
// Skip larger buffer sizes on slow filesystems.
continue;
}
- options.device_block_count = 3 * (1LLU << 16);
+
+ if (options.filesystem->GetTraits().name == "f2fs") {
+ options.device_block_count = 204800;
+ } else {
+ options.device_block_count = 3 * (1LLU << 16);
+ }
options.device_block_size = 1LLU << 9;
options.fvm_slice_size = 1LLU << 23;
test_combinations.push_back(std::make_tuple(options, variation));
--
2.25.1