aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-04-02 19:57:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-02 22:04:57 -0400
commit7f81b1ae18416b457e4d5ff23f0bd598e8a42224 (patch)
tree8b484cec5b67d4cf00dfacd407b2648cd0d1b645 /kernel/cpuset.c
parent010cfac4ca0f9e85f54ba2117a372e72f4fb9a60 (diff)
cpuset: remove struct cpuset_hotplug_scanner
Use cgroup_scanner.data, instead of introducing cpuset_hotplug_scanner. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Paul Menage <menage@google.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 3778a21a4662..0619f109d38d 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -128,10 +128,6 @@ static inline struct cpuset *task_cs(struct task_struct *task)
128 return container_of(task_subsys_state(task, cpuset_subsys_id), 128 return container_of(task_subsys_state(task, cpuset_subsys_id),
129 struct cpuset, css); 129 struct cpuset, css);
130} 130}
131struct cpuset_hotplug_scanner {
132 struct cgroup_scanner scan;
133 struct cgroup *to;
134};
135 131
136/* bits in struct cpuset flags field */ 132/* bits in struct cpuset flags field */
137typedef enum { 133typedef enum {
@@ -1890,10 +1886,9 @@ int __init cpuset_init(void)
1890static void cpuset_do_move_task(struct task_struct *tsk, 1886static void cpuset_do_move_task(struct task_struct *tsk,
1891 struct cgroup_scanner *scan) 1887 struct cgroup_scanner *scan)
1892{ 1888{
1893 struct cpuset_hotplug_scanner *chsp; 1889 struct cgroup *new_cgroup = scan->data;
1894 1890
1895 chsp = container_of(scan, struct cpuset_hotplug_scanner, scan); 1891 cgroup_attach_task(new_cgroup, tsk);
1896 cgroup_attach_task(chsp->to, tsk);
1897} 1892}
1898 1893
1899/** 1894/**
@@ -1909,15 +1904,15 @@ static void cpuset_do_move_task(struct task_struct *tsk,
1909 */ 1904 */
1910static void move_member_tasks_to_cpuset(struct cpuset *from, struct cpuset *to) 1905static void move_member_tasks_to_cpuset(struct cpuset *from, struct cpuset *to)
1911{ 1906{
1912 struct cpuset_hotplug_scanner scan; 1907 struct cgroup_scanner scan;
1913 1908
1914 scan.scan.cg = from->css.cgroup; 1909 scan.cg = from->css.cgroup;
1915 scan.scan.test_task = NULL; /* select all tasks in cgroup */ 1910 scan.test_task = NULL; /* select all tasks in cgroup */
1916 scan.scan.process_task = cpuset_do_move_task; 1911 scan.process_task = cpuset_do_move_task;
1917 scan.scan.heap = NULL; 1912 scan.heap = NULL;
1918 scan.to = to->css.cgroup; 1913 scan.data = to->css.cgroup;
1919 1914
1920 if (cgroup_scan_tasks(&scan.scan)) 1915 if (cgroup_scan_tasks(&scan))
1921 printk(KERN_ERR "move_member_tasks_to_cpuset: " 1916 printk(KERN_ERR "move_member_tasks_to_cpuset: "
1922 "cgroup_scan_tasks failed\n"); 1917 "cgroup_scan_tasks failed\n");
1923} 1918}