summaryrefslogtreecommitdiffstats
path: root/lib/activate
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2011-11-15 17:21:02 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2011-11-15 17:21:02 +0000
commited2368538a6dc08b42d3115c615030e006692afc (patch)
tree5b7f4963c7a9b8e863fa6e348f31260a76699ebd /lib/activate
parent8ec016236a84878b9b9a88424fe4015db88dc981 (diff)
downloadlvm2-ed2368538a6dc08b42d3115c615030e006692afc.tar.gz
lvm2-ed2368538a6dc08b42d3115c615030e006692afc.tar.xz
lvm2-ed2368538a6dc08b42d3115c615030e006692afc.zip
Simplify iteration
Since nothing is removed in dm_list snapshot_segs during the loop, there is no reason to use _safe iteration, so switch to simplier dm_list_iterate().
Diffstat (limited to 'lib/activate')
-rw-r--r--lib/activate/dev_manager.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 80ae8dd5..b15402e5 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1118,7 +1118,7 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
static struct dm_tree *_create_partial_dtree(struct dev_manager *dm, struct logical_volume *lv, int origin_only)
{
struct dm_tree *dtree;
- struct dm_list *snh, *snht;
+ struct dm_list *snh;
struct lv_segment *seg;
uint32_t s;
@@ -1132,7 +1132,7 @@ static struct dm_tree *_create_partial_dtree(struct dev_manager *dm, struct logi
/* Add any snapshots of this LV */
if (!origin_only && lv_is_origin(lv))
- dm_list_iterate_safe(snh, snht, &lv->snapshot_segs)
+ dm_list_iterate(snh, &lv->snapshot_segs)
if (!_add_lv_to_dtree(dm, dtree, dm_list_struct_base(snh, struct lv_segment, origin_list)->cow, 0))
goto_bad;