summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2008-10-18 20:28:20 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 08:52:39 -0700
commit30e8e13603c247c301fdacabef2a765c84840994 (patch)
tree753425750bb70f84ae621fa8f0624781557887cb
parent3eda20118000941e7e8994fc5fac8706d8c10f00 (diff)
downloadop-kernel-dev-30e8e13603c247c301fdacabef2a765c84840994.zip
op-kernel-dev-30e8e13603c247c301fdacabef2a765c84840994.tar.gz
cpuset: use seq_*mask_* to print masks
1) seq_file excepts that m->count == m->size when it's buf is full, so current code will causes bugs when buf is overflow. 2) There is not too good that cpuset accesses struct seq_file's fields directly. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Paul Menage <menage@google.com> Cc: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/cpuset.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 81d4d24..3e00526 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2436,19 +2436,15 @@ const struct file_operations proc_cpuset_operations = {
void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task)
{
seq_printf(m, "Cpus_allowed:\t");
- m->count += cpumask_scnprintf(m->buf + m->count, m->size - m->count,
- task->cpus_allowed);
+ seq_cpumask(m, &task->cpus_allowed);
seq_printf(m, "\n");
seq_printf(m, "Cpus_allowed_list:\t");
- m->count += cpulist_scnprintf(m->buf + m->count, m->size - m->count,
- task->cpus_allowed);
+ seq_cpumask_list(m, &task->cpus_allowed);
seq_printf(m, "\n");
seq_printf(m, "Mems_allowed:\t");
- m->count += nodemask_scnprintf(m->buf + m->count, m->size - m->count,
- task->mems_allowed);
+ seq_nodemask(m, &task->mems_allowed);
seq_printf(m, "\n");
seq_printf(m, "Mems_allowed_list:\t");
- m->count += nodelist_scnprintf(m->buf + m->count, m->size - m->count,
- task->mems_allowed);
+ seq_nodemask_list(m, &task->mems_allowed);
seq_printf(m, "\n");
}
OpenPOWER on IntegriCloud