1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

thin: move setting of THIN_POOL

Set flag when attaching data LV which make segment THIN_POOL.
This commit is contained in:
Zdenek Kabelac 2013-07-31 15:13:54 +02:00
parent 5d9628475e
commit 7b58f10442
2 changed files with 10 additions and 10 deletions

View File

@ -53,6 +53,7 @@ int attach_pool_data_lv(struct lv_segment *pool_seg, struct logical_volume *pool
if (!set_lv_segment_area_lv(pool_seg, 0, pool_data_lv, 0, THIN_POOL_DATA))
return_0;
pool_seg->lv->status |= THIN_POOL;
lv_set_hidden(pool_data_lv);
return 1;
@ -498,17 +499,17 @@ int create_pool(struct logical_volume *pool_lv, const struct segment_type *segty
goto_bad;
seg = first_seg(pool_lv);
seg->segtype = segtype; /* Set as thin_pool segment */
seg->lv->status |= THIN_POOL;
/* Drop reference as attach_pool_data_lv() takes it again */
if (!remove_seg_from_segs_using_this_lv(data_lv, seg))
goto_bad;
if (!attach_pool_data_lv(seg, data_lv))
goto_bad;
if (!attach_pool_metadata_lv(seg, meta_lv))
goto_bad;
/* Drop reference as attach_pool_data_lv() takes it again */
if (!remove_seg_from_segs_using_this_lv(data_lv, seg))
goto_bad;
if (!attach_pool_data_lv(seg, data_lv))
goto_bad;
seg->segtype = segtype; /* Set as thin_pool segment */
return 1;

View File

@ -103,11 +103,10 @@ static int _thin_pool_text_import(struct lv_segment *seg,
if (!(pool_data_lv = find_lv(seg->lv->vg, lv_name)))
return SEG_LOG_ERROR("Unknown pool %s in", lv_name);
seg->lv->status |= THIN_POOL;
if (!attach_pool_metadata_lv(seg, pool_metadata_lv))
if (!attach_pool_data_lv(seg, pool_data_lv))
return_0;
if (!attach_pool_data_lv(seg, pool_data_lv))
if (!attach_pool_metadata_lv(seg, pool_metadata_lv))
return_0;
if (!dm_config_get_uint64(sn, "transaction_id", &seg->transaction_id))