Limit unsynced parity sweep to the invalid window tracked during content parsing
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-10-06 10:42:03 +02:00
parent 2a60279674
commit 8fe9331f42
5 changed files with 76 additions and 32 deletions

View file

@ -1389,6 +1389,20 @@ static int extent_parity_inside_compare_unlock(const void* void_a, const void* v
return 0;
}
struct snapraid_extent* fs_par2extent_find_next(struct snapraid_disk* disk, block_off_t parity_pos)
{
struct extent_parity_inside arg = { parity_pos };
struct snapraid_extent* extent;
fs_lock(disk);
/* non-overlapping extents let this search find the containing extent or the next one */
extent = tommy_tree_search_greater_equal_compare(&disk->fs_parity, extent_parity_inside_compare_unlock, &arg);
fs_unlock(disk);
return extent;
}
/**
* Search the extent at the specified parity position.
* The search is optimized for sequential accesses.