Skip to contentSkip to conversation

master - dmstats: convert 'delete' to dm_stats_foreach_region()

PATCH Bryn Reeves 1 participant 1 message Jul 5, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=76f7f28dac2190866b88208a1eed7f997656673d
Commit:        76f7f28dac2190866b88208a1eed7f997656673d
Parent:        c54da5e82a8a968f42c6876e7b7cacff5fa713b4
Author:        Bryn M. Reeves <[email protected]>
AuthorDate:    Tue Jul 5 11:26:24 2016 +0100
Committer:     Bryn M. Reeves <[email protected]>
CommitterDate: Tue Jul 5 19:29:50 2016 +0100

dmstats: convert 'delete' to dm_stats_foreach_region()

---
 tools/dmsetup.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
tools/dmsetup.c +2 -4
index 9d3d0a5..6900ba2 100644
@@ -5029,16 +5029,14 @@ static int _stats_delete(CMD_ARGS)
 			goto out;
 		}
 	} else if (_switches[ALL_REGIONS_ARG]) {
-		dm_stats_walk_init(dms, DM_STATS_WALK_REGION);
-		dm_stats_walk_do(dms) {
+		dm_stats_foreach_region(dms) {
 			region_id = dm_stats_get_current_region(dms);
 			if (!dm_stats_delete_region(dms, region_id)) {
 				log_error("Could not delete statistics region.");
 				goto out;
 			}
 			log_info("Deleted statistics region %" PRIu64, region_id);
-			dm_stats_walk_next(dms);
-		} dm_stats_walk_while(dms);
+		}
 	} else {
 		dm_stats_delete_region(dms, region_id);
 		log_info("Deleted statistics region " FMTu64 ".\n", region_id);