diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2011-10-30 06:46:30 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-01 17:56:14 -0400 |
commit | 73cb88ecb950ee67906d02354f781ea293bcf895 (patch) | |
tree | fbb4a777410d5a5653537bcd3ee7e954bc9ba5a0 /net/ipv4/udplite.c | |
parent | 98f41f694f46085fda475cdee8cc0b6d2c5e6f1f (diff) | |
download | op-kernel-dev-73cb88ecb950ee67906d02354f781ea293bcf895.zip op-kernel-dev-73cb88ecb950ee67906d02354f781ea293bcf895.tar.gz |
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 'net/ipv4/udplite.c')
-rw-r--r-- | net/ipv4/udplite.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index aee9963..08383eb 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c @@ -71,13 +71,20 @@ static struct inet_protosw udplite4_protosw = { }; #ifdef CONFIG_PROC_FS + +static const struct file_operations udplite_afinfo_seq_fops = { + .owner = THIS_MODULE, + .open = udp_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release_net +}; + static struct udp_seq_afinfo udplite4_seq_afinfo = { .name = "udplite", .family = AF_INET, .udp_table = &udplite_table, - .seq_fops = { - .owner = THIS_MODULE, - }, + .seq_fops = &udplite_afinfo_seq_fops, .seq_ops = { .show = udp4_seq_show, }, |