diff options
Diffstat (limited to 'net')
82 files changed, 355 insertions, 227 deletions
diff --git a/net/802/tr.c b/net/802/tr.c index 31509f613401..96bd14452c55 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
@@ -576,7 +576,7 @@ static int rif_seq_open(struct inode *inode, struct file *file) | |||
576 | return seq_open(file, &rif_seq_ops); | 576 | return seq_open(file, &rif_seq_ops); |
577 | } | 577 | } |
578 | 578 | ||
579 | static struct file_operations rif_seq_fops = { | 579 | static const struct file_operations rif_seq_fops = { |
580 | .owner = THIS_MODULE, | 580 | .owner = THIS_MODULE, |
581 | .open = rif_seq_open, | 581 | .open = rif_seq_open, |
582 | .read = seq_read, | 582 | .read = seq_read, |
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 1b72c9854d6f..5e24f72602a1 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -81,7 +81,7 @@ static int vlan_seq_open(struct inode *inode, struct file *file) | |||
81 | return seq_open(file, &vlan_seq_ops); | 81 | return seq_open(file, &vlan_seq_ops); |
82 | } | 82 | } |
83 | 83 | ||
84 | static struct file_operations vlan_fops = { | 84 | static const struct file_operations vlan_fops = { |
85 | .owner = THIS_MODULE, | 85 | .owner = THIS_MODULE, |
86 | .open = vlan_seq_open, | 86 | .open = vlan_seq_open, |
87 | .read = seq_read, | 87 | .read = seq_read, |
@@ -98,7 +98,7 @@ static int vlandev_seq_open(struct inode *inode, struct file *file) | |||
98 | return single_open(file, vlandev_seq_show, PDE(inode)->data); | 98 | return single_open(file, vlandev_seq_show, PDE(inode)->data); |
99 | } | 99 | } |
100 | 100 | ||
101 | static struct file_operations vlandev_fops = { | 101 | static const struct file_operations vlandev_fops = { |
102 | .owner = THIS_MODULE, | 102 | .owner = THIS_MODULE, |
103 | .open = vlandev_seq_open, | 103 | .open = vlandev_seq_open, |
104 | .read = seq_read, | 104 | .read = seq_read, |
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c index 27e845d260a9..d89d62f3702f 100644 --- a/net/appletalk/aarp.c +++ b/net/appletalk/aarp.c | |||
@@ -1048,7 +1048,7 @@ out_kfree: | |||
1048 | goto out; | 1048 | goto out; |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | struct file_operations atalk_seq_arp_fops = { | 1051 | const struct file_operations atalk_seq_arp_fops = { |
1052 | .owner = THIS_MODULE, | 1052 | .owner = THIS_MODULE, |
1053 | .open = aarp_seq_open, | 1053 | .open = aarp_seq_open, |
1054 | .read = seq_read, | 1054 | .read = seq_read, |
diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c index bc3015f277ba..57ff8122b5c5 100644 --- a/net/appletalk/atalk_proc.c +++ b/net/appletalk/atalk_proc.c | |||
@@ -240,7 +240,7 @@ static int atalk_seq_socket_open(struct inode *inode, struct file *file) | |||
240 | return seq_open(file, &atalk_seq_socket_ops); | 240 | return seq_open(file, &atalk_seq_socket_ops); |
241 | } | 241 | } |
242 | 242 | ||
243 | static struct file_operations atalk_seq_interface_fops = { | 243 | static const struct file_operations atalk_seq_interface_fops = { |
244 | .owner = THIS_MODULE, | 244 | .owner = THIS_MODULE, |
245 | .open = atalk_seq_interface_open, | 245 | .open = atalk_seq_interface_open, |
246 | .read = seq_read, | 246 | .read = seq_read, |
@@ -248,7 +248,7 @@ static struct file_operations atalk_seq_interface_fops = { | |||
248 | .release = seq_release, | 248 | .release = seq_release, |
249 | }; | 249 | }; |
250 | 250 | ||
251 | static struct file_operations atalk_seq_route_fops = { | 251 | static const struct file_operations atalk_seq_route_fops = { |
252 | .owner = THIS_MODULE, | 252 | .owner = THIS_MODULE, |
253 | .open = atalk_seq_route_open, | 253 | .open = atalk_seq_route_open, |
254 | .read = seq_read, | 254 | .read = seq_read, |
@@ -256,7 +256,7 @@ static struct file_operations atalk_seq_route_fops = { | |||
256 | .release = seq_release, | 256 | .release = seq_release, |
257 | }; | 257 | }; |
258 | 258 | ||
259 | static struct file_operations atalk_seq_socket_fops = { | 259 | static const struct file_operations atalk_seq_socket_fops = { |
260 | .owner = THIS_MODULE, | 260 | .owner = THIS_MODULE, |
261 | .open = atalk_seq_socket_open, | 261 | .open = atalk_seq_socket_open, |
262 | .read = seq_read, | 262 | .read = seq_read, |
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index f949b5c74ec1..ec4ebd3299e3 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
@@ -784,7 +784,7 @@ static int br2684_proc_open(struct inode *inode, struct file *file) | |||
784 | return seq_open(file, &br2684_seq_ops); | 784 | return seq_open(file, &br2684_seq_ops); |
785 | } | 785 | } |
786 | 786 | ||
787 | static struct file_operations br2684_proc_ops = { | 787 | static const struct file_operations br2684_proc_ops = { |
788 | .owner = THIS_MODULE, | 788 | .owner = THIS_MODULE, |
789 | .open = br2684_proc_open, | 789 | .open = br2684_proc_open, |
790 | .read = seq_read, | 790 | .read = seq_read, |
diff --git a/net/atm/clip.c b/net/atm/clip.c index 5f8a1d222720..ebb5d0ce8b6f 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -971,7 +971,7 @@ out_kfree: | |||
971 | goto out; | 971 | goto out; |
972 | } | 972 | } |
973 | 973 | ||
974 | static struct file_operations arp_seq_fops = { | 974 | static const struct file_operations arp_seq_fops = { |
975 | .open = arp_seq_open, | 975 | .open = arp_seq_open, |
976 | .read = seq_read, | 976 | .read = seq_read, |
977 | .llseek = seq_lseek, | 977 | .llseek = seq_lseek, |
diff --git a/net/atm/lec.c b/net/atm/lec.c index 57dc2ab1b65d..986945527691 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -1212,7 +1212,7 @@ static int lec_seq_release(struct inode *inode, struct file *file) | |||
1212 | return seq_release_private(inode, file); | 1212 | return seq_release_private(inode, file); |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | static struct file_operations lec_seq_fops = { | 1215 | static const struct file_operations lec_seq_fops = { |
1216 | .owner = THIS_MODULE, | 1216 | .owner = THIS_MODULE, |
1217 | .open = lec_seq_open, | 1217 | .open = lec_seq_open, |
1218 | .read = seq_read, | 1218 | .read = seq_read, |
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c index 43315af10309..4b05cbec7a58 100644 --- a/net/atm/mpoa_proc.c +++ b/net/atm/mpoa_proc.c | |||
@@ -39,7 +39,7 @@ static int parse_qos(const char *buff); | |||
39 | /* | 39 | /* |
40 | * Define allowed FILE OPERATIONS | 40 | * Define allowed FILE OPERATIONS |
41 | */ | 41 | */ |
42 | static struct file_operations mpc_file_operations = { | 42 | static const struct file_operations mpc_file_operations = { |
43 | .owner = THIS_MODULE, | 43 | .owner = THIS_MODULE, |
44 | .open = proc_mpc_open, | 44 | .open = proc_mpc_open, |
45 | .read = seq_read, | 45 | .read = seq_read, |
diff --git a/net/atm/proc.c b/net/atm/proc.c index 190f49ce2cad..9e61e512f667 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c | |||
@@ -33,7 +33,7 @@ | |||
33 | static ssize_t proc_dev_atm_read(struct file *file,char __user *buf,size_t count, | 33 | static ssize_t proc_dev_atm_read(struct file *file,char __user *buf,size_t count, |
34 | loff_t *pos); | 34 | loff_t *pos); |
35 | 35 | ||
36 | static struct file_operations proc_atm_dev_ops = { | 36 | static const struct file_operations proc_atm_dev_ops = { |
37 | .owner = THIS_MODULE, | 37 | .owner = THIS_MODULE, |
38 | .read = proc_dev_atm_read, | 38 | .read = proc_dev_atm_read, |
39 | }; | 39 | }; |
@@ -272,7 +272,7 @@ static int atm_dev_seq_open(struct inode *inode, struct file *file) | |||
272 | return seq_open(file, &atm_dev_seq_ops); | 272 | return seq_open(file, &atm_dev_seq_ops); |
273 | } | 273 | } |
274 | 274 | ||
275 | static struct file_operations devices_seq_fops = { | 275 | static const struct file_operations devices_seq_fops = { |
276 | .open = atm_dev_seq_open, | 276 | .open = atm_dev_seq_open, |
277 | .read = seq_read, | 277 | .read = seq_read, |
278 | .llseek = seq_lseek, | 278 | .llseek = seq_lseek, |
@@ -307,7 +307,7 @@ static int pvc_seq_open(struct inode *inode, struct file *file) | |||
307 | return __vcc_seq_open(inode, file, PF_ATMPVC, &pvc_seq_ops); | 307 | return __vcc_seq_open(inode, file, PF_ATMPVC, &pvc_seq_ops); |
308 | } | 308 | } |
309 | 309 | ||
310 | static struct file_operations pvc_seq_fops = { | 310 | static const struct file_operations pvc_seq_fops = { |
311 | .open = pvc_seq_open, | 311 | .open = pvc_seq_open, |
312 | .read = seq_read, | 312 | .read = seq_read, |
313 | .llseek = seq_lseek, | 313 | .llseek = seq_lseek, |
@@ -341,7 +341,7 @@ static int vcc_seq_open(struct inode *inode, struct file *file) | |||
341 | return __vcc_seq_open(inode, file, 0, &vcc_seq_ops); | 341 | return __vcc_seq_open(inode, file, 0, &vcc_seq_ops); |
342 | } | 342 | } |
343 | 343 | ||
344 | static struct file_operations vcc_seq_fops = { | 344 | static const struct file_operations vcc_seq_fops = { |
345 | .open = vcc_seq_open, | 345 | .open = vcc_seq_open, |
346 | .read = seq_read, | 346 | .read = seq_read, |
347 | .llseek = seq_lseek, | 347 | .llseek = seq_lseek, |
@@ -376,7 +376,7 @@ static int svc_seq_open(struct inode *inode, struct file *file) | |||
376 | return __vcc_seq_open(inode, file, PF_ATMSVC, &svc_seq_ops); | 376 | return __vcc_seq_open(inode, file, PF_ATMSVC, &svc_seq_ops); |
377 | } | 377 | } |
378 | 378 | ||
379 | static struct file_operations svc_seq_fops = { | 379 | static const struct file_operations svc_seq_fops = { |
380 | .open = svc_seq_open, | 380 | .open = svc_seq_open, |
381 | .read = seq_read, | 381 | .read = seq_read, |
382 | .llseek = seq_lseek, | 382 | .llseek = seq_lseek, |
@@ -457,7 +457,7 @@ void atm_proc_dev_deregister(struct atm_dev *dev) | |||
457 | 457 | ||
458 | static struct atm_proc_entry { | 458 | static struct atm_proc_entry { |
459 | char *name; | 459 | char *name; |
460 | struct file_operations *proc_fops; | 460 | const struct file_operations *proc_fops; |
461 | struct proc_dir_entry *dirent; | 461 | struct proc_dir_entry *dirent; |
462 | } atm_proc_ents[] = { | 462 | } atm_proc_ents[] = { |
463 | { .name = "devices", .proc_fops = &devices_seq_fops }, | 463 | { .name = "devices", .proc_fops = &devices_seq_fops }, |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 9a0b677d1e7f..1c07c6a50eb8 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
@@ -1938,7 +1938,7 @@ static int ax25_info_open(struct inode *inode, struct file *file) | |||
1938 | return seq_open(file, &ax25_info_seqops); | 1938 | return seq_open(file, &ax25_info_seqops); |
1939 | } | 1939 | } |
1940 | 1940 | ||
1941 | static struct file_operations ax25_info_fops = { | 1941 | static const struct file_operations ax25_info_fops = { |
1942 | .owner = THIS_MODULE, | 1942 | .owner = THIS_MODULE, |
1943 | .open = ax25_info_open, | 1943 | .open = ax25_info_open, |
1944 | .read = seq_read, | 1944 | .read = seq_read, |
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c index 7078861a7385..d65b8e22868d 100644 --- a/net/ax25/ax25_route.c +++ b/net/ax25/ax25_route.c | |||
@@ -332,7 +332,7 @@ static int ax25_rt_info_open(struct inode *inode, struct file *file) | |||
332 | return seq_open(file, &ax25_rt_seqops); | 332 | return seq_open(file, &ax25_rt_seqops); |
333 | } | 333 | } |
334 | 334 | ||
335 | struct file_operations ax25_route_fops = { | 335 | const struct file_operations ax25_route_fops = { |
336 | .owner = THIS_MODULE, | 336 | .owner = THIS_MODULE, |
337 | .open = ax25_rt_info_open, | 337 | .open = ax25_rt_info_open, |
338 | .read = seq_read, | 338 | .read = seq_read, |
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index 7f4c294b36f1..59a41b1e61f5 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c | |||
@@ -198,7 +198,7 @@ static int ax25_uid_info_open(struct inode *inode, struct file *file) | |||
198 | return seq_open(file, &ax25_uid_seqops); | 198 | return seq_open(file, &ax25_uid_seqops); |
199 | } | 199 | } |
200 | 200 | ||
201 | struct file_operations ax25_uid_fops = { | 201 | const struct file_operations ax25_uid_fops = { |
202 | .owner = THIS_MODULE, | 202 | .owner = THIS_MODULE, |
203 | .open = ax25_uid_info_open, | 203 | .open = ax25_uid_info_open, |
204 | .read = seq_read, | 204 | .read = seq_read, |
diff --git a/net/core/dev.c b/net/core/dev.c index 85d58d799329..cf71614dae93 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2200,7 +2200,7 @@ static int dev_seq_open(struct inode *inode, struct file *file) | |||
2200 | return seq_open(file, &dev_seq_ops); | 2200 | return seq_open(file, &dev_seq_ops); |
2201 | } | 2201 | } |
2202 | 2202 | ||
2203 | static struct file_operations dev_seq_fops = { | 2203 | static const struct file_operations dev_seq_fops = { |
2204 | .owner = THIS_MODULE, | 2204 | .owner = THIS_MODULE, |
2205 | .open = dev_seq_open, | 2205 | .open = dev_seq_open, |
2206 | .read = seq_read, | 2206 | .read = seq_read, |
@@ -2220,7 +2220,7 @@ static int softnet_seq_open(struct inode *inode, struct file *file) | |||
2220 | return seq_open(file, &softnet_seq_ops); | 2220 | return seq_open(file, &softnet_seq_ops); |
2221 | } | 2221 | } |
2222 | 2222 | ||
2223 | static struct file_operations softnet_seq_fops = { | 2223 | static const struct file_operations softnet_seq_fops = { |
2224 | .owner = THIS_MODULE, | 2224 | .owner = THIS_MODULE, |
2225 | .open = softnet_seq_open, | 2225 | .open = softnet_seq_open, |
2226 | .read = seq_read, | 2226 | .read = seq_read, |
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index bfcbdf73a293..c4e754e86e96 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c | |||
@@ -277,7 +277,7 @@ static int dev_mc_seq_open(struct inode *inode, struct file *file) | |||
277 | return seq_open(file, &dev_mc_seq_ops); | 277 | return seq_open(file, &dev_mc_seq_ops); |
278 | } | 278 | } |
279 | 279 | ||
280 | static struct file_operations dev_mc_seq_fops = { | 280 | static const struct file_operations dev_mc_seq_fops = { |
281 | .owner = THIS_MODULE, | 281 | .owner = THIS_MODULE, |
282 | .open = dev_mc_seq_open, | 282 | .open = dev_mc_seq_open, |
283 | .read = seq_read, | 283 | .read = seq_read, |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index c08d69650566..512eed91785d 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -63,7 +63,7 @@ void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); | |||
63 | 63 | ||
64 | static struct neigh_table *neigh_tables; | 64 | static struct neigh_table *neigh_tables; |
65 | #ifdef CONFIG_PROC_FS | 65 | #ifdef CONFIG_PROC_FS |
66 | static struct file_operations neigh_stat_seq_fops; | 66 | static const struct file_operations neigh_stat_seq_fops; |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | /* | 69 | /* |
@@ -2403,7 +2403,7 @@ static int neigh_stat_seq_open(struct inode *inode, struct file *file) | |||
2403 | return ret; | 2403 | return ret; |
2404 | }; | 2404 | }; |
2405 | 2405 | ||
2406 | static struct file_operations neigh_stat_seq_fops = { | 2406 | static const struct file_operations neigh_stat_seq_fops = { |
2407 | .owner = THIS_MODULE, | 2407 | .owner = THIS_MODULE, |
2408 | .open = neigh_stat_seq_open, | 2408 | .open = neigh_stat_seq_open, |
2409 | .read = seq_read, | 2409 | .read = seq_read, |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index c2818e07a4bd..74a9a32b906d 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -579,7 +579,7 @@ static int pgctrl_open(struct inode *inode, struct file *file) | |||
579 | return single_open(file, pgctrl_show, PDE(inode)->data); | 579 | return single_open(file, pgctrl_show, PDE(inode)->data); |
580 | } | 580 | } |
581 | 581 | ||
582 | static struct file_operations pktgen_fops = { | 582 | static const struct file_operations pktgen_fops = { |
583 | .owner = THIS_MODULE, | 583 | .owner = THIS_MODULE, |
584 | .open = pgctrl_open, | 584 | .open = pgctrl_open, |
585 | .read = seq_read, | 585 | .read = seq_read, |
@@ -1672,7 +1672,7 @@ static int pktgen_if_open(struct inode *inode, struct file *file) | |||
1672 | return single_open(file, pktgen_if_show, PDE(inode)->data); | 1672 | return single_open(file, pktgen_if_show, PDE(inode)->data); |
1673 | } | 1673 | } |
1674 | 1674 | ||
1675 | static struct file_operations pktgen_if_fops = { | 1675 | static const struct file_operations pktgen_if_fops = { |
1676 | .owner = THIS_MODULE, | 1676 | .owner = THIS_MODULE, |
1677 | .open = pktgen_if_open, | 1677 | .open = pktgen_if_open, |
1678 | .read = seq_read, | 1678 | .read = seq_read, |
@@ -1815,7 +1815,7 @@ static int pktgen_thread_open(struct inode *inode, struct file *file) | |||
1815 | return single_open(file, pktgen_thread_show, PDE(inode)->data); | 1815 | return single_open(file, pktgen_thread_show, PDE(inode)->data); |
1816 | } | 1816 | } |
1817 | 1817 | ||
1818 | static struct file_operations pktgen_thread_fops = { | 1818 | static const struct file_operations pktgen_thread_fops = { |
1819 | .owner = THIS_MODULE, | 1819 | .owner = THIS_MODULE, |
1820 | .open = pktgen_thread_open, | 1820 | .open = pktgen_thread_open, |
1821 | .read = seq_read, | 1821 | .read = seq_read, |
diff --git a/net/core/sock.c b/net/core/sock.c index 1e35d9973f57..e9986acdd0ab 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1911,7 +1911,7 @@ static int proto_seq_open(struct inode *inode, struct file *file) | |||
1911 | return seq_open(file, &proto_seq_ops); | 1911 | return seq_open(file, &proto_seq_ops); |
1912 | } | 1912 | } |
1913 | 1913 | ||
1914 | static struct file_operations proto_seq_fops = { | 1914 | static const struct file_operations proto_seq_fops = { |
1915 | .owner = THIS_MODULE, | 1915 | .owner = THIS_MODULE, |
1916 | .open = proto_seq_open, | 1916 | .open = proto_seq_open, |
1917 | .read = seq_read, | 1917 | .read = seq_read, |
diff --git a/net/core/wireless.c b/net/core/wireless.c index 64017d47b25b..9936ab11e6e0 100644 --- a/net/core/wireless.c +++ b/net/core/wireless.c | |||
@@ -674,7 +674,7 @@ static int wireless_seq_open(struct inode *inode, struct file *file) | |||
674 | return seq_open(file, &wireless_seq_ops); | 674 | return seq_open(file, &wireless_seq_ops); |
675 | } | 675 | } |
676 | 676 | ||
677 | static struct file_operations wireless_seq_fops = { | 677 | static const struct file_operations wireless_seq_fops = { |
678 | .owner = THIS_MODULE, | 678 | .owner = THIS_MODULE, |
679 | .open = wireless_seq_open, | 679 | .open = wireless_seq_open, |
680 | .read = seq_read, | 680 | .read = seq_read, |
diff --git a/net/dccp/probe.c b/net/dccp/probe.c index f81e37de35d5..3b1f509f51dd 100644 --- a/net/dccp/probe.c +++ b/net/dccp/probe.c | |||
@@ -149,7 +149,7 @@ out_free: | |||
149 | return error ? error : cnt; | 149 | return error ? error : cnt; |
150 | } | 150 | } |
151 | 151 | ||
152 | static struct file_operations dccpprobe_fops = { | 152 | static const struct file_operations dccpprobe_fops = { |
153 | .owner = THIS_MODULE, | 153 | .owner = THIS_MODULE, |
154 | .open = dccpprobe_open, | 154 | .open = dccpprobe_open, |
155 | .read = dccpprobe_read, | 155 | .read = dccpprobe_read, |
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index 70061641ee59..c6568d637e1a 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c | |||
@@ -2331,7 +2331,7 @@ out_kfree: | |||
2331 | goto out; | 2331 | goto out; |
2332 | } | 2332 | } |
2333 | 2333 | ||
2334 | static struct file_operations dn_socket_seq_fops = { | 2334 | static const struct file_operations dn_socket_seq_fops = { |
2335 | .owner = THIS_MODULE, | 2335 | .owner = THIS_MODULE, |
2336 | .open = dn_socket_seq_open, | 2336 | .open = dn_socket_seq_open, |
2337 | .read = seq_read, | 2337 | .read = seq_read, |
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index c5e28114beb8..2b2c7fe45a71 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -1442,7 +1442,7 @@ static int dn_dev_seq_open(struct inode *inode, struct file *file) | |||
1442 | return seq_open(file, &dn_dev_seq_ops); | 1442 | return seq_open(file, &dn_dev_seq_ops); |
1443 | } | 1443 | } |
1444 | 1444 | ||
1445 | static struct file_operations dn_dev_seq_fops = { | 1445 | static const struct file_operations dn_dev_seq_fops = { |
1446 | .owner = THIS_MODULE, | 1446 | .owner = THIS_MODULE, |
1447 | .open = dn_dev_seq_open, | 1447 | .open = dn_dev_seq_open, |
1448 | .read = seq_read, | 1448 | .read = seq_read, |
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c index 11d692dfb4f3..bf701cf5a386 100644 --- a/net/decnet/dn_neigh.c +++ b/net/decnet/dn_neigh.c | |||
@@ -598,7 +598,7 @@ out_kfree: | |||
598 | goto out; | 598 | goto out; |
599 | } | 599 | } |
600 | 600 | ||
601 | static struct file_operations dn_neigh_seq_fops = { | 601 | static const struct file_operations dn_neigh_seq_fops = { |
602 | .owner = THIS_MODULE, | 602 | .owner = THIS_MODULE, |
603 | .open = dn_neigh_seq_open, | 603 | .open = dn_neigh_seq_open, |
604 | .read = seq_read, | 604 | .read = seq_read, |
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index efccc42ff1c6..c1b5502f195b 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -1751,7 +1751,7 @@ out_kfree: | |||
1751 | goto out; | 1751 | goto out; |
1752 | } | 1752 | } |
1753 | 1753 | ||
1754 | static struct file_operations dn_rt_cache_seq_fops = { | 1754 | static const struct file_operations dn_rt_cache_seq_fops = { |
1755 | .owner = THIS_MODULE, | 1755 | .owner = THIS_MODULE, |
1756 | .open = dn_rt_cache_seq_open, | 1756 | .open = dn_rt_cache_seq_open, |
1757 | .read = seq_read, | 1757 | .read = seq_read, |
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index a58afde4f72f..0ffd2d2920c3 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -1390,7 +1390,7 @@ out_kfree: | |||
1390 | goto out; | 1390 | goto out; |
1391 | } | 1391 | } |
1392 | 1392 | ||
1393 | static struct file_operations arp_seq_fops = { | 1393 | static const struct file_operations arp_seq_fops = { |
1394 | .owner = THIS_MODULE, | 1394 | .owner = THIS_MODULE, |
1395 | .open = arp_seq_open, | 1395 | .open = arp_seq_open, |
1396 | .read = seq_read, | 1396 | .read = seq_read, |
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index dea04d725b04..b21bb28d1fd0 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c | |||
@@ -1057,7 +1057,7 @@ out_kfree: | |||
1057 | goto out; | 1057 | goto out; |
1058 | } | 1058 | } |
1059 | 1059 | ||
1060 | static struct file_operations fib_seq_fops = { | 1060 | static const struct file_operations fib_seq_fops = { |
1061 | .owner = THIS_MODULE, | 1061 | .owner = THIS_MODULE, |
1062 | .open = fib_seq_open, | 1062 | .open = fib_seq_open, |
1063 | .read = seq_read, | 1063 | .read = seq_read, |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 004a437bd7b5..c33dca073801 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -2173,7 +2173,7 @@ static int fib_triestat_seq_open(struct inode *inode, struct file *file) | |||
2173 | return single_open(file, fib_triestat_seq_show, NULL); | 2173 | return single_open(file, fib_triestat_seq_show, NULL); |
2174 | } | 2174 | } |
2175 | 2175 | ||
2176 | static struct file_operations fib_triestat_fops = { | 2176 | static const struct file_operations fib_triestat_fops = { |
2177 | .owner = THIS_MODULE, | 2177 | .owner = THIS_MODULE, |
2178 | .open = fib_triestat_seq_open, | 2178 | .open = fib_triestat_seq_open, |
2179 | .read = seq_read, | 2179 | .read = seq_read, |
@@ -2364,7 +2364,7 @@ out_kfree: | |||
2364 | goto out; | 2364 | goto out; |
2365 | } | 2365 | } |
2366 | 2366 | ||
2367 | static struct file_operations fib_trie_fops = { | 2367 | static const struct file_operations fib_trie_fops = { |
2368 | .owner = THIS_MODULE, | 2368 | .owner = THIS_MODULE, |
2369 | .open = fib_trie_seq_open, | 2369 | .open = fib_trie_seq_open, |
2370 | .read = seq_read, | 2370 | .read = seq_read, |
@@ -2485,7 +2485,7 @@ out_kfree: | |||
2485 | goto out; | 2485 | goto out; |
2486 | } | 2486 | } |
2487 | 2487 | ||
2488 | static struct file_operations fib_route_fops = { | 2488 | static const struct file_operations fib_route_fops = { |
2489 | .owner = THIS_MODULE, | 2489 | .owner = THIS_MODULE, |
2490 | .open = fib_route_seq_open, | 2490 | .open = fib_route_seq_open, |
2491 | .read = seq_read, | 2491 | .read = seq_read, |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index b8e1625d34cf..063721302ebf 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -2403,7 +2403,7 @@ out_kfree: | |||
2403 | goto out; | 2403 | goto out; |
2404 | } | 2404 | } |
2405 | 2405 | ||
2406 | static struct file_operations igmp_mc_seq_fops = { | 2406 | static const struct file_operations igmp_mc_seq_fops = { |
2407 | .owner = THIS_MODULE, | 2407 | .owner = THIS_MODULE, |
2408 | .open = igmp_mc_seq_open, | 2408 | .open = igmp_mc_seq_open, |
2409 | .read = seq_read, | 2409 | .read = seq_read, |
@@ -2577,7 +2577,7 @@ out_kfree: | |||
2577 | goto out; | 2577 | goto out; |
2578 | } | 2578 | } |
2579 | 2579 | ||
2580 | static struct file_operations igmp_mcf_seq_fops = { | 2580 | static const struct file_operations igmp_mcf_seq_fops = { |
2581 | .owner = THIS_MODULE, | 2581 | .owner = THIS_MODULE, |
2582 | .open = igmp_mcf_seq_open, | 2582 | .open = igmp_mcf_seq_open, |
2583 | .read = seq_read, | 2583 | .read = seq_read, |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index ba882bec317a..cf49de1a4983 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -1200,7 +1200,7 @@ static int pnp_seq_open(struct inode *indoe, struct file *file) | |||
1200 | return single_open(file, pnp_seq_show, NULL); | 1200 | return single_open(file, pnp_seq_show, NULL); |
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | static struct file_operations pnp_seq_fops = { | 1203 | static const struct file_operations pnp_seq_fops = { |
1204 | .owner = THIS_MODULE, | 1204 | .owner = THIS_MODULE, |
1205 | .open = pnp_seq_open, | 1205 | .open = pnp_seq_open, |
1206 | .read = seq_read, | 1206 | .read = seq_read, |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 604f5b585104..e6d11abd7841 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1712,7 +1712,7 @@ out_kfree: | |||
1712 | 1712 | ||
1713 | } | 1713 | } |
1714 | 1714 | ||
1715 | static struct file_operations ipmr_vif_fops = { | 1715 | static const struct file_operations ipmr_vif_fops = { |
1716 | .owner = THIS_MODULE, | 1716 | .owner = THIS_MODULE, |
1717 | .open = ipmr_vif_open, | 1717 | .open = ipmr_vif_open, |
1718 | .read = seq_read, | 1718 | .read = seq_read, |
@@ -1874,7 +1874,7 @@ out_kfree: | |||
1874 | 1874 | ||
1875 | } | 1875 | } |
1876 | 1876 | ||
1877 | static struct file_operations ipmr_mfc_fops = { | 1877 | static const struct file_operations ipmr_mfc_fops = { |
1878 | .owner = THIS_MODULE, | 1878 | .owner = THIS_MODULE, |
1879 | .open = ipmr_mfc_open, | 1879 | .open = ipmr_mfc_open, |
1880 | .read = seq_read, | 1880 | .read = seq_read, |
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c index 6c40899aa161..22e104c6a493 100644 --- a/net/ipv4/ipvs/ip_vs_app.c +++ b/net/ipv4/ipvs/ip_vs_app.c | |||
@@ -561,7 +561,7 @@ static int ip_vs_app_open(struct inode *inode, struct file *file) | |||
561 | return seq_open(file, &ip_vs_app_seq_ops); | 561 | return seq_open(file, &ip_vs_app_seq_ops); |
562 | } | 562 | } |
563 | 563 | ||
564 | static struct file_operations ip_vs_app_fops = { | 564 | static const struct file_operations ip_vs_app_fops = { |
565 | .owner = THIS_MODULE, | 565 | .owner = THIS_MODULE, |
566 | .open = ip_vs_app_open, | 566 | .open = ip_vs_app_open, |
567 | .read = seq_read, | 567 | .read = seq_read, |
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index 0b5e03476ce4..7018f97c75dc 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c | |||
@@ -757,7 +757,7 @@ static int ip_vs_conn_open(struct inode *inode, struct file *file) | |||
757 | return seq_open(file, &ip_vs_conn_seq_ops); | 757 | return seq_open(file, &ip_vs_conn_seq_ops); |
758 | } | 758 | } |
759 | 759 | ||
760 | static struct file_operations ip_vs_conn_fops = { | 760 | static const struct file_operations ip_vs_conn_fops = { |
761 | .owner = THIS_MODULE, | 761 | .owner = THIS_MODULE, |
762 | .open = ip_vs_conn_open, | 762 | .open = ip_vs_conn_open, |
763 | .read = seq_read, | 763 | .read = seq_read, |
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index 9b933381ebbe..8b08d9cdcbc8 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c | |||
@@ -1812,7 +1812,7 @@ out_kfree: | |||
1812 | goto out; | 1812 | goto out; |
1813 | } | 1813 | } |
1814 | 1814 | ||
1815 | static struct file_operations ip_vs_info_fops = { | 1815 | static const struct file_operations ip_vs_info_fops = { |
1816 | .owner = THIS_MODULE, | 1816 | .owner = THIS_MODULE, |
1817 | .open = ip_vs_info_open, | 1817 | .open = ip_vs_info_open, |
1818 | .read = seq_read, | 1818 | .read = seq_read, |
@@ -1859,7 +1859,7 @@ static int ip_vs_stats_seq_open(struct inode *inode, struct file *file) | |||
1859 | return single_open(file, ip_vs_stats_show, NULL); | 1859 | return single_open(file, ip_vs_stats_show, NULL); |
1860 | } | 1860 | } |
1861 | 1861 | ||
1862 | static struct file_operations ip_vs_stats_fops = { | 1862 | static const struct file_operations ip_vs_stats_fops = { |
1863 | .owner = THIS_MODULE, | 1863 | .owner = THIS_MODULE, |
1864 | .open = ip_vs_stats_seq_open, | 1864 | .open = ip_vs_stats_seq_open, |
1865 | .read = seq_read, | 1865 | .read = seq_read, |
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c index 5903588fddce..300ccbbbdac9 100644 --- a/net/ipv4/netfilter/ip_conntrack_standalone.c +++ b/net/ipv4/netfilter/ip_conntrack_standalone.c | |||
@@ -222,7 +222,7 @@ out_free: | |||
222 | return ret; | 222 | return ret; |
223 | } | 223 | } |
224 | 224 | ||
225 | static struct file_operations ct_file_ops = { | 225 | static const struct file_operations ct_file_ops = { |
226 | .owner = THIS_MODULE, | 226 | .owner = THIS_MODULE, |
227 | .open = ct_open, | 227 | .open = ct_open, |
228 | .read = seq_read, | 228 | .read = seq_read, |
@@ -298,7 +298,7 @@ static int exp_open(struct inode *inode, struct file *file) | |||
298 | return seq_open(file, &exp_seq_ops); | 298 | return seq_open(file, &exp_seq_ops); |
299 | } | 299 | } |
300 | 300 | ||
301 | static struct file_operations exp_file_ops = { | 301 | static const struct file_operations exp_file_ops = { |
302 | .owner = THIS_MODULE, | 302 | .owner = THIS_MODULE, |
303 | .open = exp_open, | 303 | .open = exp_open, |
304 | .read = seq_read, | 304 | .read = seq_read, |
@@ -386,7 +386,7 @@ static int ct_cpu_seq_open(struct inode *inode, struct file *file) | |||
386 | return seq_open(file, &ct_cpu_seq_ops); | 386 | return seq_open(file, &ct_cpu_seq_ops); |
387 | } | 387 | } |
388 | 388 | ||
389 | static struct file_operations ct_cpu_seq_fops = { | 389 | static const struct file_operations ct_cpu_seq_fops = { |
390 | .owner = THIS_MODULE, | 390 | .owner = THIS_MODULE, |
391 | .open = ct_cpu_seq_open, | 391 | .open = ct_cpu_seq_open, |
392 | .read = seq_read, | 392 | .read = seq_read, |
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 4fe28f264475..e965b333c997 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -70,7 +70,7 @@ static LIST_HEAD(clusterip_configs); | |||
70 | static DEFINE_RWLOCK(clusterip_lock); | 70 | static DEFINE_RWLOCK(clusterip_lock); |
71 | 71 | ||
72 | #ifdef CONFIG_PROC_FS | 72 | #ifdef CONFIG_PROC_FS |
73 | static struct file_operations clusterip_proc_fops; | 73 | static const struct file_operations clusterip_proc_fops; |
74 | static struct proc_dir_entry *clusterip_procdir; | 74 | static struct proc_dir_entry *clusterip_procdir; |
75 | #endif | 75 | #endif |
76 | 76 | ||
@@ -715,7 +715,7 @@ static ssize_t clusterip_proc_write(struct file *file, const char __user *input, | |||
715 | return size; | 715 | return size; |
716 | } | 716 | } |
717 | 717 | ||
718 | static struct file_operations clusterip_proc_fops = { | 718 | static const struct file_operations clusterip_proc_fops = { |
719 | .owner = THIS_MODULE, | 719 | .owner = THIS_MODULE, |
720 | .open = clusterip_proc_open, | 720 | .open = clusterip_proc_open, |
721 | .read = seq_read, | 721 | .read = seq_read, |
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c index 6b97b6796173..aecb9c48e152 100644 --- a/net/ipv4/netfilter/ipt_recent.c +++ b/net/ipv4/netfilter/ipt_recent.c | |||
@@ -79,7 +79,7 @@ static DEFINE_MUTEX(recent_mutex); | |||
79 | 79 | ||
80 | #ifdef CONFIG_PROC_FS | 80 | #ifdef CONFIG_PROC_FS |
81 | static struct proc_dir_entry *proc_dir; | 81 | static struct proc_dir_entry *proc_dir; |
82 | static struct file_operations recent_fops; | 82 | static const struct file_operations recent_fops; |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | static u_int32_t hash_rnd; | 85 | static u_int32_t hash_rnd; |
@@ -454,7 +454,7 @@ static ssize_t recent_proc_write(struct file *file, const char __user *input, | |||
454 | return size; | 454 | return size; |
455 | } | 455 | } |
456 | 456 | ||
457 | static struct file_operations recent_fops = { | 457 | static const struct file_operations recent_fops = { |
458 | .open = recent_seq_open, | 458 | .open = recent_seq_open, |
459 | .read = seq_read, | 459 | .read = seq_read, |
460 | .write = recent_proc_write, | 460 | .write = recent_proc_write, |
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c index 14a93a738418..89f933e81035 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c | |||
@@ -197,7 +197,7 @@ out_free: | |||
197 | return ret; | 197 | return ret; |
198 | } | 198 | } |
199 | 199 | ||
200 | static struct file_operations ct_file_ops = { | 200 | static const struct file_operations ct_file_ops = { |
201 | .owner = THIS_MODULE, | 201 | .owner = THIS_MODULE, |
202 | .open = ct_open, | 202 | .open = ct_open, |
203 | .read = seq_read, | 203 | .read = seq_read, |
@@ -278,7 +278,7 @@ static int exp_open(struct inode *inode, struct file *file) | |||
278 | return seq_open(file, &exp_seq_ops); | 278 | return seq_open(file, &exp_seq_ops); |
279 | } | 279 | } |
280 | 280 | ||
281 | static struct file_operations ip_exp_file_ops = { | 281 | static const struct file_operations ip_exp_file_ops = { |
282 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
283 | .open = exp_open, | 283 | .open = exp_open, |
284 | .read = seq_read, | 284 | .read = seq_read, |
@@ -366,7 +366,7 @@ static int ct_cpu_seq_open(struct inode *inode, struct file *file) | |||
366 | return seq_open(file, &ct_cpu_seq_ops); | 366 | return seq_open(file, &ct_cpu_seq_ops); |
367 | } | 367 | } |
368 | 368 | ||
369 | static struct file_operations ct_cpu_seq_fops = { | 369 | static const struct file_operations ct_cpu_seq_fops = { |
370 | .owner = THIS_MODULE, | 370 | .owner = THIS_MODULE, |
371 | .open = ct_cpu_seq_open, | 371 | .open = ct_cpu_seq_open, |
372 | .read = seq_read, | 372 | .read = seq_read, |
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index ccb199e9dd8b..ae68a691e8cd 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
@@ -79,7 +79,7 @@ static int sockstat_seq_open(struct inode *inode, struct file *file) | |||
79 | return single_open(file, sockstat_seq_show, NULL); | 79 | return single_open(file, sockstat_seq_show, NULL); |
80 | } | 80 | } |
81 | 81 | ||
82 | static struct file_operations sockstat_seq_fops = { | 82 | static const struct file_operations sockstat_seq_fops = { |
83 | .owner = THIS_MODULE, | 83 | .owner = THIS_MODULE, |
84 | .open = sockstat_seq_open, | 84 | .open = sockstat_seq_open, |
85 | .read = seq_read, | 85 | .read = seq_read, |
@@ -326,7 +326,7 @@ static int snmp_seq_open(struct inode *inode, struct file *file) | |||
326 | return single_open(file, snmp_seq_show, NULL); | 326 | return single_open(file, snmp_seq_show, NULL); |
327 | } | 327 | } |
328 | 328 | ||
329 | static struct file_operations snmp_seq_fops = { | 329 | static const struct file_operations snmp_seq_fops = { |
330 | .owner = THIS_MODULE, | 330 | .owner = THIS_MODULE, |
331 | .open = snmp_seq_open, | 331 | .open = snmp_seq_open, |
332 | .read = seq_read, | 332 | .read = seq_read, |
@@ -360,7 +360,7 @@ static int netstat_seq_open(struct inode *inode, struct file *file) | |||
360 | return single_open(file, netstat_seq_show, NULL); | 360 | return single_open(file, netstat_seq_show, NULL); |
361 | } | 361 | } |
362 | 362 | ||
363 | static struct file_operations netstat_seq_fops = { | 363 | static const struct file_operations netstat_seq_fops = { |
364 | .owner = THIS_MODULE, | 364 | .owner = THIS_MODULE, |
365 | .open = netstat_seq_open, | 365 | .open = netstat_seq_open, |
366 | .read = seq_read, | 366 | .read = seq_read, |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 931084bfb572..87e9c1618100 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -916,7 +916,7 @@ out_kfree: | |||
916 | goto out; | 916 | goto out; |
917 | } | 917 | } |
918 | 918 | ||
919 | static struct file_operations raw_seq_fops = { | 919 | static const struct file_operations raw_seq_fops = { |
920 | .owner = THIS_MODULE, | 920 | .owner = THIS_MODULE, |
921 | .open = raw_seq_open, | 921 | .open = raw_seq_open, |
922 | .read = seq_read, | 922 | .read = seq_read, |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 5b3834b38a2d..9b5e56481d53 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -393,7 +393,7 @@ out_kfree: | |||
393 | goto out; | 393 | goto out; |
394 | } | 394 | } |
395 | 395 | ||
396 | static struct file_operations rt_cache_seq_fops = { | 396 | static const struct file_operations rt_cache_seq_fops = { |
397 | .owner = THIS_MODULE, | 397 | .owner = THIS_MODULE, |
398 | .open = rt_cache_seq_open, | 398 | .open = rt_cache_seq_open, |
399 | .read = seq_read, | 399 | .read = seq_read, |
@@ -484,7 +484,7 @@ static int rt_cpu_seq_open(struct inode *inode, struct file *file) | |||
484 | return seq_open(file, &rt_cpu_seq_ops); | 484 | return seq_open(file, &rt_cpu_seq_ops); |
485 | } | 485 | } |
486 | 486 | ||
487 | static struct file_operations rt_cpu_seq_fops = { | 487 | static const struct file_operations rt_cpu_seq_fops = { |
488 | .owner = THIS_MODULE, | 488 | .owner = THIS_MODULE, |
489 | .open = rt_cpu_seq_open, | 489 | .open = rt_cpu_seq_open, |
490 | .read = seq_read, | 490 | .read = seq_read, |
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c index 41c157848181..61f406f27294 100644 --- a/net/ipv4/tcp_probe.c +++ b/net/ipv4/tcp_probe.c | |||
@@ -143,7 +143,7 @@ out_free: | |||
143 | return error ? error : cnt; | 143 | return error ? error : cnt; |
144 | } | 144 | } |
145 | 145 | ||
146 | static struct file_operations tcpprobe_fops = { | 146 | static const struct file_operations tcpprobe_fops = { |
147 | .owner = THIS_MODULE, | 147 | .owner = THIS_MODULE, |
148 | .open = tcpprobe_open, | 148 | .open = tcpprobe_open, |
149 | .read = tcpprobe_read, | 149 | .read = tcpprobe_read, |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 77e56f2b1af2..ea0755b09033 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2776,7 +2776,7 @@ out_kfree: | |||
2776 | goto out; | 2776 | goto out; |
2777 | } | 2777 | } |
2778 | 2778 | ||
2779 | static struct file_operations if6_fops = { | 2779 | static const struct file_operations if6_fops = { |
2780 | .owner = THIS_MODULE, | 2780 | .owner = THIS_MODULE, |
2781 | .open = if6_seq_open, | 2781 | .open = if6_seq_open, |
2782 | .read = seq_read, | 2782 | .read = seq_read, |
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index e2dc1c41bbf5..6fb2e9d716c0 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
@@ -565,7 +565,7 @@ out_kfree: | |||
565 | goto out; | 565 | goto out; |
566 | } | 566 | } |
567 | 567 | ||
568 | static struct file_operations ac6_seq_fops = { | 568 | static const struct file_operations ac6_seq_fops = { |
569 | .owner = THIS_MODULE, | 569 | .owner = THIS_MODULE, |
570 | .open = ac6_seq_open, | 570 | .open = ac6_seq_open, |
571 | .read = seq_read, | 571 | .read = seq_read, |
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 1551ab3890a3..c206a152ed9d 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
@@ -677,7 +677,7 @@ out_kfree: | |||
677 | goto out; | 677 | goto out; |
678 | } | 678 | } |
679 | 679 | ||
680 | static struct file_operations ip6fl_seq_fops = { | 680 | static const struct file_operations ip6fl_seq_fops = { |
681 | .owner = THIS_MODULE, | 681 | .owner = THIS_MODULE, |
682 | .open = ip6fl_seq_open, | 682 | .open = ip6fl_seq_open, |
683 | .read = seq_read, | 683 | .read = seq_read, |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index c9db5bc5b0f9..a8d6625ec782 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -2451,7 +2451,7 @@ out_kfree: | |||
2451 | goto out; | 2451 | goto out; |
2452 | } | 2452 | } |
2453 | 2453 | ||
2454 | static struct file_operations igmp6_mc_seq_fops = { | 2454 | static const struct file_operations igmp6_mc_seq_fops = { |
2455 | .owner = THIS_MODULE, | 2455 | .owner = THIS_MODULE, |
2456 | .open = igmp6_mc_seq_open, | 2456 | .open = igmp6_mc_seq_open, |
2457 | .read = seq_read, | 2457 | .read = seq_read, |
@@ -2625,7 +2625,7 @@ out_kfree: | |||
2625 | goto out; | 2625 | goto out; |
2626 | } | 2626 | } |
2627 | 2627 | ||
2628 | static struct file_operations igmp6_mcf_seq_fops = { | 2628 | static const struct file_operations igmp6_mcf_seq_fops = { |
2629 | .owner = THIS_MODULE, | 2629 | .owner = THIS_MODULE, |
2630 | .open = igmp6_mcf_seq_open, | 2630 | .open = igmp6_mcf_seq_open, |
2631 | .read = seq_read, | 2631 | .read = seq_read, |
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 032ef95c5b00..c82257dd04b6 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -187,7 +187,7 @@ static int sockstat6_seq_open(struct inode *inode, struct file *file) | |||
187 | return single_open(file, sockstat6_seq_show, NULL); | 187 | return single_open(file, sockstat6_seq_show, NULL); |
188 | } | 188 | } |
189 | 189 | ||
190 | static struct file_operations sockstat6_seq_fops = { | 190 | static const struct file_operations sockstat6_seq_fops = { |
191 | .owner = THIS_MODULE, | 191 | .owner = THIS_MODULE, |
192 | .open = sockstat6_seq_open, | 192 | .open = sockstat6_seq_open, |
193 | .read = seq_read, | 193 | .read = seq_read, |
@@ -200,7 +200,7 @@ static int snmp6_seq_open(struct inode *inode, struct file *file) | |||
200 | return single_open(file, snmp6_seq_show, PDE(inode)->data); | 200 | return single_open(file, snmp6_seq_show, PDE(inode)->data); |
201 | } | 201 | } |
202 | 202 | ||
203 | static struct file_operations snmp6_seq_fops = { | 203 | static const struct file_operations snmp6_seq_fops = { |
204 | .owner = THIS_MODULE, | 204 | .owner = THIS_MODULE, |
205 | .open = snmp6_seq_open, | 205 | .open = snmp6_seq_open, |
206 | .read = seq_read, | 206 | .read = seq_read, |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 16d4c63ff554..1f8f6275a7e4 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -1273,7 +1273,7 @@ out_kfree: | |||
1273 | goto out; | 1273 | goto out; |
1274 | } | 1274 | } |
1275 | 1275 | ||
1276 | static struct file_operations raw6_seq_fops = { | 1276 | static const struct file_operations raw6_seq_fops = { |
1277 | .owner = THIS_MODULE, | 1277 | .owner = THIS_MODULE, |
1278 | .open = raw6_seq_open, | 1278 | .open = raw6_seq_open, |
1279 | .read = seq_read, | 1279 | .read = seq_read, |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index a415ac610e2d..0e1f4b2cd3dd 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2345,7 +2345,7 @@ static int rt6_stats_seq_open(struct inode *inode, struct file *file) | |||
2345 | return single_open(file, rt6_stats_seq_show, NULL); | 2345 | return single_open(file, rt6_stats_seq_show, NULL); |
2346 | } | 2346 | } |
2347 | 2347 | ||
2348 | static struct file_operations rt6_stats_seq_fops = { | 2348 | static const struct file_operations rt6_stats_seq_fops = { |
2349 | .owner = THIS_MODULE, | 2349 | .owner = THIS_MODULE, |
2350 | .open = rt6_stats_seq_open, | 2350 | .open = rt6_stats_seq_open, |
2351 | .read = seq_read, | 2351 | .read = seq_read, |
diff --git a/net/ipx/ipx_proc.c b/net/ipx/ipx_proc.c index 811e4badce81..db32ac8e79bd 100644 --- a/net/ipx/ipx_proc.c +++ b/net/ipx/ipx_proc.c | |||
@@ -322,7 +322,7 @@ static int ipx_seq_socket_open(struct inode *inode, struct file *file) | |||
322 | return seq_open(file, &ipx_seq_socket_ops); | 322 | return seq_open(file, &ipx_seq_socket_ops); |
323 | } | 323 | } |
324 | 324 | ||
325 | static struct file_operations ipx_seq_interface_fops = { | 325 | static const struct file_operations ipx_seq_interface_fops = { |
326 | .owner = THIS_MODULE, | 326 | .owner = THIS_MODULE, |
327 | .open = ipx_seq_interface_open, | 327 | .open = ipx_seq_interface_open, |
328 | .read = seq_read, | 328 | .read = seq_read, |
@@ -330,7 +330,7 @@ static struct file_operations ipx_seq_interface_fops = { | |||
330 | .release = seq_release, | 330 | .release = seq_release, |
331 | }; | 331 | }; |
332 | 332 | ||
333 | static struct file_operations ipx_seq_route_fops = { | 333 | static const struct file_operations ipx_seq_route_fops = { |
334 | .owner = THIS_MODULE, | 334 | .owner = THIS_MODULE, |
335 | .open = ipx_seq_route_open, | 335 | .open = ipx_seq_route_open, |
336 | .read = seq_read, | 336 | .read = seq_read, |
@@ -338,7 +338,7 @@ static struct file_operations ipx_seq_route_fops = { | |||
338 | .release = seq_release, | 338 | .release = seq_release, |
339 | }; | 339 | }; |
340 | 340 | ||
341 | static struct file_operations ipx_seq_socket_fops = { | 341 | static const struct file_operations ipx_seq_socket_fops = { |
342 | .owner = THIS_MODULE, | 342 | .owner = THIS_MODULE, |
343 | .open = ipx_seq_socket_open, | 343 | .open = ipx_seq_socket_open, |
344 | .read = seq_read, | 344 | .read = seq_read, |
diff --git a/net/irda/discovery.c b/net/irda/discovery.c index 789478bc3009..f09734128674 100644 --- a/net/irda/discovery.c +++ b/net/irda/discovery.c | |||
@@ -409,7 +409,7 @@ static int discovery_seq_open(struct inode *inode, struct file *file) | |||
409 | return seq_open(file, &discovery_seq_ops); | 409 | return seq_open(file, &discovery_seq_ops); |
410 | } | 410 | } |
411 | 411 | ||
412 | struct file_operations discovery_seq_fops = { | 412 | const struct file_operations discovery_seq_fops = { |
413 | .owner = THIS_MODULE, | 413 | .owner = THIS_MODULE, |
414 | .open = discovery_seq_open, | 414 | .open = discovery_seq_open, |
415 | .read = seq_read, | 415 | .read = seq_read, |
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index c28ee7bce26a..ec40715dcdda 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c | |||
@@ -56,7 +56,7 @@ static void ircomm_control_indication(struct ircomm_cb *self, | |||
56 | extern struct proc_dir_entry *proc_irda; | 56 | extern struct proc_dir_entry *proc_irda; |
57 | static int ircomm_seq_open(struct inode *, struct file *); | 57 | static int ircomm_seq_open(struct inode *, struct file *); |
58 | 58 | ||
59 | static struct file_operations ircomm_proc_fops = { | 59 | static const struct file_operations ircomm_proc_fops = { |
60 | .owner = THIS_MODULE, | 60 | .owner = THIS_MODULE, |
61 | .open = ircomm_seq_open, | 61 | .open = ircomm_seq_open, |
62 | .read = seq_read, | 62 | .read = seq_read, |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 98b0fa965790..915d9384f36a 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
@@ -1080,7 +1080,7 @@ static int irias_seq_open(struct inode *inode, struct file *file) | |||
1080 | return seq_open(file, &irias_seq_ops); | 1080 | return seq_open(file, &irias_seq_ops); |
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | struct file_operations irias_seq_fops = { | 1083 | const struct file_operations irias_seq_fops = { |
1084 | .owner = THIS_MODULE, | 1084 | .owner = THIS_MODULE, |
1085 | .open = irias_seq_open, | 1085 | .open = irias_seq_open, |
1086 | .read = seq_read, | 1086 | .read = seq_read, |
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index 9c3dc57ff746..fcf9d6599628 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
@@ -93,7 +93,7 @@ extern struct proc_dir_entry *proc_irda; | |||
93 | 93 | ||
94 | static int irlan_seq_open(struct inode *inode, struct file *file); | 94 | static int irlan_seq_open(struct inode *inode, struct file *file); |
95 | 95 | ||
96 | static struct file_operations irlan_fops = { | 96 | static const struct file_operations irlan_fops = { |
97 | .owner = THIS_MODULE, | 97 | .owner = THIS_MODULE, |
98 | .open = irlan_seq_open, | 98 | .open = irlan_seq_open, |
99 | .read = seq_read, | 99 | .read = seq_read, |
diff --git a/net/irda/irlap.c b/net/irda/irlap.c index fd73e4af715a..d93ebd11431e 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c | |||
@@ -1244,7 +1244,7 @@ out_kfree: | |||
1244 | goto out; | 1244 | goto out; |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | struct file_operations irlap_seq_fops = { | 1247 | const struct file_operations irlap_seq_fops = { |
1248 | .owner = THIS_MODULE, | 1248 | .owner = THIS_MODULE, |
1249 | .open = irlap_seq_open, | 1249 | .open = irlap_seq_open, |
1250 | .read = seq_read, | 1250 | .read = seq_read, |
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index b134c3cf2bdb..9df0461b6d18 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c | |||
@@ -2026,7 +2026,7 @@ out_kfree: | |||
2026 | goto out; | 2026 | goto out; |
2027 | } | 2027 | } |
2028 | 2028 | ||
2029 | struct file_operations irlmp_seq_fops = { | 2029 | const struct file_operations irlmp_seq_fops = { |
2030 | .owner = THIS_MODULE, | 2030 | .owner = THIS_MODULE, |
2031 | .open = irlmp_seq_open, | 2031 | .open = irlmp_seq_open, |
2032 | .read = seq_read, | 2032 | .read = seq_read, |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 68836358fdf2..a7486b3bddcb 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
@@ -1895,7 +1895,7 @@ out_kfree: | |||
1895 | goto out; | 1895 | goto out; |
1896 | } | 1896 | } |
1897 | 1897 | ||
1898 | struct file_operations irttp_seq_fops = { | 1898 | const struct file_operations irttp_seq_fops = { |
1899 | .owner = THIS_MODULE, | 1899 | .owner = THIS_MODULE, |
1900 | .open = irttp_seq_open, | 1900 | .open = irttp_seq_open, |
1901 | .read = seq_read, | 1901 | .read = seq_read, |
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c index dcfe6c739471..3ab9d9f8b17f 100644 --- a/net/llc/llc_proc.c +++ b/net/llc/llc_proc.c | |||
@@ -208,7 +208,7 @@ static int llc_seq_core_open(struct inode *inode, struct file *file) | |||
208 | return seq_open(file, &llc_seq_core_ops); | 208 | return seq_open(file, &llc_seq_core_ops); |
209 | } | 209 | } |
210 | 210 | ||
211 | static struct file_operations llc_seq_socket_fops = { | 211 | static const struct file_operations llc_seq_socket_fops = { |
212 | .owner = THIS_MODULE, | 212 | .owner = THIS_MODULE, |
213 | .open = llc_seq_socket_open, | 213 | .open = llc_seq_socket_open, |
214 | .read = seq_read, | 214 | .read = seq_read, |
@@ -216,7 +216,7 @@ static struct file_operations llc_seq_socket_fops = { | |||
216 | .release = seq_release, | 216 | .release = seq_release, |
217 | }; | 217 | }; |
218 | 218 | ||
219 | static struct file_operations llc_seq_core_fops = { | 219 | static const struct file_operations llc_seq_core_fops = { |
220 | .owner = THIS_MODULE, | 220 | .owner = THIS_MODULE, |
221 | .open = llc_seq_core_open, | 221 | .open = llc_seq_core_open, |
222 | .read = seq_read, | 222 | .read = seq_read, |
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c index 9cbf926cdd14..5cdcd7f4e813 100644 --- a/net/netfilter/nf_conntrack_expect.c +++ b/net/netfilter/nf_conntrack_expect.c | |||
@@ -435,7 +435,7 @@ static int exp_open(struct inode *inode, struct file *file) | |||
435 | return seq_open(file, &exp_seq_ops); | 435 | return seq_open(file, &exp_seq_ops); |
436 | } | 436 | } |
437 | 437 | ||
438 | struct file_operations exp_file_ops = { | 438 | const struct file_operations exp_file_ops = { |
439 | .owner = THIS_MODULE, | 439 | .owner = THIS_MODULE, |
440 | .open = exp_open, | 440 | .open = exp_open, |
441 | .read = seq_read, | 441 | .read = seq_read, |
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index f1cb60ff9319..04ac12431db7 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c | |||
@@ -229,7 +229,7 @@ out_free: | |||
229 | return ret; | 229 | return ret; |
230 | } | 230 | } |
231 | 231 | ||
232 | static struct file_operations ct_file_ops = { | 232 | static const struct file_operations ct_file_ops = { |
233 | .owner = THIS_MODULE, | 233 | .owner = THIS_MODULE, |
234 | .open = ct_open, | 234 | .open = ct_open, |
235 | .read = seq_read, | 235 | .read = seq_read, |
@@ -317,7 +317,7 @@ static int ct_cpu_seq_open(struct inode *inode, struct file *file) | |||
317 | return seq_open(file, &ct_cpu_seq_ops); | 317 | return seq_open(file, &ct_cpu_seq_ops); |
318 | } | 318 | } |
319 | 319 | ||
320 | static struct file_operations ct_cpu_seq_fops = { | 320 | static const struct file_operations ct_cpu_seq_fops = { |
321 | .owner = THIS_MODULE, | 321 | .owner = THIS_MODULE, |
322 | .open = ct_cpu_seq_open, | 322 | .open = ct_cpu_seq_open, |
323 | .read = seq_read, | 323 | .read = seq_read, |
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index 8901b3a07f7e..07e28e089616 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
@@ -151,7 +151,7 @@ static int nflog_open(struct inode *inode, struct file *file) | |||
151 | return seq_open(file, &nflog_seq_ops); | 151 | return seq_open(file, &nflog_seq_ops); |
152 | } | 152 | } |
153 | 153 | ||
154 | static struct file_operations nflog_file_ops = { | 154 | static const struct file_operations nflog_file_ops = { |
155 | .owner = THIS_MODULE, | 155 | .owner = THIS_MODULE, |
156 | .open = nflog_open, | 156 | .open = nflog_open, |
157 | .read = seq_read, | 157 | .read = seq_read, |
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index 4d8936ed581d..e136fea1db22 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c | |||
@@ -331,7 +331,7 @@ static int nfqueue_open(struct inode *inode, struct file *file) | |||
331 | return seq_open(file, &nfqueue_seq_ops); | 331 | return seq_open(file, &nfqueue_seq_ops); |
332 | } | 332 | } |
333 | 333 | ||
334 | static struct file_operations nfqueue_file_ops = { | 334 | static const struct file_operations nfqueue_file_ops = { |
335 | .owner = THIS_MODULE, | 335 | .owner = THIS_MODULE, |
336 | .open = nfqueue_open, | 336 | .open = nfqueue_open, |
337 | .read = seq_read, | 337 | .read = seq_read, |
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index d1505dd25c66..c47e7e2ba642 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -1025,7 +1025,7 @@ out_free: | |||
1025 | return ret; | 1025 | return ret; |
1026 | } | 1026 | } |
1027 | 1027 | ||
1028 | static struct file_operations nful_file_ops = { | 1028 | static const struct file_operations nful_file_ops = { |
1029 | .owner = THIS_MODULE, | 1029 | .owner = THIS_MODULE, |
1030 | .open = nful_open, | 1030 | .open = nful_open, |
1031 | .read = seq_read, | 1031 | .read = seq_read, |
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index a88a017da22c..99e516eca41a 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
@@ -1077,7 +1077,7 @@ out_free: | |||
1077 | return ret; | 1077 | return ret; |
1078 | } | 1078 | } |
1079 | 1079 | ||
1080 | static struct file_operations nfqnl_file_ops = { | 1080 | static const struct file_operations nfqnl_file_ops = { |
1081 | .owner = THIS_MODULE, | 1081 | .owner = THIS_MODULE, |
1082 | .open = nfqnl_open, | 1082 | .open = nfqnl_open, |
1083 | .read = seq_read, | 1083 | .read = seq_read, |
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 8996584b8499..134cc88f8c83 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -772,7 +772,7 @@ static int xt_tgt_open(struct inode *inode, struct file *file) | |||
772 | return ret; | 772 | return ret; |
773 | } | 773 | } |
774 | 774 | ||
775 | static struct file_operations xt_file_ops = { | 775 | static const struct file_operations xt_file_ops = { |
776 | .owner = THIS_MODULE, | 776 | .owner = THIS_MODULE, |
777 | .open = xt_tgt_open, | 777 | .open = xt_tgt_open, |
778 | .read = seq_read, | 778 | .read = seq_read, |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index bd1f7a2048d6..269a1e793478 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -37,7 +37,7 @@ MODULE_ALIAS("ip6t_hashlimit"); | |||
37 | /* need to declare this at the top */ | 37 | /* need to declare this at the top */ |
38 | static struct proc_dir_entry *hashlimit_procdir4; | 38 | static struct proc_dir_entry *hashlimit_procdir4; |
39 | static struct proc_dir_entry *hashlimit_procdir6; | 39 | static struct proc_dir_entry *hashlimit_procdir6; |
40 | static struct file_operations dl_file_ops; | 40 | static const struct file_operations dl_file_ops; |
41 | 41 | ||
42 | /* hash table crap */ | 42 | /* hash table crap */ |
43 | struct dsthash_dst { | 43 | struct dsthash_dst { |
@@ -714,7 +714,7 @@ static int dl_proc_open(struct inode *inode, struct file *file) | |||
714 | return ret; | 714 | return ret; |
715 | } | 715 | } |
716 | 716 | ||
717 | static struct file_operations dl_file_ops = { | 717 | static const struct file_operations dl_file_ops = { |
718 | .owner = THIS_MODULE, | 718 | .owner = THIS_MODULE, |
719 | .open = dl_proc_open, | 719 | .open = dl_proc_open, |
720 | .read = seq_read, | 720 | .read = seq_read, |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index f6ee9b47428b..e73d8f546c6b 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1713,7 +1713,7 @@ static int netlink_seq_open(struct inode *inode, struct file *file) | |||
1713 | return 0; | 1713 | return 0; |
1714 | } | 1714 | } |
1715 | 1715 | ||
1716 | static struct file_operations netlink_seq_fops = { | 1716 | static const struct file_operations netlink_seq_fops = { |
1717 | .owner = THIS_MODULE, | 1717 | .owner = THIS_MODULE, |
1718 | .open = netlink_seq_open, | 1718 | .open = netlink_seq_open, |
1719 | .read = seq_read, | 1719 | .read = seq_read, |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 799b76806bc3..bf9837dd95c4 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -1335,7 +1335,7 @@ static int nr_info_open(struct inode *inode, struct file *file) | |||
1335 | return seq_open(file, &nr_info_seqops); | 1335 | return seq_open(file, &nr_info_seqops); |
1336 | } | 1336 | } |
1337 | 1337 | ||
1338 | static struct file_operations nr_info_fops = { | 1338 | static const struct file_operations nr_info_fops = { |
1339 | .owner = THIS_MODULE, | 1339 | .owner = THIS_MODULE, |
1340 | .open = nr_info_open, | 1340 | .open = nr_info_open, |
1341 | .read = seq_read, | 1341 | .read = seq_read, |
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index e9909aeb43e9..c2fbac9c69ce 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c | |||
@@ -934,7 +934,7 @@ static int nr_node_info_open(struct inode *inode, struct file *file) | |||
934 | return seq_open(file, &nr_node_seqops); | 934 | return seq_open(file, &nr_node_seqops); |
935 | } | 935 | } |
936 | 936 | ||
937 | struct file_operations nr_nodes_fops = { | 937 | const struct file_operations nr_nodes_fops = { |
938 | .owner = THIS_MODULE, | 938 | .owner = THIS_MODULE, |
939 | .open = nr_node_info_open, | 939 | .open = nr_node_info_open, |
940 | .read = seq_read, | 940 | .read = seq_read, |
@@ -1018,7 +1018,7 @@ static int nr_neigh_info_open(struct inode *inode, struct file *file) | |||
1018 | return seq_open(file, &nr_neigh_seqops); | 1018 | return seq_open(file, &nr_neigh_seqops); |
1019 | } | 1019 | } |
1020 | 1020 | ||
1021 | struct file_operations nr_neigh_fops = { | 1021 | const struct file_operations nr_neigh_fops = { |
1022 | .owner = THIS_MODULE, | 1022 | .owner = THIS_MODULE, |
1023 | .open = nr_neigh_info_open, | 1023 | .open = nr_neigh_info_open, |
1024 | .read = seq_read, | 1024 | .read = seq_read, |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 444550917bc1..15ff7b15e211 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -1952,7 +1952,7 @@ static int packet_seq_open(struct inode *inode, struct file *file) | |||
1952 | return seq_open(file, &packet_seq_ops); | 1952 | return seq_open(file, &packet_seq_ops); |
1953 | } | 1953 | } |
1954 | 1954 | ||
1955 | static struct file_operations packet_seq_fops = { | 1955 | static const struct file_operations packet_seq_fops = { |
1956 | .owner = THIS_MODULE, | 1956 | .owner = THIS_MODULE, |
1957 | .open = packet_seq_open, | 1957 | .open = packet_seq_open, |
1958 | .read = seq_read, | 1958 | .read = seq_read, |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 7a81a8ee8544..8c34f1ca6c8c 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -1440,7 +1440,7 @@ static int rose_info_open(struct inode *inode, struct file *file) | |||
1440 | return seq_open(file, &rose_info_seqops); | 1440 | return seq_open(file, &rose_info_seqops); |
1441 | } | 1441 | } |
1442 | 1442 | ||
1443 | static struct file_operations rose_info_fops = { | 1443 | static const struct file_operations rose_info_fops = { |
1444 | .owner = THIS_MODULE, | 1444 | .owner = THIS_MODULE, |
1445 | .open = rose_info_open, | 1445 | .open = rose_info_open, |
1446 | .read = seq_read, | 1446 | .read = seq_read, |
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c index 0dcca4289eeb..1ddf7f5fa6db 100644 --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c | |||
@@ -1129,7 +1129,7 @@ static int rose_nodes_open(struct inode *inode, struct file *file) | |||
1129 | return seq_open(file, &rose_node_seqops); | 1129 | return seq_open(file, &rose_node_seqops); |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | struct file_operations rose_nodes_fops = { | 1132 | const struct file_operations rose_nodes_fops = { |
1133 | .owner = THIS_MODULE, | 1133 | .owner = THIS_MODULE, |
1134 | .open = rose_nodes_open, | 1134 | .open = rose_nodes_open, |
1135 | .read = seq_read, | 1135 | .read = seq_read, |
@@ -1211,7 +1211,7 @@ static int rose_neigh_open(struct inode *inode, struct file *file) | |||
1211 | return seq_open(file, &rose_neigh_seqops); | 1211 | return seq_open(file, &rose_neigh_seqops); |
1212 | } | 1212 | } |
1213 | 1213 | ||
1214 | struct file_operations rose_neigh_fops = { | 1214 | const struct file_operations rose_neigh_fops = { |
1215 | .owner = THIS_MODULE, | 1215 | .owner = THIS_MODULE, |
1216 | .open = rose_neigh_open, | 1216 | .open = rose_neigh_open, |
1217 | .read = seq_read, | 1217 | .read = seq_read, |
@@ -1295,7 +1295,7 @@ static int rose_route_open(struct inode *inode, struct file *file) | |||
1295 | return seq_open(file, &rose_route_seqops); | 1295 | return seq_open(file, &rose_route_seqops); |
1296 | } | 1296 | } |
1297 | 1297 | ||
1298 | struct file_operations rose_routes_fops = { | 1298 | const struct file_operations rose_routes_fops = { |
1299 | .owner = THIS_MODULE, | 1299 | .owner = THIS_MODULE, |
1300 | .open = rose_route_open, | 1300 | .open = rose_route_open, |
1301 | .read = seq_read, | 1301 | .read = seq_read, |
diff --git a/net/rxrpc/proc.c b/net/rxrpc/proc.c index 29975d99d864..8551c879e456 100644 --- a/net/rxrpc/proc.c +++ b/net/rxrpc/proc.c | |||
@@ -37,7 +37,7 @@ static struct seq_operations rxrpc_proc_transports_ops = { | |||
37 | .show = rxrpc_proc_transports_show, | 37 | .show = rxrpc_proc_transports_show, |
38 | }; | 38 | }; |
39 | 39 | ||
40 | static struct file_operations rxrpc_proc_transports_fops = { | 40 | static const struct file_operations rxrpc_proc_transports_fops = { |
41 | .open = rxrpc_proc_transports_open, | 41 | .open = rxrpc_proc_transports_open, |
42 | .read = seq_read, | 42 | .read = seq_read, |
43 | .llseek = seq_lseek, | 43 | .llseek = seq_lseek, |
@@ -57,7 +57,7 @@ static struct seq_operations rxrpc_proc_peers_ops = { | |||
57 | .show = rxrpc_proc_peers_show, | 57 | .show = rxrpc_proc_peers_show, |
58 | }; | 58 | }; |
59 | 59 | ||
60 | static struct file_operations rxrpc_proc_peers_fops = { | 60 | static const struct file_operations rxrpc_proc_peers_fops = { |
61 | .open = rxrpc_proc_peers_open, | 61 | .open = rxrpc_proc_peers_open, |
62 | .read = seq_read, | 62 | .read = seq_read, |
63 | .llseek = seq_lseek, | 63 | .llseek = seq_lseek, |
@@ -77,7 +77,7 @@ static struct seq_operations rxrpc_proc_conns_ops = { | |||
77 | .show = rxrpc_proc_conns_show, | 77 | .show = rxrpc_proc_conns_show, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | static struct file_operations rxrpc_proc_conns_fops = { | 80 | static const struct file_operations rxrpc_proc_conns_fops = { |
81 | .open = rxrpc_proc_conns_open, | 81 | .open = rxrpc_proc_conns_open, |
82 | .read = seq_read, | 82 | .read = seq_read, |
83 | .llseek = seq_lseek, | 83 | .llseek = seq_lseek, |
@@ -97,7 +97,7 @@ static struct seq_operations rxrpc_proc_calls_ops = { | |||
97 | .show = rxrpc_proc_calls_show, | 97 | .show = rxrpc_proc_calls_show, |
98 | }; | 98 | }; |
99 | 99 | ||
100 | static struct file_operations rxrpc_proc_calls_fops = { | 100 | static const struct file_operations rxrpc_proc_calls_fops = { |
101 | .open = rxrpc_proc_calls_open, | 101 | .open = rxrpc_proc_calls_open, |
102 | .read = seq_read, | 102 | .read = seq_read, |
103 | .llseek = seq_lseek, | 103 | .llseek = seq_lseek, |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 60b92fcdc8bb..4158127bc202 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -1194,7 +1194,7 @@ static int psched_open(struct inode *inode, struct file *file) | |||
1194 | return single_open(file, psched_show, PDE(inode)->data); | 1194 | return single_open(file, psched_show, PDE(inode)->data); |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | static struct file_operations psched_fops = { | 1197 | static const struct file_operations psched_fops = { |
1198 | .owner = THIS_MODULE, | 1198 | .owner = THIS_MODULE, |
1199 | .open = psched_open, | 1199 | .open = psched_open, |
1200 | .read = seq_read, | 1200 | .read = seq_read, |
diff --git a/net/sctp/proc.c b/net/sctp/proc.c index e93fc1cc430a..2f12bf2d8d3c 100644 --- a/net/sctp/proc.c +++ b/net/sctp/proc.c | |||
@@ -114,7 +114,7 @@ static int sctp_snmp_seq_open(struct inode *inode, struct file *file) | |||
114 | return single_open(file, sctp_snmp_seq_show, NULL); | 114 | return single_open(file, sctp_snmp_seq_show, NULL); |
115 | } | 115 | } |
116 | 116 | ||
117 | static struct file_operations sctp_snmp_seq_fops = { | 117 | static const struct file_operations sctp_snmp_seq_fops = { |
118 | .owner = THIS_MODULE, | 118 | .owner = THIS_MODULE, |
119 | .open = sctp_snmp_seq_open, | 119 | .open = sctp_snmp_seq_open, |
120 | .read = seq_read, | 120 | .read = seq_read, |
@@ -264,7 +264,7 @@ static int sctp_eps_seq_open(struct inode *inode, struct file *file) | |||
264 | return seq_open(file, &sctp_eps_ops); | 264 | return seq_open(file, &sctp_eps_ops); |
265 | } | 265 | } |
266 | 266 | ||
267 | static struct file_operations sctp_eps_seq_fops = { | 267 | static const struct file_operations sctp_eps_seq_fops = { |
268 | .open = sctp_eps_seq_open, | 268 | .open = sctp_eps_seq_open, |
269 | .read = seq_read, | 269 | .read = seq_read, |
270 | .llseek = seq_lseek, | 270 | .llseek = seq_lseek, |
@@ -374,7 +374,7 @@ static int sctp_assocs_seq_open(struct inode *inode, struct file *file) | |||
374 | return seq_open(file, &sctp_assoc_ops); | 374 | return seq_open(file, &sctp_assoc_ops); |
375 | } | 375 | } |
376 | 376 | ||
377 | static struct file_operations sctp_assocs_seq_fops = { | 377 | static const struct file_operations sctp_assocs_seq_fops = { |
378 | .open = sctp_assocs_seq_open, | 378 | .open = sctp_assocs_seq_open, |
379 | .read = seq_read, | 379 | .read = seq_read, |
380 | .llseek = seq_lseek, | 380 | .llseek = seq_lseek, |
diff --git a/net/socket.c b/net/socket.c index a92f59580234..0778c5442411 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -117,7 +117,7 @@ static ssize_t sock_sendpage(struct file *file, struct page *page, | |||
117 | * in the operation structures but are done directly via the socketcall() multiplexor. | 117 | * in the operation structures but are done directly via the socketcall() multiplexor. |
118 | */ | 118 | */ |
119 | 119 | ||
120 | static struct file_operations socket_file_ops = { | 120 | static const struct file_operations socket_file_ops = { |
121 | .owner = THIS_MODULE, | 121 | .owner = THIS_MODULE, |
122 | .llseek = no_llseek, | 122 | .llseek = no_llseek, |
123 | .aio_read = sock_aio_read, | 123 | .aio_read = sock_aio_read, |
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index c80df455802d..8612044b9189 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
@@ -282,9 +282,9 @@ static DEFINE_SPINLOCK(cache_list_lock); | |||
282 | static struct cache_detail *current_detail; | 282 | static struct cache_detail *current_detail; |
283 | static int current_index; | 283 | static int current_index; |
284 | 284 | ||
285 | static struct file_operations cache_file_operations; | 285 | static const struct file_operations cache_file_operations; |
286 | static struct file_operations content_file_operations; | 286 | static const struct file_operations content_file_operations; |
287 | static struct file_operations cache_flush_operations; | 287 | static const struct file_operations cache_flush_operations; |
288 | 288 | ||
289 | static void do_cache_clean(struct work_struct *work); | 289 | static void do_cache_clean(struct work_struct *work); |
290 | static DECLARE_DELAYED_WORK(cache_cleaner, do_cache_clean); | 290 | static DECLARE_DELAYED_WORK(cache_cleaner, do_cache_clean); |
@@ -887,7 +887,7 @@ cache_release(struct inode *inode, struct file *filp) | |||
887 | 887 | ||
888 | 888 | ||
889 | 889 | ||
890 | static struct file_operations cache_file_operations = { | 890 | static const struct file_operations cache_file_operations = { |
891 | .owner = THIS_MODULE, | 891 | .owner = THIS_MODULE, |
892 | .llseek = no_llseek, | 892 | .llseek = no_llseek, |
893 | .read = cache_read, | 893 | .read = cache_read, |
@@ -1245,7 +1245,7 @@ static int content_release(struct inode *inode, struct file *file) | |||
1245 | return seq_release(inode, file); | 1245 | return seq_release(inode, file); |
1246 | } | 1246 | } |
1247 | 1247 | ||
1248 | static struct file_operations content_file_operations = { | 1248 | static const struct file_operations content_file_operations = { |
1249 | .open = content_open, | 1249 | .open = content_open, |
1250 | .read = seq_read, | 1250 | .read = seq_read, |
1251 | .llseek = seq_lseek, | 1251 | .llseek = seq_lseek, |
@@ -1297,7 +1297,7 @@ static ssize_t write_flush(struct file * file, const char __user * buf, | |||
1297 | return count; | 1297 | return count; |
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | static struct file_operations cache_flush_operations = { | 1300 | static const struct file_operations cache_flush_operations = { |
1301 | .open = nonseekable_open, | 1301 | .open = nonseekable_open, |
1302 | .read = read_flush, | 1302 | .read = read_flush, |
1303 | .write = write_flush, | 1303 | .write = write_flush, |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 89273d35e0cc..e1fad77a2257 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -309,7 +309,7 @@ rpc_pipe_ioctl(struct inode *ino, struct file *filp, | |||
309 | } | 309 | } |
310 | } | 310 | } |
311 | 311 | ||
312 | static struct file_operations rpc_pipe_fops = { | 312 | static const struct file_operations rpc_pipe_fops = { |
313 | .owner = THIS_MODULE, | 313 | .owner = THIS_MODULE, |
314 | .llseek = no_llseek, | 314 | .llseek = no_llseek, |
315 | .read = rpc_pipe_read, | 315 | .read = rpc_pipe_read, |
@@ -366,7 +366,7 @@ rpc_info_release(struct inode *inode, struct file *file) | |||
366 | return single_release(inode, file); | 366 | return single_release(inode, file); |
367 | } | 367 | } |
368 | 368 | ||
369 | static struct file_operations rpc_info_operations = { | 369 | static const struct file_operations rpc_info_operations = { |
370 | .owner = THIS_MODULE, | 370 | .owner = THIS_MODULE, |
371 | .open = rpc_info_open, | 371 | .open = rpc_info_open, |
372 | .read = seq_read, | 372 | .read = seq_read, |
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index bd98124c3a64..044d9484bb8c 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
@@ -66,7 +66,7 @@ static int rpc_proc_open(struct inode *inode, struct file *file) | |||
66 | return single_open(file, rpc_proc_show, PDE(inode)->data); | 66 | return single_open(file, rpc_proc_show, PDE(inode)->data); |
67 | } | 67 | } |
68 | 68 | ||
69 | static struct file_operations rpc_proc_fops = { | 69 | static const struct file_operations rpc_proc_fops = { |
70 | .owner = THIS_MODULE, | 70 | .owner = THIS_MODULE, |
71 | .open = rpc_proc_open, | 71 | .open = rpc_proc_open, |
72 | .read = seq_read, | 72 | .read = seq_read, |
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 987244f95909..4b775dbf580d 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
@@ -421,6 +421,7 @@ svcauth_unix_info_release(void *info) | |||
421 | static int | 421 | static int |
422 | svcauth_unix_set_client(struct svc_rqst *rqstp) | 422 | svcauth_unix_set_client(struct svc_rqst *rqstp) |
423 | { | 423 | { |
424 | struct sockaddr_in *sin = svc_addr_in(rqstp); | ||
424 | struct ip_map *ipm; | 425 | struct ip_map *ipm; |
425 | 426 | ||
426 | rqstp->rq_client = NULL; | 427 | rqstp->rq_client = NULL; |
@@ -430,7 +431,7 @@ svcauth_unix_set_client(struct svc_rqst *rqstp) | |||
430 | ipm = ip_map_cached_get(rqstp); | 431 | ipm = ip_map_cached_get(rqstp); |
431 | if (ipm == NULL) | 432 | if (ipm == NULL) |
432 | ipm = ip_map_lookup(rqstp->rq_server->sv_program->pg_class, | 433 | ipm = ip_map_lookup(rqstp->rq_server->sv_program->pg_class, |
433 | rqstp->rq_addr.sin_addr); | 434 | sin->sin_addr); |
434 | 435 | ||
435 | if (ipm == NULL) | 436 | if (ipm == NULL) |
436 | return SVC_DENIED; | 437 | return SVC_DENIED; |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 2fd0ba2b20df..63ae94771b8e 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -36,11 +36,13 @@ | |||
36 | #include <net/sock.h> | 36 | #include <net/sock.h> |
37 | #include <net/checksum.h> | 37 | #include <net/checksum.h> |
38 | #include <net/ip.h> | 38 | #include <net/ip.h> |
39 | #include <net/ipv6.h> | ||
39 | #include <net/tcp_states.h> | 40 | #include <net/tcp_states.h> |
40 | #include <asm/uaccess.h> | 41 | #include <asm/uaccess.h> |
41 | #include <asm/ioctls.h> | 42 | #include <asm/ioctls.h> |
42 | 43 | ||
43 | #include <linux/sunrpc/types.h> | 44 | #include <linux/sunrpc/types.h> |
45 | #include <linux/sunrpc/clnt.h> | ||
44 | #include <linux/sunrpc/xdr.h> | 46 | #include <linux/sunrpc/xdr.h> |
45 | #include <linux/sunrpc/svcsock.h> | 47 | #include <linux/sunrpc/svcsock.h> |
46 | #include <linux/sunrpc/stats.h> | 48 | #include <linux/sunrpc/stats.h> |
@@ -75,7 +77,7 @@ | |||
75 | 77 | ||
76 | 78 | ||
77 | static struct svc_sock *svc_setup_socket(struct svc_serv *, struct socket *, | 79 | static struct svc_sock *svc_setup_socket(struct svc_serv *, struct socket *, |
78 | int *errp, int pmap_reg); | 80 | int *errp, int flags); |
79 | static void svc_delete_socket(struct svc_sock *svsk); | 81 | static void svc_delete_socket(struct svc_sock *svsk); |
80 | static void svc_udp_data_ready(struct sock *, int); | 82 | static void svc_udp_data_ready(struct sock *, int); |
81 | static int svc_udp_recvfrom(struct svc_rqst *); | 83 | static int svc_udp_recvfrom(struct svc_rqst *); |
@@ -121,6 +123,41 @@ static inline void svc_reclassify_socket(struct socket *sock) | |||
121 | } | 123 | } |
122 | #endif | 124 | #endif |
123 | 125 | ||
126 | static char *__svc_print_addr(struct sockaddr *addr, char *buf, size_t len) | ||
127 | { | ||
128 | switch (addr->sa_family) { | ||
129 | case AF_INET: | ||
130 | snprintf(buf, len, "%u.%u.%u.%u, port=%u", | ||
131 | NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), | ||
132 | htons(((struct sockaddr_in *) addr)->sin_port)); | ||
133 | break; | ||
134 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
135 | case AF_INET6: | ||
136 | snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", | ||
137 | NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), | ||
138 | htons(((struct sockaddr_in6 *) addr)->sin6_port)); | ||
139 | break; | ||
140 | #endif | ||
141 | default: | ||
142 | snprintf(buf, len, "unknown address type: %d", addr->sa_family); | ||
143 | break; | ||
144 | } | ||
145 | return buf; | ||
146 | } | ||
147 | |||
148 | /** | ||
149 | * svc_print_addr - Format rq_addr field for printing | ||
150 | * @rqstp: svc_rqst struct containing address to print | ||
151 | * @buf: target buffer for formatted address | ||
152 | * @len: length of target buffer | ||
153 | * | ||
154 | */ | ||
155 | char *svc_print_addr(struct svc_rqst *rqstp, char *buf, size_t len) | ||
156 | { | ||
157 | return __svc_print_addr(svc_addr(rqstp), buf, len); | ||
158 | } | ||
159 | EXPORT_SYMBOL_GPL(svc_print_addr); | ||
160 | |||
124 | /* | 161 | /* |
125 | * Queue up an idle server thread. Must have pool->sp_lock held. | 162 | * Queue up an idle server thread. Must have pool->sp_lock held. |
126 | * Note: this is really a stack rather than a queue, so that we only | 163 | * Note: this is really a stack rather than a queue, so that we only |
@@ -410,6 +447,43 @@ svc_wake_up(struct svc_serv *serv) | |||
410 | } | 447 | } |
411 | } | 448 | } |
412 | 449 | ||
450 | union svc_pktinfo_u { | ||
451 | struct in_pktinfo pkti; | ||
452 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
453 | struct in6_pktinfo pkti6; | ||
454 | #endif | ||
455 | }; | ||
456 | |||
457 | static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) | ||
458 | { | ||
459 | switch (rqstp->rq_sock->sk_sk->sk_family) { | ||
460 | case AF_INET: { | ||
461 | struct in_pktinfo *pki = CMSG_DATA(cmh); | ||
462 | |||
463 | cmh->cmsg_level = SOL_IP; | ||
464 | cmh->cmsg_type = IP_PKTINFO; | ||
465 | pki->ipi_ifindex = 0; | ||
466 | pki->ipi_spec_dst.s_addr = rqstp->rq_daddr.addr.s_addr; | ||
467 | cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); | ||
468 | } | ||
469 | break; | ||
470 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
471 | case AF_INET6: { | ||
472 | struct in6_pktinfo *pki = CMSG_DATA(cmh); | ||
473 | |||
474 | cmh->cmsg_level = SOL_IPV6; | ||
475 | cmh->cmsg_type = IPV6_PKTINFO; | ||
476 | pki->ipi6_ifindex = 0; | ||
477 | ipv6_addr_copy(&pki->ipi6_addr, | ||
478 | &rqstp->rq_daddr.addr6); | ||
479 | cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); | ||
480 | } | ||
481 | break; | ||
482 | #endif | ||
483 | } | ||
484 | return; | ||
485 | } | ||
486 | |||
413 | /* | 487 | /* |
414 | * Generic sendto routine | 488 | * Generic sendto routine |
415 | */ | 489 | */ |
@@ -419,9 +493,8 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr) | |||
419 | struct svc_sock *svsk = rqstp->rq_sock; | 493 | struct svc_sock *svsk = rqstp->rq_sock; |
420 | struct socket *sock = svsk->sk_sock; | 494 | struct socket *sock = svsk->sk_sock; |
421 | int slen; | 495 | int slen; |
422 | char buffer[CMSG_SPACE(sizeof(struct in_pktinfo))]; | 496 | char buffer[CMSG_SPACE(sizeof(union svc_pktinfo_u))]; |
423 | struct cmsghdr *cmh = (struct cmsghdr *)buffer; | 497 | struct cmsghdr *cmh = (struct cmsghdr *)buffer; |
424 | struct in_pktinfo *pki = (struct in_pktinfo *)CMSG_DATA(cmh); | ||
425 | int len = 0; | 498 | int len = 0; |
426 | int result; | 499 | int result; |
427 | int size; | 500 | int size; |
@@ -429,25 +502,20 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr) | |||
429 | size_t base = xdr->page_base; | 502 | size_t base = xdr->page_base; |
430 | unsigned int pglen = xdr->page_len; | 503 | unsigned int pglen = xdr->page_len; |
431 | unsigned int flags = MSG_MORE; | 504 | unsigned int flags = MSG_MORE; |
505 | char buf[RPC_MAX_ADDRBUFLEN]; | ||
432 | 506 | ||
433 | slen = xdr->len; | 507 | slen = xdr->len; |
434 | 508 | ||
435 | if (rqstp->rq_prot == IPPROTO_UDP) { | 509 | if (rqstp->rq_prot == IPPROTO_UDP) { |
436 | /* set the source and destination */ | 510 | struct msghdr msg = { |
437 | struct msghdr msg; | 511 | .msg_name = &rqstp->rq_addr, |
438 | msg.msg_name = &rqstp->rq_addr; | 512 | .msg_namelen = rqstp->rq_addrlen, |
439 | msg.msg_namelen = sizeof(rqstp->rq_addr); | 513 | .msg_control = cmh, |
440 | msg.msg_iov = NULL; | 514 | .msg_controllen = sizeof(buffer), |
441 | msg.msg_iovlen = 0; | 515 | .msg_flags = MSG_MORE, |
442 | msg.msg_flags = MSG_MORE; | 516 | }; |
443 | 517 | ||
444 | msg.msg_control = cmh; | 518 | svc_set_cmsg_data(rqstp, cmh); |
445 | msg.msg_controllen = sizeof(buffer); | ||
446 | cmh->cmsg_len = CMSG_LEN(sizeof(*pki)); | ||
447 | cmh->cmsg_level = SOL_IP; | ||
448 | cmh->cmsg_type = IP_PKTINFO; | ||
449 | pki->ipi_ifindex = 0; | ||
450 | pki->ipi_spec_dst.s_addr = rqstp->rq_daddr; | ||
451 | 519 | ||
452 | if (sock_sendmsg(sock, &msg, 0) < 0) | 520 | if (sock_sendmsg(sock, &msg, 0) < 0) |
453 | goto out; | 521 | goto out; |
@@ -491,9 +559,9 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr) | |||
491 | len += result; | 559 | len += result; |
492 | } | 560 | } |
493 | out: | 561 | out: |
494 | dprintk("svc: socket %p sendto([%p %Zu... ], %d) = %d (addr %x)\n", | 562 | dprintk("svc: socket %p sendto([%p %Zu... ], %d) = %d (addr %s)\n", |
495 | rqstp->rq_sock, xdr->head[0].iov_base, xdr->head[0].iov_len, xdr->len, len, | 563 | rqstp->rq_sock, xdr->head[0].iov_base, xdr->head[0].iov_len, |
496 | rqstp->rq_addr.sin_addr.s_addr); | 564 | xdr->len, len, svc_print_addr(rqstp, buf, sizeof(buf))); |
497 | 565 | ||
498 | return len; | 566 | return len; |
499 | } | 567 | } |
@@ -568,31 +636,22 @@ svc_recv_available(struct svc_sock *svsk) | |||
568 | static int | 636 | static int |
569 | svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen) | 637 | svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen) |
570 | { | 638 | { |
571 | struct msghdr msg; | 639 | struct svc_sock *svsk = rqstp->rq_sock; |
572 | struct socket *sock; | 640 | struct msghdr msg = { |
573 | int len, alen; | 641 | .msg_flags = MSG_DONTWAIT, |
574 | 642 | }; | |
575 | rqstp->rq_addrlen = sizeof(rqstp->rq_addr); | 643 | int len; |
576 | sock = rqstp->rq_sock->sk_sock; | ||
577 | |||
578 | msg.msg_name = &rqstp->rq_addr; | ||
579 | msg.msg_namelen = sizeof(rqstp->rq_addr); | ||
580 | msg.msg_control = NULL; | ||
581 | msg.msg_controllen = 0; | ||
582 | |||
583 | msg.msg_flags = MSG_DONTWAIT; | ||
584 | 644 | ||
585 | len = kernel_recvmsg(sock, &msg, iov, nr, buflen, MSG_DONTWAIT); | 645 | len = kernel_recvmsg(svsk->sk_sock, &msg, iov, nr, buflen, |
646 | msg.msg_flags); | ||
586 | 647 | ||
587 | /* sock_recvmsg doesn't fill in the name/namelen, so we must.. | 648 | /* sock_recvmsg doesn't fill in the name/namelen, so we must.. |
588 | * possibly we should cache this in the svc_sock structure | ||
589 | * at accept time. FIXME | ||
590 | */ | 649 | */ |
591 | alen = sizeof(rqstp->rq_addr); | 650 | memcpy(&rqstp->rq_addr, &svsk->sk_remote, svsk->sk_remotelen); |
592 | kernel_getpeername(sock, (struct sockaddr *)&rqstp->rq_addr, &alen); | 651 | rqstp->rq_addrlen = svsk->sk_remotelen; |
593 | 652 | ||
594 | dprintk("svc: socket %p recvfrom(%p, %Zu) = %d\n", | 653 | dprintk("svc: socket %p recvfrom(%p, %Zu) = %d\n", |
595 | rqstp->rq_sock, iov[0].iov_base, iov[0].iov_len, len); | 654 | svsk, iov[0].iov_base, iov[0].iov_len, len); |
596 | 655 | ||
597 | return len; | 656 | return len; |
598 | } | 657 | } |
@@ -662,6 +721,47 @@ svc_write_space(struct sock *sk) | |||
662 | } | 721 | } |
663 | } | 722 | } |
664 | 723 | ||
724 | static void svc_udp_get_sender_address(struct svc_rqst *rqstp, | ||
725 | struct sk_buff *skb) | ||
726 | { | ||
727 | switch (rqstp->rq_sock->sk_sk->sk_family) { | ||
728 | case AF_INET: { | ||
729 | /* this seems to come from net/ipv4/udp.c:udp_recvmsg */ | ||
730 | struct sockaddr_in *sin = svc_addr_in(rqstp); | ||
731 | |||
732 | sin->sin_family = AF_INET; | ||
733 | sin->sin_port = skb->h.uh->source; | ||
734 | sin->sin_addr.s_addr = skb->nh.iph->saddr; | ||
735 | rqstp->rq_addrlen = sizeof(struct sockaddr_in); | ||
736 | /* Remember which interface received this request */ | ||
737 | rqstp->rq_daddr.addr.s_addr = skb->nh.iph->daddr; | ||
738 | } | ||
739 | break; | ||
740 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
741 | case AF_INET6: { | ||
742 | /* this is derived from net/ipv6/udp.c:udpv6_recvmesg */ | ||
743 | struct sockaddr_in6 *sin6 = svc_addr_in6(rqstp); | ||
744 | |||
745 | sin6->sin6_family = AF_INET6; | ||
746 | sin6->sin6_port = skb->h.uh->source; | ||
747 | sin6->sin6_flowinfo = 0; | ||
748 | sin6->sin6_scope_id = 0; | ||
749 | if (ipv6_addr_type(&sin6->sin6_addr) & | ||
750 | IPV6_ADDR_LINKLOCAL) | ||
751 | sin6->sin6_scope_id = IP6CB(skb)->iif; | ||
752 | ipv6_addr_copy(&sin6->sin6_addr, | ||
753 | &skb->nh.ipv6h->saddr); | ||
754 | rqstp->rq_addrlen = sizeof(struct sockaddr_in); | ||
755 | /* Remember which interface received this request */ | ||
756 | ipv6_addr_copy(&rqstp->rq_daddr.addr6, | ||
757 | &skb->nh.ipv6h->saddr); | ||
758 | } | ||
759 | break; | ||
760 | #endif | ||
761 | } | ||
762 | return; | ||
763 | } | ||
764 | |||
665 | /* | 765 | /* |
666 | * Receive a datagram from a UDP socket. | 766 | * Receive a datagram from a UDP socket. |
667 | */ | 767 | */ |
@@ -725,13 +825,9 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) | |||
725 | len = skb->len - sizeof(struct udphdr); | 825 | len = skb->len - sizeof(struct udphdr); |
726 | rqstp->rq_arg.len = len; | 826 | rqstp->rq_arg.len = len; |
727 | 827 | ||
728 | rqstp->rq_prot = IPPROTO_UDP; | 828 | rqstp->rq_prot = IPPROTO_UDP; |
729 | 829 | ||
730 | /* Get sender address */ | 830 | svc_udp_get_sender_address(rqstp, skb); |
731 | rqstp->rq_addr.sin_family = AF_INET; | ||
732 | rqstp->rq_addr.sin_port = skb->h.uh->source; | ||
733 | rqstp->rq_addr.sin_addr.s_addr = skb->nh.iph->saddr; | ||
734 | rqstp->rq_daddr = skb->nh.iph->daddr; | ||
735 | 831 | ||
736 | if (skb_is_nonlinear(skb)) { | 832 | if (skb_is_nonlinear(skb)) { |
737 | /* we have to copy */ | 833 | /* we have to copy */ |
@@ -875,18 +971,36 @@ svc_tcp_data_ready(struct sock *sk, int count) | |||
875 | wake_up_interruptible(sk->sk_sleep); | 971 | wake_up_interruptible(sk->sk_sleep); |
876 | } | 972 | } |
877 | 973 | ||
974 | static inline int svc_port_is_privileged(struct sockaddr *sin) | ||
975 | { | ||
976 | switch (sin->sa_family) { | ||
977 | case AF_INET: | ||
978 | return ntohs(((struct sockaddr_in *)sin)->sin_port) | ||
979 | < PROT_SOCK; | ||
980 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
981 | case AF_INET6: | ||
982 | return ntohs(((struct sockaddr_in6 *)sin)->sin6_port) | ||
983 | < PROT_SOCK; | ||
984 | #endif | ||
985 | default: | ||
986 | return 0; | ||
987 | } | ||
988 | } | ||
989 | |||
878 | /* | 990 | /* |
879 | * Accept a TCP connection | 991 | * Accept a TCP connection |
880 | */ | 992 | */ |
881 | static void | 993 | static void |
882 | svc_tcp_accept(struct svc_sock *svsk) | 994 | svc_tcp_accept(struct svc_sock *svsk) |
883 | { | 995 | { |
884 | struct sockaddr_in sin; | 996 | struct sockaddr_storage addr; |
997 | struct sockaddr *sin = (struct sockaddr *) &addr; | ||
885 | struct svc_serv *serv = svsk->sk_server; | 998 | struct svc_serv *serv = svsk->sk_server; |
886 | struct socket *sock = svsk->sk_sock; | 999 | struct socket *sock = svsk->sk_sock; |
887 | struct socket *newsock; | 1000 | struct socket *newsock; |
888 | struct svc_sock *newsvsk; | 1001 | struct svc_sock *newsvsk; |
889 | int err, slen; | 1002 | int err, slen; |
1003 | char buf[RPC_MAX_ADDRBUFLEN]; | ||
890 | 1004 | ||
891 | dprintk("svc: tcp_accept %p sock %p\n", svsk, sock); | 1005 | dprintk("svc: tcp_accept %p sock %p\n", svsk, sock); |
892 | if (!sock) | 1006 | if (!sock) |
@@ -907,8 +1021,7 @@ svc_tcp_accept(struct svc_sock *svsk) | |||
907 | set_bit(SK_CONN, &svsk->sk_flags); | 1021 | set_bit(SK_CONN, &svsk->sk_flags); |
908 | svc_sock_enqueue(svsk); | 1022 | svc_sock_enqueue(svsk); |
909 | 1023 | ||
910 | slen = sizeof(sin); | 1024 | err = kernel_getpeername(newsock, sin, &slen); |
911 | err = kernel_getpeername(newsock, (struct sockaddr *) &sin, &slen); | ||
912 | if (err < 0) { | 1025 | if (err < 0) { |
913 | if (net_ratelimit()) | 1026 | if (net_ratelimit()) |
914 | printk(KERN_WARNING "%s: peername failed (err %d)!\n", | 1027 | printk(KERN_WARNING "%s: peername failed (err %d)!\n", |
@@ -917,27 +1030,30 @@ svc_tcp_accept(struct svc_sock *svsk) | |||
917 | } | 1030 | } |
918 | 1031 | ||
919 | /* Ideally, we would want to reject connections from unauthorized | 1032 | /* Ideally, we would want to reject connections from unauthorized |
920 | * hosts here, but when we get encription, the IP of the host won't | 1033 | * hosts here, but when we get encryption, the IP of the host won't |
921 | * tell us anything. For now just warn about unpriv connections. | 1034 | * tell us anything. For now just warn about unpriv connections. |
922 | */ | 1035 | */ |
923 | if (ntohs(sin.sin_port) >= 1024) { | 1036 | if (!svc_port_is_privileged(sin)) { |
924 | dprintk(KERN_WARNING | 1037 | dprintk(KERN_WARNING |
925 | "%s: connect from unprivileged port: %u.%u.%u.%u:%d\n", | 1038 | "%s: connect from unprivileged port: %s\n", |
926 | serv->sv_name, | 1039 | serv->sv_name, |
927 | NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); | 1040 | __svc_print_addr(sin, buf, sizeof(buf))); |
928 | } | 1041 | } |
929 | 1042 | dprintk("%s: connect from %s\n", serv->sv_name, | |
930 | dprintk("%s: connect from %u.%u.%u.%u:%04x\n", serv->sv_name, | 1043 | __svc_print_addr(sin, buf, sizeof(buf))); |
931 | NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); | ||
932 | 1044 | ||
933 | /* make sure that a write doesn't block forever when | 1045 | /* make sure that a write doesn't block forever when |
934 | * low on memory | 1046 | * low on memory |
935 | */ | 1047 | */ |
936 | newsock->sk->sk_sndtimeo = HZ*30; | 1048 | newsock->sk->sk_sndtimeo = HZ*30; |
937 | 1049 | ||
938 | if (!(newsvsk = svc_setup_socket(serv, newsock, &err, 0))) | 1050 | if (!(newsvsk = svc_setup_socket(serv, newsock, &err, |
1051 | (SVC_SOCK_ANONYMOUS | SVC_SOCK_TEMPORARY)))) | ||
939 | goto failed; | 1052 | goto failed; |
1053 | memcpy(&newsvsk->sk_remote, sin, slen); | ||
1054 | newsvsk->sk_remotelen = slen; | ||
940 | 1055 | ||
1056 | svc_sock_received(newsvsk); | ||
941 | 1057 | ||
942 | /* make sure that we don't have too many active connections. | 1058 | /* make sure that we don't have too many active connections. |
943 | * If we have, something must be dropped. | 1059 | * If we have, something must be dropped. |
@@ -960,11 +1076,9 @@ svc_tcp_accept(struct svc_sock *svsk) | |||
960 | "sockets, consider increasing the " | 1076 | "sockets, consider increasing the " |
961 | "number of nfsd threads\n", | 1077 | "number of nfsd threads\n", |
962 | serv->sv_name); | 1078 | serv->sv_name); |
963 | printk(KERN_NOTICE "%s: last TCP connect from " | 1079 | printk(KERN_NOTICE |
964 | "%u.%u.%u.%u:%d\n", | 1080 | "%s: last TCP connect from %s\n", |
965 | serv->sv_name, | 1081 | serv->sv_name, buf); |
966 | NIPQUAD(sin.sin_addr.s_addr), | ||
967 | ntohs(sin.sin_port)); | ||
968 | } | 1082 | } |
969 | /* | 1083 | /* |
970 | * Always select the oldest socket. It's not fair, | 1084 | * Always select the oldest socket. It's not fair, |
@@ -1266,7 +1380,7 @@ svc_sock_update_bufs(struct svc_serv *serv) | |||
1266 | int | 1380 | int |
1267 | svc_recv(struct svc_rqst *rqstp, long timeout) | 1381 | svc_recv(struct svc_rqst *rqstp, long timeout) |
1268 | { | 1382 | { |
1269 | struct svc_sock *svsk =NULL; | 1383 | struct svc_sock *svsk = NULL; |
1270 | struct svc_serv *serv = rqstp->rq_server; | 1384 | struct svc_serv *serv = rqstp->rq_server; |
1271 | struct svc_pool *pool = rqstp->rq_pool; | 1385 | struct svc_pool *pool = rqstp->rq_pool; |
1272 | int len, i; | 1386 | int len, i; |
@@ -1363,7 +1477,7 @@ svc_recv(struct svc_rqst *rqstp, long timeout) | |||
1363 | svsk->sk_lastrecv = get_seconds(); | 1477 | svsk->sk_lastrecv = get_seconds(); |
1364 | clear_bit(SK_OLD, &svsk->sk_flags); | 1478 | clear_bit(SK_OLD, &svsk->sk_flags); |
1365 | 1479 | ||
1366 | rqstp->rq_secure = ntohs(rqstp->rq_addr.sin_port) < 1024; | 1480 | rqstp->rq_secure = svc_port_is_privileged(svc_addr(rqstp)); |
1367 | rqstp->rq_chandle.defer = svc_defer; | 1481 | rqstp->rq_chandle.defer = svc_defer; |
1368 | 1482 | ||
1369 | if (serv->sv_stats) | 1483 | if (serv->sv_stats) |
@@ -1476,12 +1590,14 @@ svc_age_temp_sockets(unsigned long closure) | |||
1476 | * Initialize socket for RPC use and create svc_sock struct | 1590 | * Initialize socket for RPC use and create svc_sock struct |
1477 | * XXX: May want to setsockopt SO_SNDBUF and SO_RCVBUF. | 1591 | * XXX: May want to setsockopt SO_SNDBUF and SO_RCVBUF. |
1478 | */ | 1592 | */ |
1479 | static struct svc_sock * | 1593 | static struct svc_sock *svc_setup_socket(struct svc_serv *serv, |
1480 | svc_setup_socket(struct svc_serv *serv, struct socket *sock, | 1594 | struct socket *sock, |
1481 | int *errp, int pmap_register) | 1595 | int *errp, int flags) |
1482 | { | 1596 | { |
1483 | struct svc_sock *svsk; | 1597 | struct svc_sock *svsk; |
1484 | struct sock *inet; | 1598 | struct sock *inet; |
1599 | int pmap_register = !(flags & SVC_SOCK_ANONYMOUS); | ||
1600 | int is_temporary = flags & SVC_SOCK_TEMPORARY; | ||
1485 | 1601 | ||
1486 | dprintk("svc: svc_setup_socket %p\n", sock); | 1602 | dprintk("svc: svc_setup_socket %p\n", sock); |
1487 | if (!(svsk = kzalloc(sizeof(*svsk), GFP_KERNEL))) { | 1603 | if (!(svsk = kzalloc(sizeof(*svsk), GFP_KERNEL))) { |
@@ -1523,7 +1639,7 @@ svc_setup_socket(struct svc_serv *serv, struct socket *sock, | |||
1523 | svc_tcp_init(svsk); | 1639 | svc_tcp_init(svsk); |
1524 | 1640 | ||
1525 | spin_lock_bh(&serv->sv_lock); | 1641 | spin_lock_bh(&serv->sv_lock); |
1526 | if (!pmap_register) { | 1642 | if (is_temporary) { |
1527 | set_bit(SK_TEMP, &svsk->sk_flags); | 1643 | set_bit(SK_TEMP, &svsk->sk_flags); |
1528 | list_add(&svsk->sk_list, &serv->sv_tempsocks); | 1644 | list_add(&svsk->sk_list, &serv->sv_tempsocks); |
1529 | serv->sv_tmpcnt++; | 1645 | serv->sv_tmpcnt++; |
@@ -1543,8 +1659,6 @@ svc_setup_socket(struct svc_serv *serv, struct socket *sock, | |||
1543 | dprintk("svc: svc_setup_socket created %p (inet %p)\n", | 1659 | dprintk("svc: svc_setup_socket created %p (inet %p)\n", |
1544 | svsk, svsk->sk_sk); | 1660 | svsk, svsk->sk_sk); |
1545 | 1661 | ||
1546 | clear_bit(SK_BUSY, &svsk->sk_flags); | ||
1547 | svc_sock_enqueue(svsk); | ||
1548 | return svsk; | 1662 | return svsk; |
1549 | } | 1663 | } |
1550 | 1664 | ||
@@ -1567,9 +1681,11 @@ int svc_addsock(struct svc_serv *serv, | |||
1567 | else if (so->state > SS_UNCONNECTED) | 1681 | else if (so->state > SS_UNCONNECTED) |
1568 | err = -EISCONN; | 1682 | err = -EISCONN; |
1569 | else { | 1683 | else { |
1570 | svsk = svc_setup_socket(serv, so, &err, 1); | 1684 | svsk = svc_setup_socket(serv, so, &err, SVC_SOCK_DEFAULTS); |
1571 | if (svsk) | 1685 | if (svsk) { |
1686 | svc_sock_received(svsk); | ||
1572 | err = 0; | 1687 | err = 0; |
1688 | } | ||
1573 | } | 1689 | } |
1574 | if (err) { | 1690 | if (err) { |
1575 | sockfd_put(so); | 1691 | sockfd_put(so); |
@@ -1583,18 +1699,18 @@ EXPORT_SYMBOL_GPL(svc_addsock); | |||
1583 | /* | 1699 | /* |
1584 | * Create socket for RPC service. | 1700 | * Create socket for RPC service. |
1585 | */ | 1701 | */ |
1586 | static int | 1702 | static int svc_create_socket(struct svc_serv *serv, int protocol, |
1587 | svc_create_socket(struct svc_serv *serv, int protocol, struct sockaddr_in *sin) | 1703 | struct sockaddr *sin, int len, int flags) |
1588 | { | 1704 | { |
1589 | struct svc_sock *svsk; | 1705 | struct svc_sock *svsk; |
1590 | struct socket *sock; | 1706 | struct socket *sock; |
1591 | int error; | 1707 | int error; |
1592 | int type; | 1708 | int type; |
1709 | char buf[RPC_MAX_ADDRBUFLEN]; | ||
1593 | 1710 | ||
1594 | dprintk("svc: svc_create_socket(%s, %d, %u.%u.%u.%u:%d)\n", | 1711 | dprintk("svc: svc_create_socket(%s, %d, %s)\n", |
1595 | serv->sv_program->pg_name, protocol, | 1712 | serv->sv_program->pg_name, protocol, |
1596 | NIPQUAD(sin->sin_addr.s_addr), | 1713 | __svc_print_addr(sin, buf, sizeof(buf))); |
1597 | ntohs(sin->sin_port)); | ||
1598 | 1714 | ||
1599 | if (protocol != IPPROTO_UDP && protocol != IPPROTO_TCP) { | 1715 | if (protocol != IPPROTO_UDP && protocol != IPPROTO_TCP) { |
1600 | printk(KERN_WARNING "svc: only UDP and TCP " | 1716 | printk(KERN_WARNING "svc: only UDP and TCP " |
@@ -1603,15 +1719,15 @@ svc_create_socket(struct svc_serv *serv, int protocol, struct sockaddr_in *sin) | |||
1603 | } | 1719 | } |
1604 | type = (protocol == IPPROTO_UDP)? SOCK_DGRAM : SOCK_STREAM; | 1720 | type = (protocol == IPPROTO_UDP)? SOCK_DGRAM : SOCK_STREAM; |
1605 | 1721 | ||
1606 | if ((error = sock_create_kern(PF_INET, type, protocol, &sock)) < 0) | 1722 | error = sock_create_kern(sin->sa_family, type, protocol, &sock); |
1723 | if (error < 0) | ||
1607 | return error; | 1724 | return error; |
1608 | 1725 | ||
1609 | svc_reclassify_socket(sock); | 1726 | svc_reclassify_socket(sock); |
1610 | 1727 | ||
1611 | if (type == SOCK_STREAM) | 1728 | if (type == SOCK_STREAM) |
1612 | sock->sk->sk_reuse = 1; /* allow address reuse */ | 1729 | sock->sk->sk_reuse = 1; /* allow address reuse */ |
1613 | error = kernel_bind(sock, (struct sockaddr *) sin, | 1730 | error = kernel_bind(sock, sin, len); |
1614 | sizeof(*sin)); | ||
1615 | if (error < 0) | 1731 | if (error < 0) |
1616 | goto bummer; | 1732 | goto bummer; |
1617 | 1733 | ||
@@ -1620,8 +1736,10 @@ svc_create_socket(struct svc_serv *serv, int protocol, struct sockaddr_in *sin) | |||
1620 | goto bummer; | 1736 | goto bummer; |
1621 | } | 1737 | } |
1622 | 1738 | ||
1623 | if ((svsk = svc_setup_socket(serv, sock, &error, 1)) != NULL) | 1739 | if ((svsk = svc_setup_socket(serv, sock, &error, flags)) != NULL) { |
1624 | return 0; | 1740 | svc_sock_received(svsk); |
1741 | return ntohs(inet_sk(svsk->sk_sk)->sport); | ||
1742 | } | ||
1625 | 1743 | ||
1626 | bummer: | 1744 | bummer: |
1627 | dprintk("svc: svc_create_socket error = %d\n", -error); | 1745 | dprintk("svc: svc_create_socket error = %d\n", -error); |
@@ -1681,19 +1799,26 @@ void svc_close_socket(struct svc_sock *svsk) | |||
1681 | svc_sock_put(svsk); | 1799 | svc_sock_put(svsk); |
1682 | } | 1800 | } |
1683 | 1801 | ||
1684 | /* | 1802 | /** |
1685 | * Make a socket for nfsd and lockd | 1803 | * svc_makesock - Make a socket for nfsd and lockd |
1804 | * @serv: RPC server structure | ||
1805 | * @protocol: transport protocol to use | ||
1806 | * @port: port to use | ||
1807 | * @flags: requested socket characteristics | ||
1808 | * | ||
1686 | */ | 1809 | */ |
1687 | int | 1810 | int svc_makesock(struct svc_serv *serv, int protocol, unsigned short port, |
1688 | svc_makesock(struct svc_serv *serv, int protocol, unsigned short port) | 1811 | int flags) |
1689 | { | 1812 | { |
1690 | struct sockaddr_in sin; | 1813 | struct sockaddr_in sin = { |
1814 | .sin_family = AF_INET, | ||
1815 | .sin_addr.s_addr = INADDR_ANY, | ||
1816 | .sin_port = htons(port), | ||
1817 | }; | ||
1691 | 1818 | ||
1692 | dprintk("svc: creating socket proto = %d\n", protocol); | 1819 | dprintk("svc: creating socket proto = %d\n", protocol); |
1693 | sin.sin_family = AF_INET; | 1820 | return svc_create_socket(serv, protocol, (struct sockaddr *) &sin, |
1694 | sin.sin_addr.s_addr = INADDR_ANY; | 1821 | sizeof(sin), flags); |
1695 | sin.sin_port = htons(port); | ||
1696 | return svc_create_socket(serv, protocol, &sin); | ||
1697 | } | 1822 | } |
1698 | 1823 | ||
1699 | /* | 1824 | /* |
@@ -1742,7 +1867,8 @@ svc_defer(struct cache_req *req) | |||
1742 | 1867 | ||
1743 | dr->handle.owner = rqstp->rq_server; | 1868 | dr->handle.owner = rqstp->rq_server; |
1744 | dr->prot = rqstp->rq_prot; | 1869 | dr->prot = rqstp->rq_prot; |
1745 | dr->addr = rqstp->rq_addr; | 1870 | memcpy(&dr->addr, &rqstp->rq_addr, rqstp->rq_addrlen); |
1871 | dr->addrlen = rqstp->rq_addrlen; | ||
1746 | dr->daddr = rqstp->rq_daddr; | 1872 | dr->daddr = rqstp->rq_daddr; |
1747 | dr->argslen = rqstp->rq_arg.len >> 2; | 1873 | dr->argslen = rqstp->rq_arg.len >> 2; |
1748 | memcpy(dr->args, rqstp->rq_arg.head[0].iov_base-skip, dr->argslen<<2); | 1874 | memcpy(dr->args, rqstp->rq_arg.head[0].iov_base-skip, dr->argslen<<2); |
@@ -1766,7 +1892,8 @@ static int svc_deferred_recv(struct svc_rqst *rqstp) | |||
1766 | rqstp->rq_arg.page_len = 0; | 1892 | rqstp->rq_arg.page_len = 0; |
1767 | rqstp->rq_arg.len = dr->argslen<<2; | 1893 | rqstp->rq_arg.len = dr->argslen<<2; |
1768 | rqstp->rq_prot = dr->prot; | 1894 | rqstp->rq_prot = dr->prot; |
1769 | rqstp->rq_addr = dr->addr; | 1895 | memcpy(&rqstp->rq_addr, &dr->addr, dr->addrlen); |
1896 | rqstp->rq_addrlen = dr->addrlen; | ||
1770 | rqstp->rq_daddr = dr->daddr; | 1897 | rqstp->rq_daddr = dr->daddr; |
1771 | rqstp->rq_respages = rqstp->rq_pages; | 1898 | rqstp->rq_respages = rqstp->rq_pages; |
1772 | return dr->argslen<<2; | 1899 | return dr->argslen<<2; |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index ac9478d0ca8b..606971645b33 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -2040,7 +2040,7 @@ out_kfree: | |||
2040 | goto out; | 2040 | goto out; |
2041 | } | 2041 | } |
2042 | 2042 | ||
2043 | static struct file_operations unix_seq_fops = { | 2043 | static const struct file_operations unix_seq_fops = { |
2044 | .owner = THIS_MODULE, | 2044 | .owner = THIS_MODULE, |
2045 | .open = unix_seq_open, | 2045 | .open = unix_seq_open, |
2046 | .read = seq_read, | 2046 | .read = seq_read, |
diff --git a/net/wanrouter/wanproc.c b/net/wanrouter/wanproc.c index abce82873604..205106521ecb 100644 --- a/net/wanrouter/wanproc.c +++ b/net/wanrouter/wanproc.c | |||
@@ -188,7 +188,7 @@ static int status_open(struct inode *inode, struct file *file) | |||
188 | return seq_open(file, &status_op); | 188 | return seq_open(file, &status_op); |
189 | } | 189 | } |
190 | 190 | ||
191 | static struct file_operations config_fops = { | 191 | static const struct file_operations config_fops = { |
192 | .owner = THIS_MODULE, | 192 | .owner = THIS_MODULE, |
193 | .open = config_open, | 193 | .open = config_open, |
194 | .read = seq_read, | 194 | .read = seq_read, |
@@ -196,7 +196,7 @@ static struct file_operations config_fops = { | |||
196 | .release = seq_release, | 196 | .release = seq_release, |
197 | }; | 197 | }; |
198 | 198 | ||
199 | static struct file_operations status_fops = { | 199 | static const struct file_operations status_fops = { |
200 | .owner = THIS_MODULE, | 200 | .owner = THIS_MODULE, |
201 | .open = status_open, | 201 | .open = status_open, |
202 | .read = seq_read, | 202 | .read = seq_read, |
@@ -271,7 +271,7 @@ static int wandev_open(struct inode *inode, struct file *file) | |||
271 | return single_open(file, wandev_show, PDE(inode)->data); | 271 | return single_open(file, wandev_show, PDE(inode)->data); |
272 | } | 272 | } |
273 | 273 | ||
274 | static struct file_operations wandev_fops = { | 274 | static const struct file_operations wandev_fops = { |
275 | .owner = THIS_MODULE, | 275 | .owner = THIS_MODULE, |
276 | .open = wandev_open, | 276 | .open = wandev_open, |
277 | .read = seq_read, | 277 | .read = seq_read, |
diff --git a/net/x25/x25_proc.c b/net/x25/x25_proc.c index 3c9f1ba56221..96001f0c64fc 100644 --- a/net/x25/x25_proc.c +++ b/net/x25/x25_proc.c | |||
@@ -270,7 +270,7 @@ static int x25_seq_forward_open(struct inode *inode, struct file *file) | |||
270 | return seq_open(file, &x25_seq_forward_ops); | 270 | return seq_open(file, &x25_seq_forward_ops); |
271 | } | 271 | } |
272 | 272 | ||
273 | static struct file_operations x25_seq_socket_fops = { | 273 | static const struct file_operations x25_seq_socket_fops = { |
274 | .owner = THIS_MODULE, | 274 | .owner = THIS_MODULE, |
275 | .open = x25_seq_socket_open, | 275 | .open = x25_seq_socket_open, |
276 | .read = seq_read, | 276 | .read = seq_read, |
@@ -278,7 +278,7 @@ static struct file_operations x25_seq_socket_fops = { | |||
278 | .release = seq_release, | 278 | .release = seq_release, |
279 | }; | 279 | }; |
280 | 280 | ||
281 | static struct file_operations x25_seq_route_fops = { | 281 | static const struct file_operations x25_seq_route_fops = { |
282 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
283 | .open = x25_seq_route_open, | 283 | .open = x25_seq_route_open, |
284 | .read = seq_read, | 284 | .read = seq_read, |