mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Introduce nalloc_nofail
This commit is contained in:
parent
b297cbfa9b
commit
db3f5af65a
12 changed files with 43 additions and 39 deletions
|
|
@ -693,12 +693,12 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
memset(zero, 0, state->block_size);
|
||||
raid_zero(zero);
|
||||
|
||||
failed = malloc_nofail(diskmax * sizeof(struct failed_struct));
|
||||
failed_map = malloc_nofail(diskmax * sizeof(unsigned));
|
||||
failed = nalloc_nofail(diskmax, sizeof(struct failed_struct));
|
||||
failed_map = nalloc_nofail(diskmax, sizeof(unsigned));
|
||||
|
||||
/* possibly waiting disks */
|
||||
waiting_mac = diskmax > RAID_PARITY_MAX ? diskmax : RAID_PARITY_MAX;
|
||||
waiting_map = malloc_nofail(waiting_mac * sizeof(unsigned));
|
||||
waiting_map = nalloc_nofail(waiting_mac, sizeof(unsigned));
|
||||
|
||||
soft_error = 0;
|
||||
silent_error = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue