aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 911f66924d81..4a8e413bf59b 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -677,20 +677,22 @@ out:
677 677
678static int children_seq_show(struct seq_file *seq, void *v) 678static int children_seq_show(struct seq_file *seq, void *v)
679{ 679{
680 seq_printf(seq, "%d ", pid_nr_ns(v, proc_pid_ns(seq->private))); 680 struct inode *inode = file_inode(seq->file);
681
682 seq_printf(seq, "%d ", pid_nr_ns(v, proc_pid_ns(inode)));
681 return 0; 683 return 0;
682} 684}
683 685
684static void *children_seq_start(struct seq_file *seq, loff_t *pos) 686static void *children_seq_start(struct seq_file *seq, loff_t *pos)
685{ 687{
686 return get_children_pid(seq->private, NULL, *pos); 688 return get_children_pid(file_inode(seq->file), NULL, *pos);
687} 689}
688 690
689static void *children_seq_next(struct seq_file *seq, void *v, loff_t *pos) 691static void *children_seq_next(struct seq_file *seq, void *v, loff_t *pos)
690{ 692{
691 struct pid *pid; 693 struct pid *pid;
692 694
693 pid = get_children_pid(seq->private, v, *pos + 1); 695 pid = get_children_pid(file_inode(seq->file), v, *pos + 1);
694 put_pid(v); 696 put_pid(v);
695 697
696 ++*pos; 698 ++*pos;
@@ -711,17 +713,7 @@ static const struct seq_operations children_seq_ops = {
711 713
712static int children_seq_open(struct inode *inode, struct file *file) 714static int children_seq_open(struct inode *inode, struct file *file)
713{ 715{
714 struct seq_file *m; 716 return seq_open(file, &children_seq_ops);
715 int ret;
716
717 ret = seq_open(file, &children_seq_ops);
718 if (ret)
719 return ret;
720
721 m = file->private_data;
722 m->private = inode;
723
724 return ret;
725} 717}
726 718
727const struct file_operations proc_tid_children_operations = { 719const struct file_operations proc_tid_children_operations = {