diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2015-08-17 14:15:56 +0200 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2016-02-03 17:40:31 +0100 |
commit | 096662e217d296cd97593addd8cf0b760916c1b4 (patch) | |
tree | 89b497ba0c5067bdb7bb7baa6a2d862819bd56f7 | |
parent | 8704b3e978619e977725abe64f2a7b3c9b7755a8 (diff) | |
download | lvm2-096662e217d296cd97593addd8cf0b760916c1b4.tar.gz |
metadata: add lv_is_dead fn to test if the LV is dead
-rw-r--r-- | lib/metadata/lv.c | 5 | ||||
-rw-r--r-- | lib/metadata/metadata-exported.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c index 9f745cafa..68fdd16a1 100644 --- a/lib/metadata/lv.c +++ b/lib/metadata/lv.c @@ -28,6 +28,11 @@ static struct utsname _utsname; static int _utsinit = 0; +int lv_is_dead(const struct logical_volume *lv) +{ + return lv->this_glv && lv->this_glv->is_dead; +} + 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) diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 55c0cbe86..498fb1f30 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -1030,6 +1030,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_dead(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 */ |