From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8447 invoked by alias); 17 Nov 2010 20:11:30 -0000 Received: (qmail 8429 invoked by uid 9699); 17 Nov 2010 20:11:29 -0000 Date: Wed, 17 Nov 2010 20:11:00 -0000 Message-ID: <20101117201129.8427.qmail@sourceware.org> From: mornfall@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/lib/report properties.c properties.h Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00033.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2010-11-17 20:11:28 Modified files: lib/report : properties.c properties.h Log message: Add the macro and specific 'get' functions for pvsegs. Signed-off-by: Dave Wysochanski Reviewed-by: Petr Rockai Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/properties.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/properties.h.diff?cvsroot=lvm2&r1=1.8&r2=1.9 --- LVM2/lib/report/properties.c 2010/11/17 20:08:14 1.24 +++ LVM2/lib/report/properties.c 2010/11/17 20:11:27 1.25 @@ -36,6 +36,8 @@ GET_NUM_PROPERTY_FN(NAME, VALUE, logical_volume, lv) #define GET_LVSEG_NUM_PROPERTY_FN(NAME, VALUE) \ GET_NUM_PROPERTY_FN(NAME, VALUE, lv_segment, lvseg) +#define GET_PVSEG_NUM_PROPERTY_FN(NAME, VALUE) \ + GET_NUM_PROPERTY_FN(NAME, VALUE, pv_segment, pvseg) #define SET_NUM_PROPERTY_FN(NAME, SETFN, TYPE, VAR) \ static int _ ## NAME ## _set (void *obj, struct lvm_property_type *prop) \ @@ -68,6 +70,8 @@ GET_STR_PROPERTY_FN(NAME, VALUE, logical_volume, lv) #define GET_LVSEG_STR_PROPERTY_FN(NAME, VALUE) \ GET_STR_PROPERTY_FN(NAME, VALUE, lv_segment, lvseg) +#define GET_PVSEG_STR_PROPERTY_FN(NAME, VALUE) \ + GET_STR_PROPERTY_FN(NAME, VALUE, pv_segment, pvseg) static int _not_implemented_get(const void *obj, struct lvm_property_type *prop) { @@ -237,9 +241,9 @@ /* PVSEG */ -#define _pvseg_start_get _not_implemented_get +GET_PVSEG_NUM_PROPERTY_FN(pvseg_start, pvseg->pe) #define _pvseg_start_set _not_implemented_set -#define _pvseg_size_get _not_implemented_get +GET_PVSEG_NUM_PROPERTY_FN(pvseg_size, pvseg->len) #define _pvseg_size_set _not_implemented_set @@ -340,6 +344,12 @@ return _get_property(vg, prop, VGS); } +int pvseg_get_property(const struct pv_segment *pvseg, + struct lvm_property_type *prop) +{ + return _get_property(pvseg, prop, PVSEGS); +} + int pv_get_property(const struct physical_volume *pv, struct lvm_property_type *prop) { --- LVM2/lib/report/properties.h 2010/11/17 20:08:14 1.8 +++ LVM2/lib/report/properties.h 2010/11/17 20:11:28 1.9 @@ -39,6 +39,8 @@ struct lvm_property_type *prop); int vg_get_property(const struct volume_group *vg, struct lvm_property_type *prop); +int pvseg_get_property(const struct pv_segment *pvseg, + struct lvm_property_type *prop); int pv_get_property(const struct physical_volume *pv, struct lvm_property_type *prop); int lv_set_property(struct logical_volume *lv,