Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

proc: don't detour through seq->private to get the inode

Signed-off-by: Christoph Hellwig <hch@lst.de>

+6 -14
+6 -14
fs/proc/array.c
··· 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; ··· 713 711 714 712 static int children_seq_open(struct inode *inode, struct file *file) 715 713 { 716 - struct seq_file *m; 717 - int ret; 718 - 719 - ret = seq_open(file, &children_seq_ops); 720 - if (ret) 721 - return ret; 722 - 723 - m = file->private_data; 724 - m->private = inode; 725 - 726 - return ret; 714 + return seq_open(file, &children_seq_ops); 727 715 } 728 716 729 717 const struct file_operations proc_tid_children_operations = {