From f236ed895a4616da15ac4cfd26151b808e6fcba6 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 31 May 2026 12:03:38 +0300 Subject: [PATCH] Rename parameter to reflect actual semantics --- src/blockstore/blockstore_disk.cpp | 4 ++-- src/blockstore/blockstore_disk.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blockstore/blockstore_disk.cpp b/src/blockstore/blockstore_disk.cpp index a382f1ed..a33fe025 100644 --- a/src/blockstore/blockstore_disk.cpp +++ b/src/blockstore/blockstore_disk.cpp @@ -517,7 +517,7 @@ void blockstore_disk_t::close_all() // Sadly DISCARD only works through ioctl(), but it seems to always block the device queue, // so it's not a big deal that we can only run it synchronously. -int blockstore_disk_t::trim_data(std::function is_free) +int blockstore_disk_t::trim_data(std::function is_used) { if (mock_mode) { @@ -528,7 +528,7 @@ int blockstore_disk_t::trim_data(std::function is_free) uint64_t discarded = 0; for (; i <= block_count; i++) { - if (i >= block_count || is_free(i)) + if (i >= block_count || is_used(i)) { if (i > j && (i-j)*data_block_size >= min_discard_size) { diff --git a/src/blockstore/blockstore_disk.h b/src/blockstore/blockstore_disk.h index bae04cee..7ea6e83b 100644 --- a/src/blockstore/blockstore_disk.h +++ b/src/blockstore/blockstore_disk.h @@ -83,7 +83,7 @@ struct blockstore_disk_t void calc_lengths(bool skip_meta_check = false); void check_lengths(); void close_all(); - int trim_data(std::function is_free); + int trim_data(std::function is_used); inline uint64_t dirty_dyn_size(uint64_t offset, uint64_t len) {