Add the "maybe" function also to par2block

This commit is contained in:
Andrea Mazzoleni 2016-01-15 20:32:49 +01:00
parent 83889b4fbb
commit 74fa6e9274
10 changed files with 41 additions and 24 deletions

View file

@ -175,11 +175,11 @@ static void scan_file_allocate(struct snapraid_scan* scan, struct snapraid_file*
snapraid_info info;
/* increment the position until the first really free block */
while (block_has_file(fs_par2block_get(disk, parity_pos)))
while (block_has_file(fs_par2block_maybe(disk, parity_pos)))
++parity_pos;
/* get block we are going to overwrite, if any */
over_block = fs_par2block_get(disk, parity_pos);
over_block = fs_par2block_maybe(disk, parity_pos);
/* deallocate it */
if (over_block != BLOCK_EMPTY)