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

lvm2api: Add missing files from prev commit.

Missing files for commit 0a048d5274612049467a3defd13de7aca2419137

Signed-off-by: Tony Asleson <tasleson@redhat.com>
This commit is contained in:
Tony Asleson 2013-07-12 18:42:48 -04:00
parent 79eb40a2c8
commit 5b213492f8
3 changed files with 94 additions and 0 deletions

44
liblvm/lvm_prop.c Normal file
View File

@ -0,0 +1,44 @@
/*
* 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,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "lvm_prop.h"
#include "libdevmapper.h"
#include "lvm-types.h"
#include "metadata.h"
/* lv create parameters */
GET_LVCREATEPARAMS_NUM_PROPERTY_FN(skip_zero, lvcp->zero)
SET_LVCREATEPARAMS_NUM_PROPERTY_FN(skip_zero, lvcp->zero)
struct lvm_property_type _lib_properties[] = {
#include "lvm_prop_fields.h"
{ 0, "", 0, 0, 0, { .integer = 0 }, prop_not_implemented_get,
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);
}

35
liblvm/lvm_prop.h Normal file
View File

@ -0,0 +1,35 @@
/*
* 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,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "prop_common.h"
#ifndef _LIB_LVM_PROP_H
#define _LIB_LVM_PROP_H
typedef struct lvcreate_params type_lvcreate_params;
#define LV_CREATE_PARAMS 1
#define GET_LVCREATEPARAMS_NUM_PROPERTY_FN(NAME, VALUE)\
GET_NUM_PROPERTY_FN(NAME, VALUE, lvcreate_params, lvcp)
#define SET_LVCREATEPARAMS_NUM_PROPERTY_FN(NAME, VALUE) \
SET_NUM_PROPERTY(NAME, VALUE, lvcreate_params, lvcp)
int lv_create_param_get_property(const struct lvcreate_params *lvcp,
struct lvm_property_type *prop);
int lv_create_param_set_property(struct lvcreate_params *lvcp,
struct lvm_property_type *prop);
#endif

15
liblvm/lvm_prop_fields.h Normal file
View File

@ -0,0 +1,15 @@
/*
* 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,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
FIELD(LV_CREATE_PARAMS, lvcreate_params, NUM, "skip_zero", zero, 2, uint32, skip_zero, "Skip zeroing on lv creation", 1)