From fade416e8500252a5bdcc34af623d3a1e7ab3549 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Fri, 8 Feb 2008 04:18:32 -0800 Subject: [PATCH] --- yaml --- r: 84615 b: refs/heads/master c: a56d3fc74c0178c5f41c48315604d62cff4e746d h: refs/heads/master i: 84613: 2127b3e1d2593fa608b1f5a05e294f2de0c44414 84611: 9c997700932eb8da89dc2088b2281c18128dcccd 84607: 824f890c7cb8b180c0fc7269d4dd9a86200ea797 v: v3 --- [refs] | 2 +- trunk/fs/proc/array.c | 8 +++++--- trunk/fs/proc/base.c | 4 ++-- trunk/fs/proc/internal.h | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 27d819afd253..77cfe5ab220b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ee992744ea53db0a90c986fd0a70fbbf91e7f8bd +refs/heads/master: a56d3fc74c0178c5f41c48315604d62cff4e746d diff --git a/trunk/fs/proc/array.c b/trunk/fs/proc/array.c index 7e9f3b65f25b..5540e9575c6d 100644 --- a/trunk/fs/proc/array.c +++ b/trunk/fs/proc/array.c @@ -563,7 +563,8 @@ int proc_tgid_stat(struct seq_file *m, struct pid_namespace *ns, return do_task_stat(m, ns, pid, task, 1); } -int proc_pid_statm(struct task_struct *task, char *buffer) +int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, + struct pid *pid, struct task_struct *task) { int size = 0, resident = 0, shared = 0, text = 0, lib = 0, data = 0; struct mm_struct *mm = get_task_mm(task); @@ -572,7 +573,8 @@ int proc_pid_statm(struct task_struct *task, char *buffer) size = task_statm(mm, &shared, &text, &data, &resident); mmput(mm); } + seq_printf(m, "%d %d %d %d %d %d %d\n", + size, resident, shared, text, lib, data, 0); - return sprintf(buffer, "%d %d %d %d %d %d %d\n", - size, resident, shared, text, lib, data, 0); + return 0; } diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c index f77818ecaa8a..9c3e548a6754 100644 --- a/trunk/fs/proc/base.c +++ b/trunk/fs/proc/base.c @@ -2281,7 +2281,7 @@ static const struct pid_entry tgid_base_stuff[] = { #endif INF("cmdline", S_IRUGO, pid_cmdline), ONE("stat", S_IRUGO, tgid_stat), - INF("statm", S_IRUGO, pid_statm), + ONE("statm", S_IRUGO, pid_statm), REG("maps", S_IRUGO, maps), #ifdef CONFIG_NUMA REG("numa_maps", S_IRUGO, numa_maps), @@ -2612,7 +2612,7 @@ static const struct pid_entry tid_base_stuff[] = { #endif INF("cmdline", S_IRUGO, pid_cmdline), ONE("stat", S_IRUGO, tid_stat), - INF("statm", S_IRUGO, pid_statm), + ONE("statm", S_IRUGO, pid_statm), REG("maps", S_IRUGO, maps), #ifdef CONFIG_NUMA REG("numa_maps", S_IRUGO, numa_maps), diff --git a/trunk/fs/proc/internal.h b/trunk/fs/proc/internal.h index f1cc6f1f4e34..45bdbfc704e7 100644 --- a/trunk/fs/proc/internal.h +++ b/trunk/fs/proc/internal.h @@ -54,7 +54,8 @@ extern int proc_tid_stat(struct seq_file *m, struct pid_namespace *ns, extern int proc_tgid_stat(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task); extern int proc_pid_status(struct task_struct *, char *); -extern int proc_pid_statm(struct task_struct *, char *); +extern int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, + struct pid *pid, struct task_struct *task); extern loff_t mem_lseek(struct file *file, loff_t offset, int orig); extern const struct file_operations proc_maps_operations;