mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Reduces memory usage, with new array growing by fixed size and not exponential.
This commit is contained in:
parent
7f02cd068f
commit
d525b4a14a
18 changed files with 497 additions and 53 deletions
4
parity.c
4
parity.c
|
|
@ -35,12 +35,12 @@ block_off_t parity_size(struct snapraid_state* state)
|
|||
struct snapraid_disk* disk = i->data;
|
||||
|
||||
/* start from the declared size */
|
||||
block_off_t block = tommy_array_size(&disk->blockarr);
|
||||
block_off_t block = tommy_arrayblk_size(&disk->blockarr);
|
||||
|
||||
/* 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_has_file(tommy_array_get(&disk->blockarr, block - 1)))
|
||||
while (block > parity_block && !block_has_file(tommy_arrayblk_get(&disk->blockarr, block - 1)))
|
||||
--block;
|
||||
|
||||
/* get the highest value */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue