aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2014-08-08 17:21:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:23 -0400
commitedfcd6064fa7d368ea9b67f1fa0b1ea4c14a31c1 (patch)
treecd987f4a8e201d0e095981d4b3a6fa330ad31bd7 /fs/proc/base.c
parent2ca66ff70a49f0c92352282d6a67d47be090a462 (diff)
proc: convert /proc/$PID/wchan 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index a6d0214c7c95..353f28718414 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -234,7 +234,8 @@ static int proc_pid_auxv(struct seq_file *m, struct pid_namespace *ns,
234 * Provides a wchan file via kallsyms in a proper one-value-per-file format. 234 * Provides a wchan file via kallsyms in a proper one-value-per-file format.
235 * Returns the resolved symbol. If that fails, simply return the address. 235 * Returns the resolved symbol. If that fails, simply return the address.
236 */ 236 */
237static int proc_pid_wchan(struct task_struct *task, char *buffer) 237static int proc_pid_wchan(struct seq_file *m, struct pid_namespace *ns,
238 struct pid *pid, struct task_struct *task)
238{ 239{
239 unsigned long wchan; 240 unsigned long wchan;
240 char symname[KSYM_NAME_LEN]; 241 char symname[KSYM_NAME_LEN];
@@ -245,9 +246,9 @@ static int proc_pid_wchan(struct task_struct *task, char *buffer)
245 if (!ptrace_may_access(task, PTRACE_MODE_READ)) 246 if (!ptrace_may_access(task, PTRACE_MODE_READ))
246 return 0; 247 return 0;
247 else 248 else
248 return sprintf(buffer, "%lu", wchan); 249 return seq_printf(m, "%lu", wchan);
249 else 250 else
250 return sprintf(buffer, "%s", symname); 251 return seq_printf(m, "%s", symname);
251} 252}
252#endif /* CONFIG_KALLSYMS */ 253#endif /* CONFIG_KALLSYMS */
253 254
@@ -2597,7 +2598,7 @@ static const struct pid_entry tgid_base_stuff[] = {
2597 DIR("attr", S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations), 2598 DIR("attr", S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations),
2598#endif 2599#endif
2599#ifdef CONFIG_KALLSYMS 2600#ifdef CONFIG_KALLSYMS
2600 INF("wchan", S_IRUGO, proc_pid_wchan), 2601 ONE("wchan", S_IRUGO, proc_pid_wchan),
2601#endif 2602#endif
2602#ifdef CONFIG_STACKTRACE 2603#ifdef CONFIG_STACKTRACE
2603 ONE("stack", S_IRUSR, proc_pid_stack), 2604 ONE("stack", S_IRUSR, proc_pid_stack),
@@ -2935,7 +2936,7 @@ static const struct pid_entry tid_base_stuff[] = {
2935 DIR("attr", S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations), 2936 DIR("attr", S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations),
2936#endif 2937#endif
2937#ifdef CONFIG_KALLSYMS 2938#ifdef CONFIG_KALLSYMS
2938 INF("wchan", S_IRUGO, proc_pid_wchan), 2939 ONE("wchan", S_IRUGO, proc_pid_wchan),
2939#endif 2940#endif
2940#ifdef CONFIG_STACKTRACE 2941#ifdef CONFIG_STACKTRACE
2941 ONE("stack", S_IRUSR, proc_pid_stack), 2942 ONE("stack", S_IRUSR, proc_pid_stack),