master - cachevol: use lv_cache_remove
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=201ffbd04a76789eb5b1ef3aced6a89cb064d4c6 Commit: 201ffbd04a76789eb5b1ef3aced6a89cb064d4c6 Parent: 2825ad9dd20a4f34693666d1efaa4ceb1c8e2b8f Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Oct 14 10:25:31 2019 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Oct 14 15:20:25 2019 +0200
cachevol: use lv_cache_remove
Use same routine for dropping cache.
--- lib/metadata/lv_manip.c | 2 +- tools/lvconvert.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)
lib/metadata/lv_manip.c +1 -1
@@ -6278,7 +6278,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,if (lv_is_cache (lv) &&lv_is_cache_vol (first_seg (lv)->pool_lv)) {struct logical_volume *cachevol_lv =first_seg (lv)->pool_lv; -if (!lv_detach_cache_vol (lv,0 )) { +if (!lv_cache_remove (lv)) {log_error ("Failed to detach cache from %s" ,display_lvname (lv));return 0 ; }
tools/lvconvert.c +2 -3
@@ -1844,7 +1844,6 @@ static int _lvconvert_split_and_keep_cachevol(struct cmd_context *cmd,char *c;struct lv_segment *cache_seg =first_seg (lv);int cache_mode = cache_seg->cache_mode; -int noflush =0 ;if (!archive (lv->vg)) return_0;
@@ -1878,8 +1877,8 @@ static int _lvconvert_split_and_keep_cachevol(struct cmd_context *cmd,/* Switch internally to WRITETHROUGH which does not require flushing */ cache_seg->cache_mode =CACHE_MODE_WRITETHROUGH ; } - -if (!lv_detach_cache_vol (lv, noflush)) + +if (!lv_cache_remove (lv)) return_0;/* Cut off suffix _cvol */