1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Thin clean

Reuse seg pointer already set in _add_lv_to_dtree to have the
value of first_seg(lv) (and is used in other parts of this function).
This commit is contained in:
Zdenek Kabelac 2011-11-15 17:25:05 +00:00
parent 25de8ca372
commit 3de08fc9de

View File

@ -1100,17 +1100,16 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
return_0;
if (lv_is_thin_pool(lv)) {
if (!_add_dev_to_dtree(dm, dtree, lv, "tpool"))
return_0;
if (!_add_lv_to_dtree(dm, dtree, first_seg(lv)->pool_metadata_lv, origin_only))
if (!_add_lv_to_dtree(dm, dtree, seg->pool_metadata_lv, origin_only))
return_0;
/* FIXME code from _create_partial_dtree() should be moved here */
if (!_add_lv_to_dtree(dm, dtree, seg_lv(first_seg(lv), 0), origin_only))
if (!_add_lv_to_dtree(dm, dtree, seg_lv(seg, 0), origin_only))
return_0;
} else if (lv_is_thin_volume(lv)) {
if (!_add_lv_to_dtree(dm, dtree, first_seg(lv)->pool_lv, origin_only))
if (!_add_dev_to_dtree(dm, dtree, lv, "tpool"))
return_0;
}
} else if (lv_is_thin_volume(lv) &&
!_add_lv_to_dtree(dm, dtree, seg->pool_lv, origin_only))
return_0;
return 1;
}