Reduces memory usage, with new array growing by fixed size and not exponential.

This commit is contained in:
Andrea Mazzoleni 2013-09-28 09:40:08 +02:00
parent 7f02cd068f
commit d525b4a14a
18 changed files with 497 additions and 53 deletions

4
sync.c
View file

@ -150,7 +150,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
/* if the block is deleted */
if (block_state_get(block) == BLOCK_STATE_DELETED) {
/* set it to empty */
tommy_array_set(&handle[j].disk->blockarr, i, BLOCK_EMPTY);
tommy_arrayblk_set(&handle[j].disk->blockarr, i, BLOCK_EMPTY);
/* mark the state as needing write */
state->need_write = 1;
@ -328,7 +328,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
/* if it's a deleted block */
if (block_state_get(block) == BLOCK_STATE_DELETED) {
/* the parity is now updated without this block, so it's now empty */
tommy_array_set(&handle[j].disk->blockarr, i, BLOCK_EMPTY);
tommy_arrayblk_set(&handle[j].disk->blockarr, i, BLOCK_EMPTY);
continue;
}