diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2008-12-04 15:54:26 +0000 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2008-12-04 15:54:26 +0000 |
commit | b47952641ae481341886969e9986427ea707cea7 (patch) | |
tree | c7e2e5eadab4fa8d0922a8a99167aaea0c38fdf3 /lib/metadata/snapshot_manip.c | |
parent | 9d9589d173ae67329e419a99b8155f44ca7525c8 (diff) | |
download | lvm2-b47952641ae481341886969e9986427ea707cea7.tar.gz lvm2-b47952641ae481341886969e9986427ea707cea7.tar.xz lvm2-b47952641ae481341886969e9986427ea707cea7.zip |
Added displayable_lvs_in_vg and lv_is_displayable functions to deal with
the counts of visible LVs from user's perspective consistently throughout
the code.
Diffstat (limited to 'lib/metadata/snapshot_manip.c')
-rw-r--r-- | lib/metadata/snapshot_manip.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index a3c7fb89..9531c921 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -36,6 +36,14 @@ int lv_is_visible(const struct logical_volume *lv) return lv->status & VISIBLE_LV ? 1 : 0; } +int lv_is_displayable(const struct logical_volume *lv) +{ + if (lv->status & SNAPSHOT) + return 0; + + return (lv->status & VISIBLE_LV) || lv_is_cow(lv) ? 1 : 0; +} + /* Given a cow LV, return the snapshot lv_segment that uses it */ struct lv_segment *find_cow(const struct logical_volume *lv) { |