mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cleanup: reduce code dupliction
This commit is contained in:
parent
d37b19aaaa
commit
d3d28b1b64
@ -441,12 +441,10 @@ static int _raid_target_percent(void **target_state,
|
|||||||
|
|
||||||
*total_numerator += sr->insync_regions;
|
*total_numerator += sr->insync_regions;
|
||||||
*total_denominator += sr->total_regions;
|
*total_denominator += sr->total_regions;
|
||||||
|
*percent = dm_make_percent(sr->insync_regions, sr->total_regions);
|
||||||
|
|
||||||
if (seg)
|
if (seg)
|
||||||
seg->extents_copied = (uint64_t) seg->area_len
|
seg->extents_copied = (uint64_t) seg->area_len * *percent / DM_PERCENT_100;
|
||||||
* dm_make_percent(sr->insync_regions , sr->total_regions) / DM_PERCENT_100;
|
|
||||||
|
|
||||||
*percent = dm_make_percent(sr->insync_regions, sr->total_regions);
|
|
||||||
|
|
||||||
dm_pool_free(mem, sr);
|
dm_pool_free(mem, sr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user