aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2014-08-08 17:21:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:23 -0400
commit2ca66ff70a49f0c92352282d6a67d47be090a462 (patch)
tree0492545ee2cde3b9c58cac0a567c77de042aaf33 /fs/proc/base.c
parent09d93bd6270981446cfaa5938c8d5f6cfc2d84a1 (diff)
proc: convert /proc/$PID/cmdline to seq_file interface
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index f5d0f8f39a57..a6d0214c7c95 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -200,9 +200,16 @@ static int proc_root_link(struct dentry *dentry, struct path *path)
200 return result; 200 return result;
201} 201}
202 202
203static int proc_pid_cmdline(struct task_struct *task, char *buffer) 203static int proc_pid_cmdline(struct seq_file *m, struct pid_namespace *ns,
204 struct pid *pid, struct task_struct *task)
204{ 205{
205 return get_cmdline(task, buffer, PAGE_SIZE); 206 /*
207 * Rely on struct seq_operations::show() being called once
208 * per internal buffer allocation. See single_open(), traverse().
209 */
210 BUG_ON(m->size < PAGE_SIZE);
211 m->count += get_cmdline(task, m->buf, PAGE_SIZE);
212 return 0;
206} 213}
207 214
208static int proc_pid_auxv(struct seq_file *m, struct pid_namespace *ns, 215static int proc_pid_auxv(struct seq_file *m, struct pid_namespace *ns,
@@ -2567,7 +2574,7 @@ static const struct pid_entry tgid_base_stuff[] = {
2567#ifdef CONFIG_HAVE_ARCH_TRACEHOOK 2574#ifdef CONFIG_HAVE_ARCH_TRACEHOOK
2568 ONE("syscall", S_IRUSR, proc_pid_syscall), 2575 ONE("syscall", S_IRUSR, proc_pid_syscall),
2569#endif 2576#endif
2570 INF("cmdline", S_IRUGO, proc_pid_cmdline), 2577 ONE("cmdline", S_IRUGO, proc_pid_cmdline),
2571 ONE("stat", S_IRUGO, proc_tgid_stat), 2578 ONE("stat", S_IRUGO, proc_tgid_stat),
2572 ONE("statm", S_IRUGO, proc_pid_statm), 2579 ONE("statm", S_IRUGO, proc_pid_statm),
2573 REG("maps", S_IRUGO, proc_pid_maps_operations), 2580 REG("maps", S_IRUGO, proc_pid_maps_operations),
@@ -2903,7 +2910,7 @@ static const struct pid_entry tid_base_stuff[] = {
2903#ifdef CONFIG_HAVE_ARCH_TRACEHOOK 2910#ifdef CONFIG_HAVE_ARCH_TRACEHOOK
2904 ONE("syscall", S_IRUSR, proc_pid_syscall), 2911 ONE("syscall", S_IRUSR, proc_pid_syscall),
2905#endif 2912#endif
2906 INF("cmdline", S_IRUGO, proc_pid_cmdline), 2913 ONE("cmdline", S_IRUGO, proc_pid_cmdline),
2907 ONE("stat", S_IRUGO, proc_tid_stat), 2914 ONE("stat", S_IRUGO, proc_tid_stat),
2908 ONE("statm", S_IRUGO, proc_pid_statm), 2915 ONE("statm", S_IRUGO, proc_pid_statm),
2909 REG("maps", S_IRUGO, proc_tid_maps_operations), 2916 REG("maps", S_IRUGO, proc_tid_maps_operations),