mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-25 01:16:31 -05:00
Optimizes the cache use for all the RAID computations.
This commit is contained in:
parent
ed135e5912
commit
4f891087a2
8 changed files with 70 additions and 39 deletions
7
sync.c
7
sync.c
|
|
@ -44,7 +44,6 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
block_off_t i;
|
||||
unsigned j;
|
||||
void* buffer_alloc;
|
||||
unsigned char* buffer_aligned;
|
||||
unsigned char** buffer;
|
||||
unsigned buffermax;
|
||||
data_off_t countsize;
|
||||
|
|
@ -69,11 +68,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
/* we need disk + 1 for each parity level buffers */
|
||||
buffermax = diskmax + state->level;
|
||||
|
||||
buffer_aligned = malloc_nofail_align(buffermax * state->block_size, &buffer_alloc);
|
||||
buffer = malloc_nofail(buffermax * sizeof(void*));
|
||||
for(i=0;i<buffermax;++i) {
|
||||
buffer[i] = buffer_aligned + i * state->block_size;
|
||||
}
|
||||
buffer = malloc_nofail_vector_align(buffermax, state->block_size, &buffer_alloc);
|
||||
|
||||
unrecoverable_error = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue