summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2019-10-14 10:25:31 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2019-10-14 15:20:25 +0200
commit201ffbd04a76789eb5b1ef3aced6a89cb064d4c6 (patch)
treecdb0f9525afc1c9a1f87325a22d32baf4da1fd64
parent2825ad9dd20a4f34693666d1efaa4ceb1c8e2b8f (diff)
downloadlvm2-201ffbd04a76789eb5b1ef3aced6a89cb064d4c6.tar.gz
cachevol: use lv_cache_remove
Use same routine for dropping cache.
-rw-r--r--lib/metadata/lv_manip.c2
-rw-r--r--tools/lvconvert.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index ebdb0cbbc..e6524f349 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -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;
}
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index f875ac7ad..3fa1b0441 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -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 */