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

report: cleanup: simplify LVSINFO detection

LVSINFO is just a subtype of LVS report type with extra "info" ioctl
called for each LV reported (per output line) so include its processing
within "case LVS" switch, not as completely different kind of reporting
which may be misleading when reading the code.

There's already the "lv_info_needed" flag set in the _report fn, so
call the approriate reporting function based on this flag within the
"case LVS" switch line.

Actually the same is already done for LV is reported per segments
within the "case SEGS" switch line. So this patch makes the code more
consistent so it's processed the same way for all cases.

Also, this is a preparation for another and new subtype that will
be introduced later - the "LVSSTATUS" and "SEGSSTATUS" report type.
This commit is contained in:
Peter Rajnoha 2014-11-05 10:35:38 +01:00
parent 160777bb3e
commit bf4681ba13

View File

@ -394,9 +394,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
report_type = PVS; report_type = PVS;
else if (report_type & SEGS) else if (report_type & SEGS)
report_type = SEGS; report_type = SEGS;
else if (report_type & LVSINFO) else if (report_type & (LVS | LVSINFO))
report_type = LVSINFO;
else if (report_type & LVS)
report_type = LVS; report_type = LVS;
/* /*
@ -418,11 +416,8 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
break; break;
case LVS: case LVS:
r = process_each_lv(cmd, argc, argv, 0, report_handle, r = process_each_lv(cmd, argc, argv, 0, report_handle,
&_lvs_single); lv_info_needed ? &_lvs_with_info_single
break; : &_lvs_single);
case LVSINFO:
r = process_each_lv(cmd, argc, argv, 0, report_handle,
&_lvs_with_info_single);
break; break;
case VGS: case VGS:
r = process_each_vg(cmd, argc, argv, 0, r = process_each_vg(cmd, argc, argv, 0,