2001-10-01 23:29:52 +04:00
/*
2013-08-14 02:26:58 +04:00
* Copyright ( C ) 2001 - 2004 Sistina Software , Inc . All rights reserved .
* Copyright ( C ) 2004 Luca Berra
* Copyright ( C ) 2004 - 2013 Red Hat , Inc . All rights reserved .
2001-10-01 23:29:52 +04:00
*
2004-03-30 23:35:44 +04:00
* This file is part of LVM2 .
2001-10-01 23:29:52 +04:00
*
2004-03-30 23:35:44 +04:00
* This copyrighted material is made available to anyone wishing to use ,
* modify , copy , or redistribute it subject to the terms and conditions
2007-08-21 00:55:30 +04:00
* of the GNU Lesser General Public License v .2 .1 .
2001-10-01 23:29:52 +04:00
*
2007-08-21 00:55:30 +04:00
* You should have received a copy of the GNU Lesser General Public License
2004-03-30 23:35:44 +04:00
* along with this program ; if not , write to the Free Software Foundation ,
2016-01-21 13:49:46 +03:00
* Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
2001-10-01 23:29:52 +04:00
*/
# ifndef _LVM_FILTER_H
# define _LVM_FILTER_H
2018-05-14 12:30:20 +03:00
# include "lib/device/dev-cache.h"
# include "lib/device/dev-type.h"
2002-12-03 19:20:38 +03:00
2014-12-15 17:12:42 +03:00
struct dev_filter * composite_filter_create ( int n , int use_dev_ext_info , struct dev_filter * * filters ) ;
2013-06-12 14:08:56 +04:00
struct dev_filter * lvm_type_filter_create ( struct dev_types * dt ) ;
2018-05-04 01:12:07 +03:00
struct dev_filter * md_filter_create ( struct cmd_context * cmd , struct dev_types * dt ) ;
filters: add firmware RAID filter
Just like MD filtering that detects components of software RAID (md),
add detection for firmware RAID.
We're not adding any native code to detect this - there are lots of
firmware RAIDs out there which is just out of LVM scope. However,
with current changes with which we're able to get device info from
external sources (e.g. external_device_info_source="udev"), we can
do this easily if the external device status source has this kind
of information - which is the case of "udev" source where the results
of blkid scans are stored.
This detection should cover all firmware RAIDs that blkid can detect and
which are identified as:
ID_FS_TYPE = {adaptec,ddf,hpt45x,hpt37x,isw,jmicron,lsi_mega,nvidia,promise_fasttrack,silicon_medley,via}_raid_member
2014-09-09 17:05:57 +04:00
struct dev_filter * fwraid_filter_create ( struct dev_types * dt ) ;
2013-08-14 02:26:58 +04:00
struct dev_filter * mpath_filter_create ( struct dev_types * dt ) ;
struct dev_filter * partitioned_filter_create ( struct dev_types * dt ) ;
2018-06-13 22:00:47 +03:00
struct dev_filter * persistent_filter_create ( struct dev_types * dt , struct dev_filter * f ) ;
2013-08-14 02:26:58 +04:00
struct dev_filter * sysfs_filter_create ( void ) ;
2018-05-01 22:32:15 +03:00
struct dev_filter * signature_filter_create ( struct dev_types * dt ) ;
2009-10-27 20:00:44 +03:00
2016-05-25 21:57:33 +03:00
struct dev_filter * internal_filter_create ( void ) ;
int internal_filter_allow ( struct dm_pool * mem , struct device * dev ) ;
void internal_filter_clear ( void ) ;
2013-08-14 02:26:58 +04:00
/*
* patterns must be an array of strings of the form :
* [ ra ] < sep > < regex > < sep > , eg ,
* r / cdrom / - reject cdroms
* a | loop / [ 0 - 4 ] | - accept loops 0 to 4
* r | . * | - reject everything else
*/
struct dev_filter * regex_filter_create ( const struct dm_config_value * patterns ) ;
2014-09-23 14:49:01 +04:00
typedef enum {
FILTER_MODE_NO_LVMETAD ,
FILTER_MODE_PRE_LVMETAD ,
FILTER_MODE_POST_LVMETAD
} filter_mode_t ;
2018-08-29 21:14:18 +03:00
struct dev_filter * usable_filter_create ( struct cmd_context * cmd , struct dev_types * dt , filter_mode_t mode ) ;
2014-09-23 14:49:01 +04:00
2013-08-14 02:26:58 +04:00
# endif /* _LVM_FILTER_H */