master - metadata: add lv_is_historical fn to test if the LV is historical one
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=baee45a103846a995b847e04c1c2985bfd1743e0 Commit: baee45a103846a995b847e04c1c2985bfd1743e0 Parent: 673bc0636cf1a73321656b2129a6db1681fbd8f4 Author: Peter Rajnoha <[email protected]> AuthorDate: Tue Mar 1 15:22:36 2016 +0100 Committer: Peter Rajnoha <[email protected]> CommitterDate: Thu Mar 3 13:49:14 2016 +0100
metadata: add lv_is_historical fn to test if the LV is historical one
--- lib/metadata/lv.c | 5 +++++ lib/metadata/metadata-exported.h | 2 ++ lib/metadata/snapshot_manip.c | 3 +++ 3 files changed, 10 insertions(+), 0 deletions(-)
lib/metadata/lv.c +5 -0
@@ -28,6 +28,11 @@static struct utsname _utsname;static int _utsinit =0 ; +int lv_is_historical (const struct logical_volume *lv) +{ +return lv->this_glv && lv->this_glv->is_historical; +} +static struct dm_list *_format_pvsegs (struct dm_pool *mem,const struct lv_segment *seg,int range_format,int metadata_areas_only,int mark_hidden)
lib/metadata/metadata-exported.h +2 -0
@@ -1066,6 +1066,8 @@ int lv_is_cow_covering_origin(const struct logical_volume *lv);/* Test if given LV is visible from user's perspective */ int lv_is_visible (const struct logical_volume *lv); +int lv_is_historical (const struct logical_volume *lv); +int pv_is_in_vg (struct volume_group *vg,struct physical_volume *pv);/* Given a cow or thin LV, return the snapshot lv_segment that uses it */
lib/metadata/snapshot_manip.c +3 -0
@@ -113,6 +113,9 @@ int lv_is_cow_covering_origin(const struct logical_volume *lv)int lv_is_visible (const struct logical_volume *lv) { +if (lv_is_historical (lv)) +return 1 ; +if (lv->status &SNAPSHOT )return 0 ;