du: Invert apparent-size behaviour

The apparent size is what `stat` says what we use. The non-apparent size
is the blocks that we actually use on-disk.
This commit is contained in:
Tim Schumacher 2022-07-20 23:02:35 +02:00 committed by Andreas Kling
commit 220a50111a
Notes: sideshowbarker 2024-07-17 08:55:54 +09:00

View file

@ -146,7 +146,7 @@ ErrorOr<off_t> print_space_usage(String const& path, DuOption const& du_option,
}
size_t size = path_stat.st_size;
if (du_option.apparent_size) {
if (!du_option.apparent_size) {
constexpr auto block_size = 512;
size = path_stat.st_blocks * block_size;
}