mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 21:00:16 -05:00
Rename handle_map() to avoid a shadow variable
This commit is contained in:
parent
adbf4f25c2
commit
488d1ffa5d
6 changed files with 7 additions and 7 deletions
|
|
@ -862,7 +862,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna
|
||||||
unsigned* failed_map;
|
unsigned* failed_map;
|
||||||
unsigned l;
|
unsigned l;
|
||||||
|
|
||||||
handle = handle_map(state, &diskmax);
|
handle = handle_mapping(state, &diskmax);
|
||||||
|
|
||||||
/* we need 1 * data + 2 * parity + 1 * zero */
|
/* we need 1 * data + 2 * parity + 1 * zero */
|
||||||
buffermax = diskmax + 2 * state->level + 1;
|
buffermax = diskmax + 2 * state->level + 1;
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
|
||||||
unsigned io_error;
|
unsigned io_error;
|
||||||
unsigned l;
|
unsigned l;
|
||||||
|
|
||||||
handle = handle_map(state, &diskmax);
|
handle = handle_mapping(state, &diskmax);
|
||||||
|
|
||||||
/* we need 1 * data + 2 * parity */
|
/* we need 1 * data + 2 * parity */
|
||||||
buffermax = diskmax + 2 * state->level;
|
buffermax = diskmax + 2 * state->level;
|
||||||
|
|
|
||||||
|
|
@ -357,7 +357,7 @@ int handle_utime(struct snapraid_handle* handle)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct snapraid_handle* handle_map(struct snapraid_state* state, unsigned* handlemax)
|
struct snapraid_handle* handle_mapping(struct snapraid_state* state, unsigned* handlemax)
|
||||||
{
|
{
|
||||||
tommy_node* i;
|
tommy_node* i;
|
||||||
unsigned j;
|
unsigned j;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ int handle_utime(struct snapraid_handle* handle);
|
||||||
* \param diskmax The size of the vector.
|
* \param diskmax The size of the vector.
|
||||||
* \return The allocated vector of pointers.
|
* \return The allocated vector of pointers.
|
||||||
*/
|
*/
|
||||||
struct snapraid_handle* handle_map(struct snapraid_state* state, unsigned* diskmax);
|
struct snapraid_handle* handle_mapping(struct snapraid_state* state, unsigned* diskmax);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par
|
||||||
unsigned l;
|
unsigned l;
|
||||||
|
|
||||||
/* maps the disks to handles */
|
/* maps the disks to handles */
|
||||||
handle = handle_map(state, &diskmax);
|
handle = handle_mapping(state, &diskmax);
|
||||||
|
|
||||||
/* rehash buffers */
|
/* rehash buffers */
|
||||||
rehandle = malloc_nofail_align(diskmax * sizeof(struct snapraid_rehash), &rehandle_alloc);
|
rehandle = malloc_nofail_align(diskmax * sizeof(struct snapraid_rehash), &rehandle_alloc);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
||||||
unsigned io_error;
|
unsigned io_error;
|
||||||
|
|
||||||
/* maps the disks to handles */
|
/* maps the disks to handles */
|
||||||
handle = handle_map(state, &diskmax);
|
handle = handle_mapping(state, &diskmax);
|
||||||
|
|
||||||
/* buffer for reading */
|
/* buffer for reading */
|
||||||
buffer = malloc_nofail(state->block_size);
|
buffer = malloc_nofail(state->block_size);
|
||||||
|
|
@ -690,7 +690,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
||||||
now = time(0);
|
now = time(0);
|
||||||
|
|
||||||
/* maps the disks to handles */
|
/* maps the disks to handles */
|
||||||
handle = handle_map(state, &diskmax);
|
handle = handle_mapping(state, &diskmax);
|
||||||
|
|
||||||
/* rehash buffers */
|
/* rehash buffers */
|
||||||
rehandle = malloc_nofail_align(diskmax * sizeof(struct snapraid_rehash), &rehandle_alloc);
|
rehandle = malloc_nofail_align(diskmax * sizeof(struct snapraid_rehash), &rehandle_alloc);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue