ipv{4,6}/udp{,lite}: simplify proc registration

Remove a couple indirections to make the code look like most other
protocols.

Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Christoph Hellwig
2018-04-10 21:31:50 +02:00
parent 3f3942aca6
commit a3d2599b24
5 changed files with 78 additions and 113 deletions

View File

@@ -408,31 +408,27 @@ do { \
#define __UDPX_INC_STATS(sk, field) __UDP_INC_STATS(sock_net(sk), field, 0)
#endif
/* /proc */
int udp_seq_open(struct inode *inode, struct file *file);
#ifdef CONFIG_PROC_FS
struct udp_seq_afinfo {
char *name;
sa_family_t family;
struct udp_table *udp_table;
const struct file_operations *seq_fops;
struct seq_operations seq_ops;
};
struct udp_iter_state {
struct seq_net_private p;
sa_family_t family;
int bucket;
struct udp_table *udp_table;
};
#ifdef CONFIG_PROC_FS
int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo);
void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo);
void *udp_seq_start(struct seq_file *seq, loff_t *pos);
void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos);
void udp_seq_stop(struct seq_file *seq, void *v);
extern const struct file_operations udp_afinfo_seq_fops;
extern const struct file_operations udp6_afinfo_seq_fops;
int udp4_proc_init(void);
void udp4_proc_exit(void);
#endif
#endif /* CONFIG_PROC_FS */
int udpv4_offload_init(void);