mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
cache: convert thin-pool
Support caching of thin-pool. lvresize needs to be resolved - so far, user has to manually drop cache-pool before resizing.
This commit is contained in:
parent
127cf4895a
commit
969ab6bbf0
@ -171,9 +171,12 @@ struct logical_volume *lv_cache_create(struct logical_volume *pool_lv,
|
||||
struct lv_segment *seg;
|
||||
|
||||
if (!validate_lv_cache_create_pool(pool_lv) ||
|
||||
!validate_lv_cache_create_origin(origin_lv))
|
||||
!validate_lv_cache_create_origin(cache_lv))
|
||||
return_NULL;
|
||||
|
||||
if (lv_is_thin_pool(cache_lv))
|
||||
cache_lv = seg_lv(first_seg(cache_lv), 0); /* cache _tdata */
|
||||
|
||||
if (!(segtype = get_segtype_from_string(cmd, "cache")))
|
||||
return_NULL;
|
||||
|
||||
|
@ -3188,8 +3188,7 @@ static int _lvconvert_cache(struct cmd_context *cmd,
|
||||
struct logical_volume *pool_lv = lp->pool_data_lv;
|
||||
struct logical_volume *cache_lv;
|
||||
|
||||
if (!validate_lv_cache_create_pool(pool_lv) ||
|
||||
!validate_lv_cache_create_origin(origin_lv))
|
||||
if (!validate_lv_cache_create_pool(pool_lv))
|
||||
return_0;
|
||||
|
||||
if (!archive(origin_lv->vg))
|
||||
@ -3254,12 +3253,10 @@ static int _lvconvert_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_PROCESSED;
|
||||
}
|
||||
|
||||
if (lp->cache) {
|
||||
if (lv_is_thin_pool(lv))
|
||||
lv = seg_lv(first_seg(lv), 0); /* cache _tdata */
|
||||
if (!validate_lv_cache_create_origin(lv))
|
||||
return_ECMD_FAILED;
|
||||
}
|
||||
/* Validate origin prior we start conversion of pool */
|
||||
if (lp->cache &&
|
||||
!validate_lv_cache_create_origin(lv))
|
||||
return_ECMD_FAILED;
|
||||
|
||||
if (lp->thin) {
|
||||
if (lv_is_cache_type(lv) ||
|
||||
|
Loading…
Reference in New Issue
Block a user