2013-07-13 02:42:48 +04:00
/*
* Copyright ( C ) 2013 Red Hat , Inc . All rights reserved .
*
* This file is part of LVM2 .
*
* This copyrighted material is made available to anyone wishing to use ,
* modify , copy , or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v .2 .1 .
*
* You should have received a copy of the GNU Lesser General Public License
* 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
2013-07-13 02:42:48 +04:00
*/
# include "lvm_prop.h"
2018-05-14 14:16:43 +03:00
# include "device_mapper/libdevmapper.h"
2018-05-14 12:30:20 +03:00
# include "lib/metadata/metadata.h"
2013-07-13 02:42:48 +04:00
/* lv create parameters */
GET_LVCREATEPARAMS_NUM_PROPERTY_FN ( skip_zero , lvcp - > zero )
SET_LVCREATEPARAMS_NUM_PROPERTY_FN ( skip_zero , lvcp - > zero )
2013-09-11 03:01:28 +04:00
/* PV create parameters */
2016-02-19 00:31:27 +03:00
GET_PVCREATEPARAMS_NUM_PROPERTY_FN ( size , pvcp - > pva . size )
SET_PVCREATEPARAMS_NUM_PROPERTY_FN ( size , pvcp - > pva . size )
2013-09-11 03:01:28 +04:00
2016-02-19 00:31:27 +03:00
GET_PVCREATEPARAMS_NUM_PROPERTY_FN ( pvmetadatacopies , pvcp - > pva . pvmetadatacopies )
SET_PVCREATEPARAMS_NUM_PROPERTY_FN ( pvmetadatacopies , pvcp - > pva . pvmetadatacopies )
2013-09-11 03:01:28 +04:00
2016-02-19 00:31:27 +03:00
GET_PVCREATEPARAMS_NUM_PROPERTY_FN ( pvmetadatasize , pvcp - > pva . pvmetadatasize )
SET_PVCREATEPARAMS_NUM_PROPERTY_FN ( pvmetadatasize , pvcp - > pva . pvmetadatasize )
2013-09-11 03:01:28 +04:00
2016-02-19 00:31:27 +03:00
GET_PVCREATEPARAMS_NUM_PROPERTY_FN ( data_alignment , pvcp - > pva . data_alignment )
SET_PVCREATEPARAMS_NUM_PROPERTY_FN ( data_alignment , pvcp - > pva . data_alignment )
2013-09-11 03:01:28 +04:00
2016-02-19 00:31:27 +03:00
GET_PVCREATEPARAMS_NUM_PROPERTY_FN ( data_alignment_offset , pvcp - > pva . data_alignment_offset )
SET_PVCREATEPARAMS_NUM_PROPERTY_FN ( data_alignment_offset , pvcp - > pva . data_alignment_offset )
2013-09-11 03:01:28 +04:00
GET_PVCREATEPARAMS_NUM_PROPERTY_FN ( zero , pvcp - > zero )
SET_PVCREATEPARAMS_NUM_PROPERTY_FN ( zero , pvcp - > zero )
2013-07-13 02:42:48 +04:00
struct lvm_property_type _lib_properties [ ] = {
# include "lvm_prop_fields.h"
2015-05-04 22:51:41 +03:00
{ 0 , " " , 0 , 0 , 0 , 0 , { . integer = 0 } , prop_not_implemented_get ,
2013-07-13 02:42:48 +04:00
prop_not_implemented_set } ,
} ;
# undef STR
# undef NUM
# undef FIELD
int lv_create_param_get_property ( const struct lvcreate_params * lvcp ,
struct lvm_property_type * prop )
{
return prop_get_property ( _lib_properties , lvcp , prop , LV_CREATE_PARAMS ) ;
}
int lv_create_param_set_property ( struct lvcreate_params * lvcp ,
struct lvm_property_type * prop )
{
return prop_set_property ( _lib_properties , lvcp , prop , LV_CREATE_PARAMS ) ;
}
2013-09-11 03:01:28 +04:00
int pv_create_param_get_property ( const struct pvcreate_params * pvcp ,
struct lvm_property_type * prop )
{
return prop_get_property ( _lib_properties , pvcp , prop , PV_CREATE_PARAMS ) ;
}
int pv_create_param_set_property ( struct pvcreate_params * pvcp ,
struct lvm_property_type * prop )
{
return prop_set_property ( _lib_properties , pvcp , prop , PV_CREATE_PARAMS ) ;
}