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/8021q/vlanproc.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/8021q/vlanproc.c')
-rw-r--r-- | net/8021q/vlanproc.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index d3e3f0f2ec1c..d36e8c4b7f56 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -73,19 +73,6 @@ static const struct seq_operations vlan_seq_ops = { | |||
73 | .show = vlan_seq_show, | 73 | .show = vlan_seq_show, |
74 | }; | 74 | }; |
75 | 75 | ||
76 | static int vlan_seq_open(struct inode *inode, struct file *file) | ||
77 | { | ||
78 | return seq_open_net(inode, file, &vlan_seq_ops, | ||
79 | sizeof(struct seq_net_private)); | ||
80 | } | ||
81 | |||
82 | static const struct file_operations vlan_fops = { | ||
83 | .open = vlan_seq_open, | ||
84 | .read = seq_read, | ||
85 | .llseek = seq_lseek, | ||
86 | .release = seq_release_net, | ||
87 | }; | ||
88 | |||
89 | /* | 76 | /* |
90 | * Proc filesystem directory entries. | 77 | * Proc filesystem directory entries. |
91 | */ | 78 | */ |
@@ -132,8 +119,9 @@ int __net_init vlan_proc_init(struct net *net) | |||
132 | if (!vn->proc_vlan_dir) | 119 | if (!vn->proc_vlan_dir) |
133 | goto err; | 120 | goto err; |
134 | 121 | ||
135 | vn->proc_vlan_conf = proc_create(name_conf, S_IFREG | 0600, | 122 | vn->proc_vlan_conf = proc_create_net(name_conf, S_IFREG | 0600, |
136 | vn->proc_vlan_dir, &vlan_fops); | 123 | vn->proc_vlan_dir, &vlan_seq_ops, |
124 | sizeof(struct seq_net_private)); | ||
137 | if (!vn->proc_vlan_conf) | 125 | if (!vn->proc_vlan_conf) |
138 | goto err; | 126 | goto err; |
139 | return 0; | 127 | return 0; |