aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2006-01-08 04:01:52 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 23:13:43 -0500
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 f513dd937eee..3ea63da11d71 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -799,18 +799,23 @@ static int update_nodemask(struct cpuset *cs, char *buf)
799 trialcs = *cs; 799 trialcs = *cs;
800 retval = nodelist_parse(buf, trialcs.mems_allowed); 800 retval = nodelist_parse(buf, trialcs.mems_allowed);
801 if (retval < 0) 801 if (retval < 0)
802 return retval; 802 goto done;
803 nodes_and(trialcs.mems_allowed, trialcs.mems_allowed, node_online_map); 803 nodes_and(trialcs.mems_allowed, trialcs.mems_allowed, node_online_map);
804 if (nodes_empty(trialcs.mems_allowed)) 804 if (nodes_empty(trialcs.mems_allowed)) {
805 return -ENOSPC; 805 retval = -ENOSPC;
806 retval = validate_change(cs, &trialcs); 806 goto done;
807 if (retval == 0) {
808 down(&callback_sem);
809 cs->mems_allowed = trialcs.mems_allowed;
810 atomic_inc(&cpuset_mems_generation);
811 cs->mems_generation = atomic_read(&cpuset_mems_generation);
812 up(&callback_sem);
813 } 807 }
808 retval = validate_change(cs, &trialcs);
809 if (retval < 0)
810 goto done;
811
812 down(&callback_sem);
813 cs->mems_allowed = trialcs.mems_allowed;
814 atomic_inc(&cpuset_mems_generation);
815 cs->mems_generation = atomic_read(&cpuset_mems_generation);
816 up(&callback_sem);
817
818done:
814 return retval; 819 return retval;
815} 820}
816 821