From 58bfea6a6e2789896e81fefe18e504fb7222e834 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Fri, 8 Jul 2016 21:12:18 +0100 Subject: [PATCH] libdm: use SECTOR_SHIFT constant in _stats_add_extent() --- libdm/libdm-stats.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 6504289f0..d911c60d2 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -38,6 +38,8 @@ #define STATS_ROW_BUF_LEN 4096 #define STATS_MSG_BUF_LEN 1024 +#define SECTOR_SHIFT 9L + /* Histogram bin */ struct dm_histogram_bin { uint64_t upper; /* Upper bound on this bin. */ @@ -4120,8 +4122,8 @@ static int _stats_add_extent(struct dm_pool *mem, struct fiemap_extent *fm_ext, memset(&extent.list, 0, sizeof(extent.list)); /* convert bytes to dm (512b) sectors */ - extent.start = fm_ext->fe_physical >> 9; - extent.len = fm_ext->fe_length >> 9; + extent.start = fm_ext->fe_physical >> SECTOR_SHIFT; + extent.len = fm_ext->fe_length >> SECTOR_SHIFT; extent.id = id;