master - activation: add base lv component function
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ca9cbd92c40affa5ea5597de2d0ebd18382d9dab Commit: ca9cbd92c40affa5ea5597de2d0ebd18382d9dab Parent: 6481471c9d74038da457b74ef1f2b0c15931bfa8 Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Feb 27 14:13:00 2018 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Mar 6 15:42:05 2018 +0100
activation: add base lv component function
Introduce:
lv_is_component() check is LV is actually a component device.
lv_component_is_active() checking if any component device is active.
lv_holder_is_active() is any component holding device is active.
--- WHATS_NEW | 1 + lib/activate/activate.c | 111 +++++++++++++++++++++++++++++++++++++- lib/activate/activate.h | 7 ++- lib/activate/dev_manager.c | 2 +- lib/metadata/metadata-exported.h | 11 ++++ 5 files changed, 129 insertions(+), 3 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.178 - ===================================== + Extend internal library to recognize and work with component LV. Skip duplicate check for active LV when prompting for its removal. Activate correct lock holding LV when it is cached. Do not modify archived metadata when removing striped raid.
lib/activate/activate.c +110 -1
119 lines not on this page · raw message
lib/activate/activate.h +6 -1
@@ -1,6 +1,6 @@/* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. -* Copyright (C) 2004-2016 Red Hat, Inc. All rights reserved. +* Copyright (C) 2004-2018 Red Hat, Inc. All rights reserved. * * This file is part of LVM2. *
@@ -198,6 +198,11 @@ int lv_is_active_exclusive(const struct logical_volume *lv);int lv_is_active_exclusive_locally (const struct logical_volume *lv);int lv_is_active_exclusive_remotely (const struct logical_volume *lv); +/* Check is any component LV is active */ +const struct logical_volume *lv_component_is_active (const struct logical_volume *lv); +const struct logical_volume *lv_holder_is_active (const struct logical_volume *lv); +int deactivate_lv_with_sub_lv (const struct logical_volume *lv); +int lv_has_target_type (struct dm_pool *mem,const struct logical_volume *lv,const char *layer,const char *target_type);
lib/activate/dev_manager.c +1 -1
@@ -1,6 +1,6 @@/* * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved. -* Copyright (C) 2004-2017 Red Hat, Inc. All rights reserved. +* Copyright (C) 2004-2018 Red Hat, Inc. All rights reserved. * * This file is part of LVM2. *
lib/metadata/metadata-exported.h +11 -0
@@ -253,6 +253,17 @@#define lv_is_removed (lv) (((lv)->status & LV_REMOVED) ? 1 : 0) +/* Recognize component LV (matching lib/misc/lvm-string.c _lvname_has_reserved_component_string()) */ +#define lv_is_component (lv) (lv_is_cache_origin(lv) || ((lv)->status & (\ + CACHE_POOL_DATA |\ + CACHE_POOL_METADATA |\ + MIRROR_IMAGE |\ + MIRROR_LOG |\ + RAID_IMAGE |\ + RAID_META |\ + THIN_POOL_DATA |\ + THIN_POOL_METADATA)) ? 1 : 0) +int lv_layout_and_role (struct dm_pool *mem,const struct logical_volume *lv,struct dm_list **layout,struct dm_list **role);