master - lv_manip: enhance for_each_sub_lv
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bc1adc32cbd593dd1839526da82521b429b13141 Commit: bc1adc32cbd593dd1839526da82521b429b13141 Parent: 6b48868cf0754b13e4efaaaec33cf8c9deba2d40 Author: Zdenek Kabelac <[email protected]> AuthorDate: Wed Feb 28 17:00:33 2018 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Wed Feb 28 21:08:38 2018 +0100
lv_manip: enhance for_each_sub_lv
Fix missing 'externalLV' traversing for thins with external origins.
Replace extra for_each_sub_lv_except_pools() with better internal logic allowing selectively to cut of processed subLV tree.
Extend error code for function 'fn()' when it returns -1 it will stop futher tree scan for given LV.
Also a bit simplify code to have only one place that is calling 'fn()' and use level counter to know depth of traversing.
Update renaming travering to skip trees for pools
and external origins.
--- WHATS_NEW | 1 + lib/metadata/lv_manip.c | 72 +++++++++++++++++++++++----------------------- lib/metadata/metadata.h | 3 -- 3 files changed, 37 insertions(+), 39 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.178 - ===================================== + Add external_origin visiting in for_each_sub_lv(). Ensure cluster commands drop their device cache before locking VG. Do not report LV as remotely active when it's locally exclusive in cluster. Add deprecate messages for usage of mirrors with mirrorlog.
lib/metadata/lv_manip.c +36 -36
118 lines not on this page · raw message
lib/metadata/metadata.h +0 -3
@@ -444,9 +444,6 @@ int add_glv_to_indirect_glvs(struct dm_pool *mem,int remove_glv_from_indirect_glvs (struct generic_logical_volume *origin_glv,struct generic_logical_volume *glv); -int for_each_sub_lv_except_pools (struct logical_volume *lv, -int (*fn)(struct logical_volume *lv,void *data), -void *data);int for_each_sub_lv (struct logical_volume *lv,int (*fn)(struct logical_volume *lv,void *data),void *data);