mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Keeps track of the hash of deleted blocks.
This will allow an easier recovering providing manually deleted files.
This commit is contained in:
parent
027b6e3fcd
commit
5c4f6dc5c4
10 changed files with 357 additions and 159 deletions
4
parity.c
4
parity.c
|
|
@ -37,10 +37,10 @@ block_off_t parity_size(struct snapraid_state* state)
|
|||
/* start from the declared size */
|
||||
block_off_t block = tommy_array_size(&disk->blockarr);
|
||||
|
||||
/* decrease the block until an allocated one */
|
||||
/* decrease the block until an used one */
|
||||
/* we don't stop at deleted blocks, because we want to have them cleared */
|
||||
/* if they are at the end of the parity */
|
||||
while (block > parity_block && !block_is_valid(tommy_array_get(&disk->blockarr, block - 1)))
|
||||
while (block > parity_block && !block_has_file(tommy_array_get(&disk->blockarr, block - 1)))
|
||||
--block;
|
||||
|
||||
/* get the highest value */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue