diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2017-03-29 20:49:03 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2017-03-29 20:57:04 +0100 |
commit | d60364c6342748fa565be7ac6881830118848f9f (patch) | |
tree | 779e9ee3b7e174b8d033066b871ade5663d85b1e | |
parent | b5ac2c458a97bf6ebca2071cc57d627b1a2a151d (diff) | |
download | lvm2-dev-bmr-dmfilemapd-cov-fixes.tar.gz |
libdm: use uint64_t where possible in filemap routinesdev-bmr-dmfilemapd-cov-fixes
Use uint64_t where possible and eplicit casts elsewhere to avoid
compiler warnings when converting between int, int64_t and
uint64_t.
-rw-r--r-- | libdm/libdm-stats.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 270d0cd07..a1d0ad55e 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -4511,8 +4511,9 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id, { struct dm_stats_region *region = NULL; struct dm_stats_group *group = NULL; - int64_t nr_kept, nr_old, i; + uint64_t nr_kept, nr_old; struct _extent ext; + int64_t i; group = &dms->groups[group_id]; @@ -4571,7 +4572,7 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id, log_very_verbose("Found " FMTu64 " new extents", *count - nr_kept); - return nr_kept; + return (int) nr_kept; out: dm_pool_abandon_object(mem); return -1; @@ -4594,15 +4595,15 @@ static uint64_t *_stats_map_file_regions(struct dm_stats *dms, int fd, uint64_t *count, int *regroup) { struct _extent *extents = NULL, *old_extents = NULL; - uint64_t *regions = NULL, fail_region; + uint64_t *regions = NULL, fail_region, i, num_bits; struct dm_stats_group *group = NULL; struct dm_pool *extent_mem = NULL; struct _extent *old_ext; char *hist_arg = NULL; - int update, num_bits; struct statfs fsbuf; - int64_t nr_kept = 0, i; + int64_t nr_kept = 0; struct stat buf; + int update; update = _stats_group_id_present(dms, group_id); |