mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-26 09:56:29 -05: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
sync.c
4
sync.c
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue