diff options
author | David Teigland <teigland@redhat.com> | 2016-11-29 12:00:15 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2017-02-13 08:20:10 -0600 |
commit | 9c6c55c314199a9ba26fe1b864306b2ca8a8dbcd (patch) | |
tree | ec7c1cf043023cc2335a61016c47604237b215d2 /tools/reporter.c | |
parent | 1e2420bca85da9a37570871cd70192e9ae831786 (diff) | |
download | lvm2-9c6c55c314199a9ba26fe1b864306b2ca8a8dbcd.tar.gz |
process_each_lv: add check_single_lv function
The new check_single_lv() function is called prior to the
existing process_single_lv(). If the check function returns 0,
the LV will not be processed.
The check_single_lv function is meant to be a standard method
to validate the combination of specific command + specific LV,
and decide if the combination is allowed. The check_single
function can be used by anything that calls process_each_lv.
As commands are migrated to take advantage of command
definitions, each command definition gets its own entry
point which calls process_each for itself, passing a
pair of check_single/process_single functions which can
be specific to the narrowly defined command def.
Diffstat (limited to 'tools/reporter.c')
-rw-r--r-- | tools/reporter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/reporter.c b/tools/reporter.c index 00606edc4..980f39c7c 100644 --- a/tools/reporter.c +++ b/tools/reporter.c @@ -545,14 +545,14 @@ static int _report_all_in_vg(struct cmd_context *cmd, struct processing_handle * r = _vgs_single(cmd, vg->name, vg, handle); break; case LVS: - r = process_each_lv_in_vg(cmd, vg, NULL, NULL, 0, handle, + r = process_each_lv_in_vg(cmd, vg, NULL, NULL, 0, handle, NULL, do_lv_info && !do_lv_seg_status ? &_lvs_with_info_single : !do_lv_info && do_lv_seg_status ? &_lvs_with_status_single : do_lv_info && do_lv_seg_status ? &_lvs_with_info_and_status_single : &_lvs_single); break; case SEGS: - r = process_each_lv_in_vg(cmd, vg, NULL, NULL, 0, handle, + r = process_each_lv_in_vg(cmd, vg, NULL, NULL, 0, handle, NULL, do_lv_info && !do_lv_seg_status ? &_lvsegs_with_info_single : !do_lv_info && do_lv_seg_status ? &_lvsegs_with_status_single : do_lv_info && do_lv_seg_status ? &_lvsegs_with_info_and_status_single : @@ -1127,7 +1127,7 @@ static int _do_report(struct cmd_context *cmd, struct processing_handle *handle, if (args->full_report_vg) r = _report_all_in_vg(cmd, handle, args->full_report_vg, LVS, lv_info_needed, lv_segment_status_needed); else - r = process_each_lv(cmd, args->argc, args->argv, NULL, NULL, 0, handle, + r = process_each_lv(cmd, args->argc, args->argv, NULL, NULL, 0, handle, NULL, lv_info_needed && !lv_segment_status_needed ? &_lvs_with_info_single : !lv_info_needed && lv_segment_status_needed ? &_lvs_with_status_single : lv_info_needed && lv_segment_status_needed ? &_lvs_with_info_and_status_single : @@ -1161,7 +1161,7 @@ static int _do_report(struct cmd_context *cmd, struct processing_handle *handle, if (args->full_report_vg) r = _report_all_in_vg(cmd, handle, args->full_report_vg, SEGS, lv_info_needed, lv_segment_status_needed); else - r = process_each_lv(cmd, args->argc, args->argv, NULL, NULL, 0, handle, + r = process_each_lv(cmd, args->argc, args->argv, NULL, NULL, 0, handle, NULL, lv_info_needed && !lv_segment_status_needed ? &_lvsegs_with_info_single : !lv_info_needed && lv_segment_status_needed ? &_lvsegs_with_status_single : lv_info_needed && lv_segment_status_needed ? &_lvsegs_with_info_and_status_single : |