aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2008-02-08 07:18:33 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:24 -0500
commitdf5f8314ca30d6a76735748e5ba4ca9809c0f434 (patch)
treee0a6157b1666a320e69586a81c77a3fe83b36a2a /kernel/cpuset.c
parenta56d3fc74c0178c5f41c48315604d62cff4e746d (diff)
proc: seqfile convert proc_pid_status to properly handle pid namespaces
Currently we possibly lookup the pid in the wrong pid namespace. So seq_file convert proc_pid_status which ensures the proper pid namespaces is passed in. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: build fix] [akpm@linux-foundation.org: another build fix] [akpm@linux-foundation.org: s390 build fix] [akpm@linux-foundation.org: fix task_name() output] [akpm@linux-foundation.org: fix nommu build] Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Cc: Andrew Morgan <morgan@kernel.org> Cc: Serge Hallyn <serue@us.ibm.com> Cc: Cedric Le Goater <clg@fr.ibm.com> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Menage <menage@google.com> Cc: Paul Jackson <pj@sgi.com> Cc: David Rientjes <rientjes@google.com> 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.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 67b2bfe27814..3e296ed81d4d 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2255,13 +2255,14 @@ const struct file_operations proc_cpuset_operations = {
2255#endif /* CONFIG_PROC_PID_CPUSET */ 2255#endif /* CONFIG_PROC_PID_CPUSET */
2256 2256
2257/* Display task cpus_allowed, mems_allowed in /proc/<pid>/status file. */ 2257/* Display task cpus_allowed, mems_allowed in /proc/<pid>/status file. */
2258char *cpuset_task_status_allowed(struct task_struct *task, char *buffer) 2258void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task)
2259{ 2259{
2260 buffer += sprintf(buffer, "Cpus_allowed:\t"); 2260 seq_printf(m, "Cpus_allowed:\t");
2261 buffer += cpumask_scnprintf(buffer, PAGE_SIZE, task->cpus_allowed); 2261 m->count += cpumask_scnprintf(m->buf + m->count, m->size - m->count,
2262 buffer += sprintf(buffer, "\n"); 2262 task->cpus_allowed);
2263 buffer += sprintf(buffer, "Mems_allowed:\t"); 2263 seq_printf(m, "\n");
2264 buffer += nodemask_scnprintf(buffer, PAGE_SIZE, task->mems_allowed); 2264 seq_printf(m, "Mems_allowed:\t");
2265 buffer += sprintf(buffer, "\n"); 2265 m->count += nodemask_scnprintf(m->buf + m->count, m->size - m->count,
2266 return buffer; 2266 task->mems_allowed);
2267 seq_printf(m, "\n");
2267} 2268}