1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-13 15:22:08 +03:00

filters: nodata option

When filter_nodata_only is set, a filter that uses
data is skipped.
This commit is contained in:
David Teigland 2020-10-19 16:46:20 -05:00
parent c601ec0d6e
commit c74ccd5201
5 changed files with 16 additions and 0 deletions

View File

@ -182,6 +182,7 @@ struct cmd_context {
unsigned pvscan_recreate_hints:1; /* enable special case hint handling for pvscan --cache */
unsigned scan_lvs:1;
unsigned wipe_outdated_pvs:1;
unsigned filter_nodata_only:1; /* only use filters that do not require data from the dev */
/*
* Devices and filtering.

View File

@ -15,6 +15,7 @@
#include "base/memory/zalloc.h"
#include "lib/misc/lib.h"
#include "lib/filters/filter.h"
#include "lib/commands/toolcontext.h"
#ifdef UDEV_SYNC_SUPPORT
#include <libudev.h>
@ -69,6 +70,9 @@ static int _ignore_fwraid(struct cmd_context *cmd, struct dev_filter *f __attrib
{
int ret;
if (cmd->filter_nodata_only)
return 1;
dev->filtered_flags &= ~DEV_FILTERED_FWRAID;
if (!fwraid_filtering())

View File

@ -86,6 +86,9 @@ static int _passes_md_filter(struct cmd_context *cmd, struct dev_filter *f __att
{
int ret;
if (cmd->filter_nodata_only)
return 1;
dev->filtered_flags &= ~DEV_FILTERED_MD_COMPONENT;
/*

View File

@ -16,6 +16,7 @@
#include "base/memory/zalloc.h"
#include "lib/misc/lib.h"
#include "lib/filters/filter.h"
#include "lib/commands/toolcontext.h"
#define MSG_SKIPPING "%s: Skipping: Partition table signature found"
@ -24,6 +25,9 @@ static int _passes_partitioned_filter(struct cmd_context *cmd, struct dev_filter
struct dev_types *dt = (struct dev_types *) f->private;
int ret;
if (cmd->filter_nodata_only)
return 1;
dev->filtered_flags &= ~DEV_FILTERED_PARTITIONED;
ret = dev_is_partitioned(dt, dev);

View File

@ -16,6 +16,7 @@
#include "base/memory/zalloc.h"
#include "lib/misc/lib.h"
#include "lib/filters/filter.h"
#include "lib/commands/toolcontext.h"
#ifdef __linux__
@ -27,6 +28,9 @@ static int _ignore_signature(struct cmd_context *cmd, struct dev_filter *f __att
char buf[BUFSIZE];
int ret = 0;
if (cmd->filter_nodata_only)
return 1;
dev->filtered_flags &= ~DEV_FILTERED_SIGNATURE;
if (!scan_bcache) {