mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-04 13:50:09 -05:00
Avoid to get the info block if not necessary
This commit is contained in:
parent
dd29375af1
commit
ff3fc0a194
1 changed files with 5 additions and 4 deletions
|
|
@ -801,15 +801,16 @@ close_and_continue:
|
||||||
*/
|
*/
|
||||||
static int block_is_enabled(struct snapraid_state* state, block_off_t i, struct snapraid_handle* handle, unsigned diskmax)
|
static int block_is_enabled(struct snapraid_state* state, block_off_t i, struct snapraid_handle* handle, unsigned diskmax)
|
||||||
{
|
{
|
||||||
snapraid_info info;
|
|
||||||
unsigned j;
|
unsigned j;
|
||||||
unsigned l;
|
unsigned l;
|
||||||
|
|
||||||
/* get block specific info */
|
|
||||||
info = info_get(&state->infoarr, i);
|
|
||||||
|
|
||||||
/* if we filter for only bad blocks */
|
/* if we filter for only bad blocks */
|
||||||
if (state->opt.badonly) {
|
if (state->opt.badonly) {
|
||||||
|
snapraid_info info;
|
||||||
|
|
||||||
|
/* get block specific info */
|
||||||
|
info = info_get(&state->infoarr, i);
|
||||||
|
|
||||||
/* skip if this is not bad */
|
/* skip if this is not bad */
|
||||||
if (!info_get_bad(info))
|
if (!info_get_bad(info))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue