summaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2006-01-08 01:01:52 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 20:13:43 -0800
commit59dac16fb95f09253b8086134443abeb439703cd (patch)
tree25491bdcff6f980edfed259d7edadeb273a27ee3 /kernel/cpuset.c
parentc5b2aff89635495064592dc90da595f8a880ee87 (diff)
[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: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index f513dd937ee..3ea63da11d7 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -799,18 +799,23 @@ static int update_nodemask(struct cpuset *cs, char *buf)
trialcs = *cs;
retval = nodelist_parse(buf, trialcs.mems_allowed);
if (retval < 0)
- return retval;
+ goto done;
nodes_and(trialcs.mems_allowed, trialcs.mems_allowed, node_online_map);
- if (nodes_empty(trialcs.mems_allowed))
- return -ENOSPC;
- retval = validate_change(cs, &trialcs);
- 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);
+ if (nodes_empty(trialcs.mems_allowed)) {
+ retval = -ENOSPC;
+ goto done;
}
+ 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;
}