]> sourceware.org Git - lvm2.git/commitdiff
Add the macro and specific 'get' functions for pvsegs.
authorPetr Rockai <prokai@redhat.com>
Wed, 17 Nov 2010 20:11:27 +0000 (20:11 +0000)
committerPetr Rockai <prokai@redhat.com>
Wed, 17 Nov 2010 20:11:27 +0000 (20:11 +0000)
Signed-off-by: Dave Wysochanski <wysochanski@pobox.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
lib/report/properties.c
lib/report/properties.h

index a588968d6631b72b9efbb236865705c3acf89fc9..b93f419b2be5ec8237b19b44b6e17c86358f1caf 100644 (file)
@@ -36,6 +36,8 @@ static int _ ## NAME ## _get (const void *obj, struct lvm_property_type *prop) \
        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 @@ static int _ ## NAME ## _get (const void *obj, struct lvm_property_type *prop) \
        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 @@ GET_LVSEG_STR_PROPERTY_FN(seg_tags, lvseg_tags_dup(lvseg))
 
 
 /* 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 @@ int vg_get_property(const struct volume_group *vg,
        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)
 {
index 381cdc6e9b1742d6217e54e5b8c82b3eb535da51..f363362c7ab81b90cce1028ddcf63f6c5138634e 100644 (file)
@@ -39,6 +39,8 @@ int lv_get_property(const struct logical_volume *lv,
                    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,
This page took 0.040568 seconds and 5 git commands to generate.