summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2017-03-29 18:30:16 +0100
committerBryn M. Reeves <bmr@redhat.com>2017-03-29 18:35:27 +0100
commit618f9ab04bed23fe4ca51e6c153ad722987795c0 (patch)
tree27f16f807fa48327067a50e5eaffaba642157299
parent5994ed9df218d4201415855b9bd6defa6f371c74 (diff)
downloadlvm2-618f9ab04bed23fe4ca51e6c153ad722987795c0.tar.gz
dmsetup: simplify branching in _stats_update_file()
The fallback branch in _stats_update_file() is redundant (since the branch taken when the daemon starts successfully must jump to the 'out' label anyway): remove it and re-order the conditions to improve readability.
-rw-r--r--tools/dmsetup.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 5f07ab6d3..d25b3bdea 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -5716,17 +5716,18 @@ static int _stats_update_file(CMD_ARGS)
* If starting the daemon fails, fall back to a direct update.
*/
if (!_switches[NOMONITOR_ARG]) {
- if (!dm_stats_start_filemapd(fd, group_id, abspath, mode,
- foreground, verbose)) {
- log_warn("Failed to start filemap monitoring daemon.");
- goto fallback;
- }
- goto out;
+ if (dm_stats_start_filemapd(fd, group_id, abspath, mode,
+ foreground, verbose))
+ goto out;
+
+ log_warn("Failed to start filemap monitoring daemon.");
+
+ /* fall back to one-shot update */
}
-fallback:
/*
- * --nomonitor case - perform a one-shot update directly from dmstats.
+ * --nomonitor and fall back case - perform a one-shot update directly
+ * from dmsetup.
*/
regions = dm_stats_update_regions_from_fd(dms, fd, group_id);