1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +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:
Bryn M. Reeves 2015-08-14 20:28:06 +01:00
parent 16ff2d927f
commit 77fae3d852

View File

@ -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;
}