diff options
| author | Christoph Hellwig <hch@lst.de> | 2018-04-10 13:42:55 -0400 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 01:24:30 -0400 |
| commit | c3506372277779fccbffee2475400fcd689d5738 (patch) | |
| tree | d45d820f96a84a1223fa84c6ad4b7d84a81399aa /net/unix/af_unix.c | |
| parent | a2dcdee3748b664bf011b4b12de64e945dd4c8c2 (diff) | |
proc: introduce proc_create_net{,_data}
Variants of proc_create{,_data} that directly take a struct seq_operations
and deal with network namespaces in ->open and ->release. All callers of
proc_create + seq_open_net converted over, and seq_{open,release}_net are
removed entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'net/unix/af_unix.c')
| -rw-r--r-- | net/unix/af_unix.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 68bb70a62afe..e5473c03d667 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
| @@ -2852,20 +2852,6 @@ static const struct seq_operations unix_seq_ops = { | |||
| 2852 | .stop = unix_seq_stop, | 2852 | .stop = unix_seq_stop, |
| 2853 | .show = unix_seq_show, | 2853 | .show = unix_seq_show, |
| 2854 | }; | 2854 | }; |
| 2855 | |||
| 2856 | static int unix_seq_open(struct inode *inode, struct file *file) | ||
| 2857 | { | ||
| 2858 | return seq_open_net(inode, file, &unix_seq_ops, | ||
| 2859 | sizeof(struct seq_net_private)); | ||
| 2860 | } | ||
| 2861 | |||
| 2862 | static const struct file_operations unix_seq_fops = { | ||
| 2863 | .open = unix_seq_open, | ||
| 2864 | .read = seq_read, | ||
| 2865 | .llseek = seq_lseek, | ||
| 2866 | .release = seq_release_net, | ||
| 2867 | }; | ||
| 2868 | |||
| 2869 | #endif | 2855 | #endif |
| 2870 | 2856 | ||
| 2871 | static const struct net_proto_family unix_family_ops = { | 2857 | static const struct net_proto_family unix_family_ops = { |
| @@ -2884,7 +2870,8 @@ static int __net_init unix_net_init(struct net *net) | |||
| 2884 | goto out; | 2870 | goto out; |
| 2885 | 2871 | ||
| 2886 | #ifdef CONFIG_PROC_FS | 2872 | #ifdef CONFIG_PROC_FS |
| 2887 | if (!proc_create("unix", 0, net->proc_net, &unix_seq_fops)) { | 2873 | if (!proc_create_net("unix", 0, net->proc_net, &unix_seq_ops, |
| 2874 | sizeof(struct seq_net_private))) { | ||
| 2888 | unix_sysctl_unregister(net); | 2875 | unix_sysctl_unregister(net); |
| 2889 | goto out; | 2876 | goto out; |
| 2890 | } | 2877 | } |
