From 833b02106d448dcec7a3e9ff23a8ec2cdc5bb3ab Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 29 Mar 2017 20:42:36 +0100 Subject: [PATCH] libdm: make _stats_resize_group() num_regions argument uint64_t --- libdm/libdm-stats.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 5a454fdae..2e6022d2d 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -4181,21 +4181,23 @@ int dm_stats_get_group_descriptor(const struct dm_stats *dms, * Resize the group bitmap corresponding to group_id so that it can * contain at least num_regions members. */ -static int _stats_resize_group(struct dm_stats_group *group, int num_regions) +static int _stats_resize_group(struct dm_stats_group *group, + uint64_t num_regions) { - int last_bit = dm_bit_get_last(group->regions); + uint64_t last_bit = dm_bit_get_last(group->regions); dm_bitset_t new, old; if (last_bit >= num_regions) { - log_error("Cannot resize group bitmap to %d with bit %d set.", - num_regions, last_bit); + log_error("Cannot resize group bitmap to " FMTu64 + " with bit " FMTu64 " set.", num_regions, last_bit); return 0; } - log_very_verbose("Resizing group bitmap from %d to %d (last_bit: %d).", + log_very_verbose("Resizing group bitmap from " FMTu64 + " to " FMTu64 " (last_bit: " FMTu64 ").", group->regions[0], num_regions, last_bit); - new = dm_bitset_create(NULL, num_regions); + new = dm_bitset_create(NULL, (unsigned) num_regions); if (!new) { log_error("Could not allocate memory for new group bitmap."); return 0;