| From f748670fa7d6a1c8af5f53f33a5e4ab091b94bbe Mon Sep 17 00:00:00 2001 |
| From: Dongjin Kim <dongjin_.kim@samsung.com> |
| Date: Mon, 7 Jun 2021 15:38:25 +0900 |
| Subject: [PATCH] [f2fs] Configure deivce size as minimum size for f2fs |
| |
| Since f2fs needs device size more than 100MiB, |
| configure device_block_count in rw-tests to provide the minimum size. |
| |
| Change-Id: Ia4a949fa9c505fa7142eaa8170b7e7487c592e1e |
| --- |
| 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 c397bbdcfc2..80689686d4a 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 c5fa0256b8b..380b50f1f10 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 3d88727cf82..e07f2eb17d7 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( |
| // Fatfs is slow, so skip larger buffer sizes. |
| 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 |
| |