Count unsynced blocks using an extent event sweep instead of per-block lookups

This commit is contained in:
Andrea Mazzoleni 2026-10-03 20:31:41 +02:00
parent 3d7a722ab2
commit 0d2f466b11
3 changed files with 264 additions and 24 deletions

View file

@ -240,6 +240,13 @@ void state_probe(struct snapraid_state* state);
*/
void state_read(struct snapraid_state* state);
/**
* Count the number of unsynced parity positions using an event sweep across extents.
* Counts positions in [0, blockmax). The caller must ensure that the disk list,
* extent trees, and block states remain unchanged for the duration of the call.
*/
uint64_t fs_count_unsynced(struct snapraid_state* state, block_off_t blockmax);
/**
* Write the new state.
*/