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

cleanup: postpone lv_is_thin_volume check

Code move to make it easier to follow and
call _add_dev_to_dtree() in the separate if() branch
for thin volumes.
This commit is contained in:
Zdenek Kabelac 2013-02-02 00:44:07 +01:00
parent 38e7b37c89
commit 9f433e6ee3

View File

@ -1557,8 +1557,7 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
struct dm_tree_node *thin_node;
const char *uuid;
if ((!origin_only || lv_is_thin_volume(lv)) &&
!_add_dev_to_dtree(dm, dtree, lv, NULL))
if (!origin_only && !_add_dev_to_dtree(dm, dtree, lv, NULL))
return_0;
/* FIXME Can we avoid doing this every time? */
@ -1590,18 +1589,22 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
return_0;
if (lv_is_thin_volume(lv)) {
#if 0
/* FIXME Implement dm_tree_node_skip_children optimisation */
if (origin_only) {
/* origin_only has special meaning for thin volumes */
if (!_add_dev_to_dtree(dm, dtree, lv, NULL))
return_0;
#if 0
/* FIXME Implement dm_tree_node_skip_children optimisation */
if (!(uuid = build_dm_uuid(dm->mem, lv->lvid.s, NULL)))
return_0;
if ((thin_node = dm_tree_find_node_by_uuid(dtree, uuid)))
dm_tree_node_skip_children(thin_node, 1);
}
#endif
/* Add thin pool LV layer */
lv = seg->pool_lv;
seg = first_seg(lv);
} else {
/* Add thin pool LV layer */
lv = seg->pool_lv;
seg = first_seg(lv);
}
}
if (!origin_only && lv_is_thin_pool(lv)) {