1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

libdm-stats: only return uint64_t when required

Several interfaced in libdm-stats return a uint64_t when it is
only used to signal success/failure: change all these uses to
return a simple int instead.
This commit is contained in:
Bryn M. Reeves 2015-08-17 15:23:27 +01:00 committed by Alasdair G Kergon
parent 15e20bb5c0
commit 4227b2ebb4
2 changed files with 43 additions and 41 deletions

View File

@ -697,12 +697,14 @@ int dm_stats_set_program_id(struct dm_stats *dms, int allow_empty,
* *
* All values are returned in units of 512b sectors. * All values are returned in units of 512b sectors.
*/ */
uint64_t dm_stats_get_region_start(const struct dm_stats *dms, uint64_t *start, int dm_stats_get_region_start(const struct dm_stats *dms, uint64_t *start,
uint64_t region_id); uint64_t region_id);
uint64_t dm_stats_get_region_len(const struct dm_stats *dms, uint64_t *len,
int dm_stats_get_region_len(const struct dm_stats *dms, uint64_t *len,
uint64_t region_id); uint64_t region_id);
uint64_t dm_stats_get_region_area_len(const struct dm_stats *dms,
uint64_t *area_len, uint64_t region_id); int dm_stats_get_region_area_len(const struct dm_stats *dms,
uint64_t *len, uint64_t region_id);
/* /*
* Area properties: start, offset and length. * Area properties: start, offset and length.
@ -720,10 +722,10 @@ uint64_t dm_stats_get_region_area_len(const struct dm_stats *dms,
* *
* All values are returned in units of 512b sectors. * All values are returned in units of 512b sectors.
*/ */
uint64_t dm_stats_get_area_start(const struct dm_stats *dms, uint64_t *start, int dm_stats_get_area_start(const struct dm_stats *dms, uint64_t *start,
uint64_t region_id, uint64_t area_id); uint64_t region_id, uint64_t area_id);
uint64_t dm_stats_get_area_offset(const struct dm_stats *dms, uint64_t *offset, int dm_stats_get_area_offset(const struct dm_stats *dms, uint64_t *offset,
uint64_t region_id, uint64_t area_id); uint64_t region_id, uint64_t area_id);
/* /*
@ -864,13 +866,13 @@ uint64_t dm_stats_get_current_area(const struct dm_stats *dms);
* *
* All values are returned in units of 512b sectors. * All values are returned in units of 512b sectors.
*/ */
uint64_t dm_stats_get_current_region_start(const struct dm_stats *dms, int dm_stats_get_current_region_start(const struct dm_stats *dms,
uint64_t *start); uint64_t *start);
uint64_t dm_stats_get_current_region_len(const struct dm_stats *dms, int dm_stats_get_current_region_len(const struct dm_stats *dms,
uint64_t *len); uint64_t *len);
uint64_t dm_stats_get_current_region_area_len(const struct dm_stats *dms, int dm_stats_get_current_region_area_len(const struct dm_stats *dms,
uint64_t *area_len); uint64_t *area_len);
/* /*
@ -881,13 +883,13 @@ uint64_t dm_stats_get_current_region_area_len(const struct dm_stats *dms,
* *
* All values are returned in units of 512b sectors. * All values are returned in units of 512b sectors.
*/ */
uint64_t dm_stats_get_current_area_start(const struct dm_stats *dms, int dm_stats_get_current_area_start(const struct dm_stats *dms,
uint64_t *start); uint64_t *start);
uint64_t dm_stats_get_current_area_offset(const struct dm_stats *dms, int dm_stats_get_current_area_offset(const struct dm_stats *dms,
uint64_t *offset); uint64_t *offset);
uint64_t dm_stats_get_current_area_len(const struct dm_stats *dms, int dm_stats_get_current_area_len(const struct dm_stats *dms,
uint64_t *start); uint64_t *start);
/* /*

View File

@ -1280,7 +1280,7 @@ uint64_t dm_stats_get_current_area(const struct dm_stats *dms)
return dms->cur_area; return dms->cur_area;
} }
uint64_t dm_stats_get_region_start(const struct dm_stats *dms, uint64_t *start, int dm_stats_get_region_start(const struct dm_stats *dms, uint64_t *start,
uint64_t region_id) uint64_t region_id)
{ {
if (!dms || !dms->regions) if (!dms || !dms->regions)
@ -1289,7 +1289,7 @@ uint64_t dm_stats_get_region_start(const struct dm_stats *dms, uint64_t *start,
return 1; return 1;
} }
uint64_t dm_stats_get_region_len(const struct dm_stats *dms, uint64_t *len, int dm_stats_get_region_len(const struct dm_stats *dms, uint64_t *len,
uint64_t region_id) uint64_t region_id)
{ {
if (!dms || !dms->regions) if (!dms || !dms->regions)
@ -1298,34 +1298,34 @@ uint64_t dm_stats_get_region_len(const struct dm_stats *dms, uint64_t *len,
return 1; return 1;
} }
uint64_t dm_stats_get_region_area_len(const struct dm_stats *dms, uint64_t *step, int dm_stats_get_region_area_len(const struct dm_stats *dms, uint64_t *len,
uint64_t region_id) uint64_t region_id)
{ {
if (!dms || !dms->regions) if (!dms || !dms->regions)
return_0; return_0;
*step = dms->regions[region_id].step; *len = dms->regions[region_id].step;
return 1; return 1;
} }
uint64_t dm_stats_get_current_region_start(const struct dm_stats *dms, int dm_stats_get_current_region_start(const struct dm_stats *dms,
uint64_t *start) uint64_t *start)
{ {
return dm_stats_get_region_start(dms, start, dms->cur_region); return dm_stats_get_region_start(dms, start, dms->cur_region);
} }
uint64_t dm_stats_get_current_region_len(const struct dm_stats *dms, int dm_stats_get_current_region_len(const struct dm_stats *dms,
uint64_t *len) uint64_t *len)
{ {
return dm_stats_get_region_len(dms, len, dms->cur_region); return dm_stats_get_region_len(dms, len, dms->cur_region);
} }
uint64_t dm_stats_get_current_region_area_len(const struct dm_stats *dms, int dm_stats_get_current_region_area_len(const struct dm_stats *dms,
uint64_t *step) uint64_t *step)
{ {
return dm_stats_get_region_area_len(dms, step, dms->cur_region); return dm_stats_get_region_area_len(dms, step, dms->cur_region);
} }
uint64_t dm_stats_get_area_start(const struct dm_stats *dms, uint64_t *start, int dm_stats_get_area_start(const struct dm_stats *dms, uint64_t *start,
uint64_t region_id, uint64_t area_id) uint64_t region_id, uint64_t area_id)
{ {
struct dm_stats_region *region = &dms->regions[region_id]; struct dm_stats_region *region = &dms->regions[region_id];
@ -1335,7 +1335,7 @@ uint64_t dm_stats_get_area_start(const struct dm_stats *dms, uint64_t *start,
return 1; return 1;
} }
uint64_t dm_stats_get_area_offset(const struct dm_stats *dms, uint64_t *offset, int dm_stats_get_area_offset(const struct dm_stats *dms, uint64_t *offset,
uint64_t region_id, uint64_t area_id) uint64_t region_id, uint64_t area_id)
{ {
if (!dms || !dms->regions) if (!dms || !dms->regions)
@ -1344,21 +1344,21 @@ uint64_t dm_stats_get_area_offset(const struct dm_stats *dms, uint64_t *offset,
return 1; return 1;
} }
uint64_t dm_stats_get_current_area_start(const struct dm_stats *dms, int dm_stats_get_current_area_start(const struct dm_stats *dms,
uint64_t *start) uint64_t *start)
{ {
return dm_stats_get_area_start(dms, start, return dm_stats_get_area_start(dms, start,
dms->cur_region, dms->cur_area); dms->cur_region, dms->cur_area);
} }
uint64_t dm_stats_get_current_area_offset(const struct dm_stats *dms, int dm_stats_get_current_area_offset(const struct dm_stats *dms,
uint64_t *offset) uint64_t *offset)
{ {
return dm_stats_get_area_offset(dms, offset, return dm_stats_get_area_offset(dms, offset,
dms->cur_region, dms->cur_area); dms->cur_region, dms->cur_area);
} }
uint64_t dm_stats_get_current_area_len(const struct dm_stats *dms, int dm_stats_get_current_area_len(const struct dm_stats *dms,
uint64_t *len) uint64_t *len)
{ {
return dm_stats_get_region_area_len(dms, len, dms->cur_region); return dm_stats_get_region_area_len(dms, len, dms->cur_region);