From: Zdenek Kabelac Date: Tue, 15 Nov 2011 17:25:05 +0000 (+0000) Subject: Thin clean X-Git-Tag: old-v2_02_89~197 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=7411ce05c64d122f1275f9292acff003148cd896;p=lvm2.git 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). --- diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index b15402e5c..4f7e6acbe 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -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; }