mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: ensure dm_stats_get_area_start includes region offset
The dm_stats_get_area_start (and its '_current_' variant) methods are expected to return the start sector of the area in the containing device. Make sure the call adds region->start to the returned value.
This commit is contained in:
parent
16ff2d927f
commit
77fae3d852
@ -1328,9 +1328,10 @@ uint64_t dm_stats_get_current_region_area_len(const struct dm_stats *dms,
|
||||
uint64_t dm_stats_get_area_start(const struct dm_stats *dms, uint64_t *start,
|
||||
uint64_t region_id, uint64_t area_id)
|
||||
{
|
||||
struct dm_stats_region *region = &dms->regions[region_id];
|
||||
if (!dms || !dms->regions)
|
||||
return_0;
|
||||
*start = dms->regions[region_id].step * area_id;
|
||||
*start = region->start + region->step * area_id;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user