summaryrefslogtreecommitdiffstats
path: root/lib/metadata/snapshot_manip.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2002-05-09 12:03:55 +0000
committerAlasdair Kergon <agk@redhat.com>2002-05-09 12:03:55 +0000
commit64ad493eac4f5021c605cd991aa1160965af5807 (patch)
treed0346528be68e5bea64d98c6458d0bb62fb2dbb2 /lib/metadata/snapshot_manip.c
parent29152f6ef08e50492f7c0c6ad4a9ff2a4136a5ec (diff)
downloadlvm2-64ad493eac4f5021c605cd991aa1160965af5807.tar.gz
lvm2-64ad493eac4f5021c605cd991aa1160965af5807.tar.xz
lvm2-64ad493eac4f5021c605cd991aa1160965af5807.zip
Remove a no-op.
Diffstat (limited to 'lib/metadata/snapshot_manip.c')
-rw-r--r--lib/metadata/snapshot_manip.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c
index fc8b1790..e6a26f4f 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,