]> sourceware.org Git - lvm2.git/commitdiff
Refactor and add code for (lv) 'lv_origin' get function.
authorDave Wysochanski <dwysocha@redhat.com>
Thu, 21 Oct 2010 14:49:20 +0000 (14:49 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Thu, 21 Oct 2010 14:49:20 +0000 (14:49 +0000)
lib/metadata/lv.c
lib/metadata/lv.h
lib/report/properties.c

index bbaeb64554ae4d0d40af819cb0e8f0b4bc534689..9cd5bf8e8140e09591eecb82eb1618685bb3ff2f 100644 (file)
 #include "segtype.h"
 #include "str_list.h"
 
+char *lv_origin_dup(struct dm_pool *mem, const struct logical_volume *lv)
+{
+       if (lv_is_cow(lv))
+               return lv_name_dup(mem, origin_from_cow(lv));
+       return NULL;
+}
+
 char *lv_name_dup(struct dm_pool *mem, const struct logical_volume *lv)
 {
        return dm_pool_strdup(mem, lv->name);
index f80d2d559a594f38fcd2fb40de12d348267935c3..1767551ec79368940f672595b892eacda368f630 100644 (file)
@@ -61,5 +61,6 @@ int lv_kernel_minor(const struct logical_volume *lv);
 char *lv_mirror_log_dup(struct dm_pool *mem, const struct logical_volume *lv);
 char *lv_modules_dup(struct dm_pool *mem, const struct logical_volume *lv);
 char *lv_name_dup(struct dm_pool *mem, const struct logical_volume *lv);
+char *lv_origin_dup(struct dm_pool *mem, const struct logical_volume *lv);
 
 #endif
index 8228193fc6f0d6d6aa99087efc00983893242f37..250c7c9e5d0ead35c7ba15a5e68a086de8d98e7b 100644 (file)
@@ -121,7 +121,7 @@ GET_LV_NUM_PROPERTY_FN(lv_size, lv->size * SECTOR_SIZE)
 #define _lv_size_set _not_implemented_set
 GET_LV_NUM_PROPERTY_FN(seg_count, dm_list_size(&lv->segments))
 #define _seg_count_set _not_implemented_set
-#define _origin_get _not_implemented_get
+GET_LV_STR_PROPERTY_FN(origin, lv_origin_dup(lv->vg->vgmem, lv))
 #define _origin_set _not_implemented_set
 GET_LV_NUM_PROPERTY_FN(origin_size, lv_origin_size(lv))
 #define _origin_size_set _not_implemented_set
This page took 0.042005 seconds and 5 git commands to generate.