md: Simplify code with existing definition RESYNC_SECTORS in raid10.c
#define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9) "RESYNC_BLOCK_SIZE/512" is equal to "RESYNC_BLOCK_SIZE >> 9", replace it with RESYNC_SECTORS. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Song Liu <songliubraving@fb.com>
This commit is contained in:
parent
3891258443
commit
e287308b83
|
@ -4458,8 +4458,8 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
|
||||||
last = conf->reshape_progress - 1;
|
last = conf->reshape_progress - 1;
|
||||||
sector_nr = last & ~(sector_t)(conf->geo.chunk_mask
|
sector_nr = last & ~(sector_t)(conf->geo.chunk_mask
|
||||||
& conf->prev.chunk_mask);
|
& conf->prev.chunk_mask);
|
||||||
if (sector_nr + RESYNC_BLOCK_SIZE/512 < last)
|
if (sector_nr + RESYNC_SECTORS < last)
|
||||||
sector_nr = last + 1 - RESYNC_BLOCK_SIZE/512;
|
sector_nr = last + 1 - RESYNC_SECTORS;
|
||||||
} else {
|
} else {
|
||||||
/* 'next' is after the last device address that we
|
/* 'next' is after the last device address that we
|
||||||
* might write to for this chunk in the new layout
|
* might write to for this chunk in the new layout
|
||||||
|
@ -4481,8 +4481,8 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
|
||||||
last = sector_nr | (conf->geo.chunk_mask
|
last = sector_nr | (conf->geo.chunk_mask
|
||||||
& conf->prev.chunk_mask);
|
& conf->prev.chunk_mask);
|
||||||
|
|
||||||
if (sector_nr + RESYNC_BLOCK_SIZE/512 <= last)
|
if (sector_nr + RESYNC_SECTORS <= last)
|
||||||
last = sector_nr + RESYNC_BLOCK_SIZE/512 - 1;
|
last = sector_nr + RESYNC_SECTORS - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_flush ||
|
if (need_flush ||
|
||||||
|
|
Loading…
Reference in New Issue