1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cachevol: use lv_cache_remove

Use same routine for dropping cache.
This commit is contained in:
Zdenek Kabelac 2019-10-14 10:25:31 +02:00
parent 2825ad9dd2
commit 201ffbd04a
2 changed files with 3 additions and 4 deletions

View File

@ -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;
}

View File

@ -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 */