1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Bryn M. Reeves 2017-03-29 18:30:16 +01:00
parent 803b1775ba
commit fe0922b8a6

View File

@ -5716,17 +5716,18 @@ static int _stats_update_file(CMD_ARGS)
* If starting the daemon fails, fall back to a direct update. * If starting the daemon fails, fall back to a direct update.
*/ */
if (!_switches[NOMONITOR_ARG]) { if (!_switches[NOMONITOR_ARG]) {
if (!dm_stats_start_filemapd(fd, group_id, abspath, mode, if (dm_stats_start_filemapd(fd, group_id, abspath, mode,
foreground, verbose)) { foreground, verbose))
log_warn("Failed to start filemap monitoring daemon."); goto out;
goto fallback;
} log_warn("Failed to start filemap monitoring daemon.");
goto out;
/* 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); regions = dm_stats_update_regions_from_fd(dms, fd, group_id);