From 0104fd6c660d69b6e00bd906a2aed503bdb1ba5e Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 9 Mar 2017 21:13:51 +0000 Subject: [PATCH] libdm: don't nest FIEMAP and DMFILEMAPD ifdefs --- libdm/libdm-stats.c | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 7552ac660..616c6bb70 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -4877,6 +4877,23 @@ out: dm_free((char *) alias); return NULL; } +#else /* !HAVE_LINUX_FIEMAP */ +uint64_t *dm_stats_create_regions_from_fd(struct dm_stats *dms, int fd, + int group, int precise, + struct dm_histogram *bounds, + const char *alias) +{ + log_error("File mapping requires FIEMAP ioctl support."); + return 0; +} + +uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd, + uint64_t group_id) +{ + log_error("File mapping requires FIEMAP ioctl support."); + return 0; +} +#endif /* HAVE_LINUX_FIEMAP */ #ifdef DMFILEMAPD static const char *_filemapd_mode_names[] = { @@ -5026,32 +5043,6 @@ int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path, } #endif /* DMFILEMAPD */ -#else /* HAVE_LINUX_FIEMAP */ - -uint64_t *dm_stats_create_regions_from_fd(struct dm_stats *dms, int fd, - int group, int precise, - struct dm_histogram *bounds, - const char *alias) -{ - log_error("File mapping requires FIEMAP ioctl support."); - return 0; -} - -uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd, - uint64_t group_id) -{ - log_error("File mapping requires FIEMAP ioctl support."); - return 0; -} - -int dm_stats_start_filemapd(struct dm_stats *dms, int fd, uint64_t group_id, - const char *path) -{ - log_error("File mapping requires FIEMAP ioctl support."); - return 0; -} -#endif /* HAVE_LINUX_FIEMAP */ - /* * Backward compatible dm_stats_create_region() implementations. * -- 2.43.5