@@ -677,20 +677,22 @@ get_children_pid(struct inode *inode, struct pid *pid_prev, loff_t pos)
677
677
678
678
static 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
683
return 0 ;
682
684
}
683
685
684
686
static 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
689
691
static void * children_seq_next (struct seq_file * seq , void * v , loff_t * pos )
690
692
{
691
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
696
put_pid (v );
695
697
696
698
++ * pos ;
@@ -711,17 +713,7 @@ static const struct seq_operations children_seq_ops = {
711
713
712
714
static int children_seq_open (struct inode * inode , struct file * file )
713
715
{
714
- struct seq_file * m ;
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 ;
716
+ return seq_open (file , & children_seq_ops );
725
717
}
726
718
727
719
const struct file_operations proc_tid_children_operations = {
0 commit comments