diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2011-10-30 06:46:30 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-01 21:56:14 (GMT) |
commit | 73cb88ecb950ee67906d02354f781ea293bcf895 (patch) | |
tree | fbb4a777410d5a5653537bcd3ee7e954bc9ba5a0 /include | |
parent | 98f41f694f46085fda475cdee8cc0b6d2c5e6f1f (diff) | |
download | linux-73cb88ecb950ee67906d02354f781ea293bcf895.tar.xz |
net: make the tcp and udp file_operations for the /proc stuff const
the tcp and udp code creates a set of struct file_operations at runtime
while it can also be done at compile time, with the added benefit of then
having these file operations be const.
the trickiest part was to get the "THIS_MODULE" reference right; the naive
method of declaring a struct in the place of registration would not work
for this reason.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/tcp.h | 10 | ||||
-rw-r--r-- | include/net/udp.h | 12 |
2 files changed, 13 insertions, 9 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index e147f42..bb18c4d 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1403,11 +1403,13 @@ enum tcp_seq_states { TCP_SEQ_STATE_TIME_WAIT, }; +int tcp_seq_open(struct inode *inode, struct file *file); + struct tcp_seq_afinfo { - char *name; - sa_family_t family; - struct file_operations seq_fops; - struct seq_operations seq_ops; + char *name; + sa_family_t family; + const struct file_operations *seq_fops; + struct seq_operations seq_ops; }; struct tcp_iter_state { diff --git a/include/net/udp.h b/include/net/udp.h index 67ea6fc..3b285f4 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -230,12 +230,14 @@ extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *sadd #endif /* /proc */ +int udp_seq_open(struct inode *inode, struct file *file); + struct udp_seq_afinfo { - char *name; - sa_family_t family; - struct udp_table *udp_table; - struct file_operations seq_fops; - struct seq_operations seq_ops; + 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 { |