Skip to content

Commit

Permalink
Fix fallocate bug in AgingScenario::run() function and refactor FileT…
Browse files Browse the repository at this point in the history
…ree class
  • Loading branch information
janjurca committed Apr 19, 2024
1 parent 4329f35 commit fe3a019
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/scenarios/aging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void AgingScenario::run() {
auto actual_file_size = fs_utils::file_size(random_file_path);
// auto new_file_size = get_file_size(0, actual_file_size, false);
std::uintmax_t blocksize = get_block_size().convert<DataUnit::B>().get_value();
auto new_file_size = get_file_size(std::max(actual_file_size / 2, 10 * blocksize), actual_file_size);
auto new_file_size = get_file_size(std::max(actual_file_size / 2, 10 * blocksize), actual_file_size, false);
spdlog::debug("ALTER_SMALLER_TRUNCATE {} from {} kB to {} kB ({})", random_file_path, actual_file_size / 1024, new_file_size.get_value() / 1024, new_file_size.get_value());
random_file->truncate(new_file_size.get_value());
MeasuredCBAction action([&]() { truncate(random_file_path.c_str(), new_file_size.convert<DataUnit::B>().get_value()); });
Expand Down

0 comments on commit fe3a019

Please sign in to comment.