Commit 59dac16f authored by Paul Jackson's avatar Paul Jackson Committed by Linus Torvalds

[PATCH] cpuset: update_nodemask code reformat

Restructure code layout of the kernel/cpuset.c update_nodemask() routine,
removing embedded returns and nested if's in favor of goto completion labels.
This is being done in anticipation of adding more logic to this routine, which
will favor the goto style structure.
Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c5b2aff8
...@@ -799,18 +799,23 @@ static int update_nodemask(struct cpuset *cs, char *buf) ...@@ -799,18 +799,23 @@ static int update_nodemask(struct cpuset *cs, char *buf)
trialcs = *cs; trialcs = *cs;
retval = nodelist_parse(buf, trialcs.mems_allowed); retval = nodelist_parse(buf, trialcs.mems_allowed);
if (retval < 0) if (retval < 0)
return retval; goto done;
nodes_and(trialcs.mems_allowed, trialcs.mems_allowed, node_online_map); nodes_and(trialcs.mems_allowed, trialcs.mems_allowed, node_online_map);
if (nodes_empty(trialcs.mems_allowed)) if (nodes_empty(trialcs.mems_allowed)) {
return -ENOSPC; retval = -ENOSPC;
retval = validate_change(cs, &trialcs); goto done;
if (retval == 0) {
down(&callback_sem);
cs->mems_allowed = trialcs.mems_allowed;
atomic_inc(&cpuset_mems_generation);
cs->mems_generation = atomic_read(&cpuset_mems_generation);
up(&callback_sem);
} }
retval = validate_change(cs, &trialcs);
if (retval < 0)
goto done;
down(&callback_sem);
cs->mems_allowed = trialcs.mems_allowed;
atomic_inc(&cpuset_mems_generation);
cs->mems_generation = atomic_read(&cpuset_mems_generation);
up(&callback_sem);
done:
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment