aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2014-08-08 17:21:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:23 -0400
commit19aadc98d6a242e84c4a9e7cfac3d5140b885348 (patch)
tree6846675d06f856e8fb77fd6147c65ec25fbbff55 /fs/proc
parent6ba51e3751a3543f353a06cd8a6c975bda707c45 (diff)
proc: convert /proc/$PID/io 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')
-rw-r--r--fs/proc/base.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index d0bf0001dfac..089373e12d7c 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2398,7 +2398,7 @@ static const struct file_operations proc_coredump_filter_operations = {
2398#endif 2398#endif
2399 2399
2400#ifdef CONFIG_TASK_IO_ACCOUNTING 2400#ifdef CONFIG_TASK_IO_ACCOUNTING
2401static int do_io_accounting(struct task_struct *task, char *buffer, int whole) 2401static int do_io_accounting(struct task_struct *task, struct seq_file *m, int whole)
2402{ 2402{
2403 struct task_io_accounting acct = task->ioac; 2403 struct task_io_accounting acct = task->ioac;
2404 unsigned long flags; 2404 unsigned long flags;
@@ -2422,7 +2422,7 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole)
2422 2422
2423 unlock_task_sighand(task, &flags); 2423 unlock_task_sighand(task, &flags);
2424 } 2424 }
2425 result = sprintf(buffer, 2425 result = seq_printf(m,
2426 "rchar: %llu\n" 2426 "rchar: %llu\n"
2427 "wchar: %llu\n" 2427 "wchar: %llu\n"
2428 "syscr: %llu\n" 2428 "syscr: %llu\n"
@@ -2442,14 +2442,16 @@ out_unlock:
2442 return result; 2442 return result;
2443} 2443}
2444 2444
2445static int proc_tid_io_accounting(struct task_struct *task, char *buffer) 2445static int proc_tid_io_accounting(struct seq_file *m, struct pid_namespace *ns,
2446 struct pid *pid, struct task_struct *task)
2446{ 2447{
2447 return do_io_accounting(task, buffer, 0); 2448 return do_io_accounting(task, m, 0);
2448} 2449}
2449 2450
2450static int proc_tgid_io_accounting(struct task_struct *task, char *buffer) 2451static int proc_tgid_io_accounting(struct seq_file *m, struct pid_namespace *ns,
2452 struct pid *pid, struct task_struct *task)
2451{ 2453{
2452 return do_io_accounting(task, buffer, 1); 2454 return do_io_accounting(task, m, 1);
2453} 2455}
2454#endif /* CONFIG_TASK_IO_ACCOUNTING */ 2456#endif /* CONFIG_TASK_IO_ACCOUNTING */
2455 2457
@@ -2631,7 +2633,7 @@ static const struct pid_entry tgid_base_stuff[] = {
2631 REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), 2633 REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations),
2632#endif 2634#endif
2633#ifdef CONFIG_TASK_IO_ACCOUNTING 2635#ifdef CONFIG_TASK_IO_ACCOUNTING
2634 INF("io", S_IRUSR, proc_tgid_io_accounting), 2636 ONE("io", S_IRUSR, proc_tgid_io_accounting),
2635#endif 2637#endif
2636#ifdef CONFIG_HARDWALL 2638#ifdef CONFIG_HARDWALL
2637 INF("hardwall", S_IRUGO, proc_pid_hardwall), 2639 INF("hardwall", S_IRUGO, proc_pid_hardwall),
@@ -2966,7 +2968,7 @@ static const struct pid_entry tid_base_stuff[] = {
2966 REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), 2968 REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations),
2967#endif 2969#endif
2968#ifdef CONFIG_TASK_IO_ACCOUNTING 2970#ifdef CONFIG_TASK_IO_ACCOUNTING
2969 INF("io", S_IRUSR, proc_tid_io_accounting), 2971 ONE("io", S_IRUSR, proc_tid_io_accounting),
2970#endif 2972#endif
2971#ifdef CONFIG_HARDWALL 2973#ifdef CONFIG_HARDWALL
2972 INF("hardwall", S_IRUGO, proc_pid_hardwall), 2974 INF("hardwall", S_IRUGO, proc_pid_hardwall),