Commit 7f81b1ae18416b457e4d5ff23f0bd598e8a42224
Committed by
Linus Torvalds
1 parent
010cfac4ca
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 9 additions and 14 deletions Side-by-side Diff
kernel/cpuset.c
| ... | ... | @@ -128,10 +128,6 @@ |
| 128 | 128 | return container_of(task_subsys_state(task, cpuset_subsys_id), |
| 129 | 129 | struct cpuset, css); |
| 130 | 130 | } |
| 131 | -struct cpuset_hotplug_scanner { | |
| 132 | - struct cgroup_scanner scan; | |
| 133 | - struct cgroup *to; | |
| 134 | -}; | |
| 135 | 131 | |
| 136 | 132 | /* bits in struct cpuset flags field */ |
| 137 | 133 | typedef enum { |
| 138 | 134 | |
| ... | ... | @@ -1890,10 +1886,9 @@ |
| 1890 | 1886 | static void cpuset_do_move_task(struct task_struct *tsk, |
| 1891 | 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); | |
| 1896 | - cgroup_attach_task(chsp->to, tsk); | |
| 1891 | + cgroup_attach_task(new_cgroup, tsk); | |
| 1897 | 1892 | } |
| 1898 | 1893 | |
| 1899 | 1894 | /** |
| 1900 | 1895 | |
| 1901 | 1896 | |
| ... | ... | @@ -1909,15 +1904,15 @@ |
| 1909 | 1904 | */ |
| 1910 | 1905 | static 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; | |
| 1915 | - scan.scan.test_task = NULL; /* select all tasks in cgroup */ | |
| 1916 | - scan.scan.process_task = cpuset_do_move_task; | |
| 1917 | - scan.scan.heap = NULL; | |
| 1918 | - scan.to = to->css.cgroup; | |
| 1909 | + scan.cg = from->css.cgroup; | |
| 1910 | + scan.test_task = NULL; /* select all tasks in cgroup */ | |
| 1911 | + scan.process_task = cpuset_do_move_task; | |
| 1912 | + scan.heap = NULL; | |
| 1913 | + scan.data = to->css.cgroup; | |
| 1919 | 1914 | |
| 1920 | - if (cgroup_scan_tasks(&scan.scan)) | |
| 1915 | + if (cgroup_scan_tasks(&scan)) | |
| 1921 | 1916 | printk(KERN_ERR "move_member_tasks_to_cpuset: " |
| 1922 | 1917 | "cgroup_scan_tasks failed\n"); |
| 1923 | 1918 | } |