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:
parent
2825ad9dd2
commit
201ffbd04a
@ -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;
|
||||
}
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user