Assemble: contract next_member loop.

We have a 'goto next_member' loop which is rather spread-out and
confusing.
Recent refactoring make it possible to contract that loop
significantly.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2010-11-22 20:58:05 +11:00
parent bac0d92e93
commit 1415fe4b6c
1 changed files with 4 additions and 5 deletions

View File

@ -390,11 +390,12 @@ int Assemble(struct supertype *st, char *mddev,
if (verbose > 0)
fprintf(stderr, Name ": looking in container %s\n",
devname);
tmpdev->content = tst->ss->container_content(tst, NULL);
next_member:
if (tmpdev->content)
content = tmpdev->content;
else
content = tst->ss->container_content(tst, NULL);
if (!content)
goto loop; /* empty container */
@ -405,7 +406,7 @@ int Assemble(struct supertype *st, char *mddev,
if (!ident_matches(ident, content, tst,
homehost, update,
report_missmatch ? devname : NULL))
goto loop;
goto next_member;
/* we have the one container we need, don't keep
* looking. If the chosen member is active, skip.
@ -521,8 +522,6 @@ int Assemble(struct supertype *st, char *mddev,
loop:
dev_policy_free(pol);
pol = NULL;
if (tmpdev->content)
goto next_member;
if (tst)
tst->ss->free_super(tst);
}