1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-11-27 20:24:16 +03:00

filters: add cmd->full_filter - composite of cmd->filter and cmd->lvmetad_filter

There are actually three filter chains if lvmetad is used:
  - cmd->lvmetad_filter used when when scanning devices for lvmetad
  - cmd->filter used when processing lvmetad responses
  - cmd->full_fiilter (which is just cmd->lvmetad_filter + cmd->filter chained together) used
    for remaining situations

This patch adds the third one - "cmd->full_filter" - currently this is
used if device processing does not fall into any of the groups before,
for example, devices which does not have the PV label yet and we're just
creating a new one or we're processing the devices where the list of the
devices (PVs) is not returned by lvmetad initially.

Currently, the cmd->full_filter is used exactly in these functions:
  - lvmcache_label_scan
  - _pvcreate_check
  - pvcreate_vol
  - lvmdiskscan
  - pvscan
  - _process_each_label

If lvmetad is used, then simply cmd->full_filter == cmd->filter because
cmd->lvmetad_filter is NULL in this case.
This commit is contained in:
Peter Rajnoha
2014-10-02 12:00:57 +02:00
parent d3fb69c3f3
commit 5011cac9cf
7 changed files with 49 additions and 47 deletions

View File

@@ -111,9 +111,9 @@ int lvmdiskscan(struct cmd_context *cmd, int argc __attribute__((unused)),
if (arg_count(cmd, lvmpartition_ARG))
log_warn("WARNING: only considering LVM devices");
max_len = _get_max_dev_name_len(cmd->filter);
max_len = _get_max_dev_name_len(cmd->full_filter);
if (!(iter = dev_iter_create(cmd->filter, 0))) {
if (!(iter = dev_iter_create(cmd->full_filter, 0))) {
log_error("dev_iter_create failed");
return ECMD_FAILED;
}