From 64ad493eac4f5021c605cd991aa1160965af5807 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 9 May 2002 12:03:55 +0000 Subject: [PATCH] Remove a no-op. --- lib/metadata/snapshot_manip.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index fc8b1790f..e6a26f4f8 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -70,7 +70,7 @@ struct list *find_snapshots(struct logical_volume *lv) struct list *snaplist; struct snapshot_list *sl, *newsl; struct pool *mem = lv->vg->cmd->mem; - + if (!(snaplist = pool_alloc(mem, sizeof(*snaplist)))) { log_error("snapshot name list allocation failed"); return NULL; @@ -80,21 +80,18 @@ struct list *find_snapshots(struct logical_volume *lv) list_iterate(slh, &lv->vg->snapshots) { sl = list_item(slh, struct snapshot_list); - if (sl->snapshot->origin == lv) { - if(!(newsl = pool_alloc(mem, sizeof(*newsl)))) { - log_error("snapshot_list structure allocation" - " failed"); - pool_free(mem, snaplist); - return NULL; - } - newsl->snapshot = sl->snapshot; - list_add(snaplist, &newsl->list); + if (!(sl->snapshot->origin == lv)) + continue; + if (!(newsl = pool_alloc(mem, sizeof(*newsl)))) { + log_error("snapshot_list structure allocation failed"); + pool_free(mem, snaplist); + return NULL; } + newsl->snapshot = sl->snapshot; + list_add(snaplist, &newsl->list); } return snaplist; - - return NULL; } int vg_add_snapshot(struct logical_volume *origin, -- 2.43.5