]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
seqfile convert proc_pid_statm
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 8 Feb 2008 12:18:32 +0000 (04:18 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 8 Feb 2008 17:22:24 +0000 (09:22 -0800)
This conversion is just for code cleanliness, uniformity, and general safety.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/array.c
fs/proc/base.c
fs/proc/internal.h

index 7e9f3b65f25bd593269fb465f6382ea61672b74c..5540e9575c6de92e4c6042661a0a51dd5289e7a5 100644 (file)
@@ -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;
 }
index f77818ecaa8aacfe9e904dd88705e0eba57c6a74..9c3e548a6754bb83aa6e2b3a3cb8ba8049deb570 100644 (file)
@@ -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),
index f1cc6f1f4e34ba292564fa07e69a7f1e4ee59453..45bdbfc704e78252bf22b461e48b517f2a190302 100644 (file)
@@ -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;