Skip to content

Commit de0231b

Browse files
committed
Don't show unpunchable missing holes by default
1 parent 92bae46 commit de0231b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,16 +323,20 @@ fn print_missing_holes(
323323
tx: ReadTransactionRef,
324324
values_file_entry: &walk::Entry,
325325
block_size: u64,
326-
fragments: bool,
326+
print_fragments: bool,
327327
) -> anyhow::Result<()> {
328328
let file_id = values_file_entry.file_id().unwrap();
329329
let mut last_hole_end = None;
330330
for FileRegion { start, length } in missing_holes(tx, values_file_entry)? {
331331
if let Some(last_hole_end) = last_hole_end {
332332
assert!(start > last_hole_end);
333333
}
334+
// Determine if the hole fully occupies a punchable block.
335+
let this_hole_startable_block = start.div_ceil(block_size);
336+
let this_hole_end_block = (start + length) / block_size;
337+
let partial = this_hole_startable_block >= this_hole_end_block;
334338
last_hole_end = Some(start + length);
335-
if !fragments && length < block_size {
339+
if !print_fragments && partial {
336340
continue;
337341
}
338342
println!(

0 commit comments

Comments
 (0)