aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
commit20b4fb485227404329e41ad15588afad3df23050 (patch)
treef3e099f0ab3da8a93b447203e294d2bb22f6dc05 /net
parentb9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff)
parentac3e3c5b1164397656df81b9e9ab4991184d3236 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlanproc.c11
-rw-r--r--net/atm/proc.c2
-rw-r--r--net/bluetooth/af_bluetooth.c27
-rw-r--r--net/bluetooth/bnep/sock.c2
-rw-r--r--net/bluetooth/cmtp/capi.c2
-rw-r--r--net/bluetooth/cmtp/sock.c2
-rw-r--r--net/bluetooth/hci_sock.c2
-rw-r--r--net/bluetooth/hidp/sock.c2
-rw-r--r--net/bluetooth/l2cap_sock.c2
-rw-r--r--net/bluetooth/rfcomm/sock.c2
-rw-r--r--net/bluetooth/sco.c2
-rw-r--r--net/can/bcm.c2
-rw-r--r--net/can/proc.c2
-rw-r--r--net/core/neighbour.c2
-rw-r--r--net/core/net_namespace.c7
-rw-r--r--net/core/pktgen.c12
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c10
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv4/udp.c2
-rw-r--r--net/ipv6/proc.c5
-rw-r--r--net/netfilter/x_tables.c6
-rw-r--r--net/netfilter/xt_hashlimit.c16
-rw-r--r--net/netfilter/xt_recent.c9
-rw-r--r--net/socket.c9
-rw-r--r--net/sunrpc/cache.c24
-rw-r--r--net/sunrpc/stats.c2
-rw-r--r--net/wireless/lib80211_crypt_ccmp.c29
-rw-r--r--net/wireless/lib80211_crypt_tkip.c44
-rw-r--r--net/wireless/lib80211_crypt_wep.c5
-rw-r--r--net/x25/x25_proc.c47
30 files changed, 127 insertions, 164 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index dc526ec965e4..1d0e89213a28 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -93,7 +93,7 @@ static const struct file_operations vlan_fops = {
93 93
94static int vlandev_seq_open(struct inode *inode, struct file *file) 94static int vlandev_seq_open(struct inode *inode, struct file *file)
95{ 95{
96 return single_open(file, vlandev_seq_show, PDE(inode)->data); 96 return single_open(file, vlandev_seq_show, PDE_DATA(inode));
97} 97}
98 98
99static const struct file_operations vlandev_fops = { 99static const struct file_operations vlandev_fops = {
@@ -184,14 +184,9 @@ int vlan_proc_add_dev(struct net_device *vlandev)
184 */ 184 */
185int vlan_proc_rem_dev(struct net_device *vlandev) 185int vlan_proc_rem_dev(struct net_device *vlandev)
186{ 186{
187 struct vlan_net *vn = net_generic(dev_net(vlandev), vlan_net_id);
188
189 /** NOTE: This will consume the memory pointed to by dent, it seems. */ 187 /** NOTE: This will consume the memory pointed to by dent, it seems. */
190 if (vlan_dev_priv(vlandev)->dent) { 188 proc_remove(vlan_dev_priv(vlandev)->dent);
191 remove_proc_entry(vlan_dev_priv(vlandev)->dent->name, 189 vlan_dev_priv(vlandev)->dent = NULL;
192 vn->proc_vlan_dir);
193 vlan_dev_priv(vlandev)->dent = NULL;
194 }
195 return 0; 190 return 0;
196} 191}
197 192
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 6ac35ff0d6b9..bbb6461a4b7f 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -385,7 +385,7 @@ static ssize_t proc_dev_atm_read(struct file *file, char __user *buf,
385 page = get_zeroed_page(GFP_KERNEL); 385 page = get_zeroed_page(GFP_KERNEL);
386 if (!page) 386 if (!page)
387 return -ENOMEM; 387 return -ENOMEM;
388 dev = PDE(file_inode(file))->data; 388 dev = PDE_DATA(file_inode(file));
389 if (!dev->ops->proc_read) 389 if (!dev->ops->proc_read)
390 length = -EINVAL; 390 length = -EINVAL;
391 else { 391 else {
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index e5338f787d68..9096137c889c 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -609,7 +609,7 @@ static int bt_seq_open(struct inode *inode, struct file *file)
609 struct bt_sock_list *sk_list; 609 struct bt_sock_list *sk_list;
610 struct bt_seq_state *s; 610 struct bt_seq_state *s;
611 611
612 sk_list = PDE(inode)->data; 612 sk_list = PDE_DATA(inode);
613 s = __seq_open_private(file, &bt_seq_ops, 613 s = __seq_open_private(file, &bt_seq_ops,
614 sizeof(struct bt_seq_state)); 614 sizeof(struct bt_seq_state));
615 if (!s) 615 if (!s)
@@ -619,26 +619,21 @@ static int bt_seq_open(struct inode *inode, struct file *file)
619 return 0; 619 return 0;
620} 620}
621 621
622int bt_procfs_init(struct module* module, struct net *net, const char *name, 622static const struct file_operations bt_fops = {
623 .open = bt_seq_open,
624 .read = seq_read,
625 .llseek = seq_lseek,
626 .release = seq_release_private
627};
628
629int bt_procfs_init(struct net *net, const char *name,
623 struct bt_sock_list* sk_list, 630 struct bt_sock_list* sk_list,
624 int (* seq_show)(struct seq_file *, void *)) 631 int (* seq_show)(struct seq_file *, void *))
625{ 632{
626 struct proc_dir_entry * pde;
627
628 sk_list->custom_seq_show = seq_show; 633 sk_list->custom_seq_show = seq_show;
629 634
630 sk_list->fops.owner = module; 635 if (!proc_create_data(name, 0, net->proc_net, &bt_fops, sk_list))
631 sk_list->fops.open = bt_seq_open;
632 sk_list->fops.read = seq_read;
633 sk_list->fops.llseek = seq_lseek;
634 sk_list->fops.release = seq_release_private;
635
636 pde = proc_create(name, 0, net->proc_net, &sk_list->fops);
637 if (!pde)
638 return -ENOMEM; 636 return -ENOMEM;
639
640 pde->data = sk_list;
641
642 return 0; 637 return 0;
643} 638}
644 639
@@ -647,7 +642,7 @@ void bt_procfs_cleanup(struct net *net, const char *name)
647 remove_proc_entry(name, net->proc_net); 642 remove_proc_entry(name, net->proc_net);
648} 643}
649#else 644#else
650int bt_procfs_init(struct module* module, struct net *net, const char *name, 645int bt_procfs_init(struct net *net, const char *name,
651 struct bt_sock_list* sk_list, 646 struct bt_sock_list* sk_list,
652 int (* seq_show)(struct seq_file *, void *)) 647 int (* seq_show)(struct seq_file *, void *))
653{ 648{
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c
index 5b1c04e28821..5f051290daba 100644
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -234,7 +234,7 @@ int __init bnep_sock_init(void)
234 goto error; 234 goto error;
235 } 235 }
236 236
237 err = bt_procfs_init(THIS_MODULE, &init_net, "bnep", &bnep_sk_list, NULL); 237 err = bt_procfs_init(&init_net, "bnep", &bnep_sk_list, NULL);
238 if (err < 0) { 238 if (err < 0) {
239 BT_ERR("Failed to create BNEP proc file"); 239 BT_ERR("Failed to create BNEP proc file");
240 bt_sock_unregister(BTPROTO_BNEP); 240 bt_sock_unregister(BTPROTO_BNEP);
diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
index a4a9d4b6816c..cd75e4d64b90 100644
--- a/net/bluetooth/cmtp/capi.c
+++ b/net/bluetooth/cmtp/capi.c
@@ -539,7 +539,7 @@ static int cmtp_proc_show(struct seq_file *m, void *v)
539 539
540static int cmtp_proc_open(struct inode *inode, struct file *file) 540static int cmtp_proc_open(struct inode *inode, struct file *file)
541{ 541{
542 return single_open(file, cmtp_proc_show, PDE(inode)->data); 542 return single_open(file, cmtp_proc_show, PDE_DATA(inode));
543} 543}
544 544
545static const struct file_operations cmtp_proc_fops = { 545static const struct file_operations cmtp_proc_fops = {
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c
index 58d9edebab4b..d82787d417bd 100644
--- a/net/bluetooth/cmtp/sock.c
+++ b/net/bluetooth/cmtp/sock.c
@@ -245,7 +245,7 @@ int cmtp_init_sockets(void)
245 goto error; 245 goto error;
246 } 246 }
247 247
248 err = bt_procfs_init(THIS_MODULE, &init_net, "cmtp", &cmtp_sk_list, NULL); 248 err = bt_procfs_init(&init_net, "cmtp", &cmtp_sk_list, NULL);
249 if (err < 0) { 249 if (err < 0) {
250 BT_ERR("Failed to create CMTP proc file"); 250 BT_ERR("Failed to create CMTP proc file");
251 bt_sock_unregister(BTPROTO_HIDP); 251 bt_sock_unregister(BTPROTO_HIDP);
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index aa4354fca77c..9bd7d959e384 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -1107,7 +1107,7 @@ int __init hci_sock_init(void)
1107 goto error; 1107 goto error;
1108 } 1108 }
1109 1109
1110 err = bt_procfs_init(THIS_MODULE, &init_net, "hci", &hci_sk_list, NULL); 1110 err = bt_procfs_init(&init_net, "hci", &hci_sk_list, NULL);
1111 if (err < 0) { 1111 if (err < 0) {
1112 BT_ERR("Failed to create HCI proc file"); 1112 BT_ERR("Failed to create HCI proc file");
1113 bt_sock_unregister(BTPROTO_HCI); 1113 bt_sock_unregister(BTPROTO_HCI);
diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c
index 2f4cbb0865ca..cb3fdde1968a 100644
--- a/net/bluetooth/hidp/sock.c
+++ b/net/bluetooth/hidp/sock.c
@@ -275,7 +275,7 @@ int __init hidp_init_sockets(void)
275 goto error; 275 goto error;
276 } 276 }
277 277
278 err = bt_procfs_init(THIS_MODULE, &init_net, "hidp", &hidp_sk_list, NULL); 278 err = bt_procfs_init(&init_net, "hidp", &hidp_sk_list, NULL);
279 if (err < 0) { 279 if (err < 0) {
280 BT_ERR("Failed to create HIDP proc file"); 280 BT_ERR("Failed to create HIDP proc file");
281 bt_sock_unregister(BTPROTO_HIDP); 281 bt_sock_unregister(BTPROTO_HIDP);
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 141e7b058b7e..36fed40c162c 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1298,7 +1298,7 @@ int __init l2cap_init_sockets(void)
1298 goto error; 1298 goto error;
1299 } 1299 }
1300 1300
1301 err = bt_procfs_init(THIS_MODULE, &init_net, "l2cap", &l2cap_sk_list, 1301 err = bt_procfs_init(&init_net, "l2cap", &l2cap_sk_list,
1302 NULL); 1302 NULL);
1303 if (err < 0) { 1303 if (err < 0) {
1304 BT_ERR("Failed to create L2CAP proc file"); 1304 BT_ERR("Failed to create L2CAP proc file");
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index a8638b58c4bf..30b3721dc6d7 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -1037,7 +1037,7 @@ int __init rfcomm_init_sockets(void)
1037 goto error; 1037 goto error;
1038 } 1038 }
1039 1039
1040 err = bt_procfs_init(THIS_MODULE, &init_net, "rfcomm", &rfcomm_sk_list, NULL); 1040 err = bt_procfs_init(&init_net, "rfcomm", &rfcomm_sk_list, NULL);
1041 if (err < 0) { 1041 if (err < 0) {
1042 BT_ERR("Failed to create RFCOMM proc file"); 1042 BT_ERR("Failed to create RFCOMM proc file");
1043 bt_sock_unregister(BTPROTO_RFCOMM); 1043 bt_sock_unregister(BTPROTO_RFCOMM);
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 373d81e6e8f0..e7bd4eea575c 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -1119,7 +1119,7 @@ int __init sco_init(void)
1119 goto error; 1119 goto error;
1120 } 1120 }
1121 1121
1122 err = bt_procfs_init(THIS_MODULE, &init_net, "sco", &sco_sk_list, NULL); 1122 err = bt_procfs_init(&init_net, "sco", &sco_sk_list, NULL);
1123 if (err < 0) { 1123 if (err < 0) {
1124 BT_ERR("Failed to create SCO proc file"); 1124 BT_ERR("Failed to create SCO proc file");
1125 bt_sock_unregister(BTPROTO_SCO); 1125 bt_sock_unregister(BTPROTO_SCO);
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 5dcb20076f39..8f113e6ff327 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -226,7 +226,7 @@ static int bcm_proc_show(struct seq_file *m, void *v)
226 226
227static int bcm_proc_open(struct inode *inode, struct file *file) 227static int bcm_proc_open(struct inode *inode, struct file *file)
228{ 228{
229 return single_open(file, bcm_proc_show, PDE(inode)->data); 229 return single_open(file, bcm_proc_show, PDE_DATA(inode));
230} 230}
231 231
232static const struct file_operations bcm_proc_fops = { 232static const struct file_operations bcm_proc_fops = {
diff --git a/net/can/proc.c b/net/can/proc.c
index 1ab8c888f102..b543470c8f8b 100644
--- a/net/can/proc.c
+++ b/net/can/proc.c
@@ -378,7 +378,7 @@ static int can_rcvlist_proc_show(struct seq_file *m, void *v)
378 378
379static int can_rcvlist_proc_open(struct inode *inode, struct file *file) 379static int can_rcvlist_proc_open(struct inode *inode, struct file *file)
380{ 380{
381 return single_open(file, can_rcvlist_proc_show, PDE(inode)->data); 381 return single_open(file, can_rcvlist_proc_show, PDE_DATA(inode));
382} 382}
383 383
384static const struct file_operations can_rcvlist_proc_fops = { 384static const struct file_operations can_rcvlist_proc_fops = {
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 89a3a07d85fb..5c56b217b999 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2705,7 +2705,7 @@ static int neigh_stat_seq_open(struct inode *inode, struct file *file)
2705 2705
2706 if (!ret) { 2706 if (!ret) {
2707 struct seq_file *sf = file->private_data; 2707 struct seq_file *sf = file->private_data;
2708 sf->private = PDE(inode)->data; 2708 sf->private = PDE_DATA(inode);
2709 } 2709 }
2710 return ret; 2710 return ret;
2711}; 2711};
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 80e271d9e64b..f97652036754 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -10,7 +10,8 @@
10#include <linux/idr.h> 10#include <linux/idr.h>
11#include <linux/rculist.h> 11#include <linux/rculist.h>
12#include <linux/nsproxy.h> 12#include <linux/nsproxy.h>
13#include <linux/proc_fs.h> 13#include <linux/fs.h>
14#include <linux/proc_ns.h>
14#include <linux/file.h> 15#include <linux/file.h>
15#include <linux/export.h> 16#include <linux/export.h>
16#include <linux/user_namespace.h> 17#include <linux/user_namespace.h>
@@ -336,7 +337,7 @@ EXPORT_SYMBOL_GPL(__put_net);
336 337
337struct net *get_net_ns_by_fd(int fd) 338struct net *get_net_ns_by_fd(int fd)
338{ 339{
339 struct proc_inode *ei; 340 struct proc_ns *ei;
340 struct file *file; 341 struct file *file;
341 struct net *net; 342 struct net *net;
342 343
@@ -344,7 +345,7 @@ struct net *get_net_ns_by_fd(int fd)
344 if (IS_ERR(file)) 345 if (IS_ERR(file))
345 return ERR_CAST(file); 346 return ERR_CAST(file);
346 347
347 ei = PROC_I(file_inode(file)); 348 ei = get_proc_ns(file_inode(file));
348 if (ei->ns_ops == &netns_operations) 349 if (ei->ns_ops == &netns_operations)
349 net = get_net(ei->ns); 350 net = get_net(ei->ns);
350 else 351 else
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 5c217427a669..11f2704c3810 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -508,7 +508,7 @@ out:
508 508
509static int pgctrl_open(struct inode *inode, struct file *file) 509static int pgctrl_open(struct inode *inode, struct file *file)
510{ 510{
511 return single_open(file, pgctrl_show, PDE(inode)->data); 511 return single_open(file, pgctrl_show, PDE_DATA(inode));
512} 512}
513 513
514static const struct file_operations pktgen_fops = { 514static const struct file_operations pktgen_fops = {
@@ -1685,7 +1685,7 @@ static ssize_t pktgen_if_write(struct file *file,
1685 1685
1686static int pktgen_if_open(struct inode *inode, struct file *file) 1686static int pktgen_if_open(struct inode *inode, struct file *file)
1687{ 1687{
1688 return single_open(file, pktgen_if_show, PDE(inode)->data); 1688 return single_open(file, pktgen_if_show, PDE_DATA(inode));
1689} 1689}
1690 1690
1691static const struct file_operations pktgen_if_fops = { 1691static const struct file_operations pktgen_if_fops = {
@@ -1823,7 +1823,7 @@ out:
1823 1823
1824static int pktgen_thread_open(struct inode *inode, struct file *file) 1824static int pktgen_thread_open(struct inode *inode, struct file *file)
1825{ 1825{
1826 return single_open(file, pktgen_thread_show, PDE(inode)->data); 1826 return single_open(file, pktgen_thread_show, PDE_DATA(inode));
1827} 1827}
1828 1828
1829static const struct file_operations pktgen_thread_fops = { 1829static const struct file_operations pktgen_thread_fops = {
@@ -1904,7 +1904,7 @@ static void pktgen_change_name(const struct pktgen_net *pn, struct net_device *d
1904 if (pkt_dev->odev != dev) 1904 if (pkt_dev->odev != dev)
1905 continue; 1905 continue;
1906 1906
1907 remove_proc_entry(pkt_dev->entry->name, pn->proc_dir); 1907 proc_remove(pkt_dev->entry);
1908 1908
1909 pkt_dev->entry = proc_create_data(dev->name, 0600, 1909 pkt_dev->entry = proc_create_data(dev->name, 0600,
1910 pn->proc_dir, 1910 pn->proc_dir,
@@ -3574,8 +3574,6 @@ static void _rem_dev_from_if_list(struct pktgen_thread *t,
3574static int pktgen_remove_device(struct pktgen_thread *t, 3574static int pktgen_remove_device(struct pktgen_thread *t,
3575 struct pktgen_dev *pkt_dev) 3575 struct pktgen_dev *pkt_dev)
3576{ 3576{
3577 struct pktgen_net *pn = t->net;
3578
3579 pr_debug("remove_device pkt_dev=%p\n", pkt_dev); 3577 pr_debug("remove_device pkt_dev=%p\n", pkt_dev);
3580 3578
3581 if (pkt_dev->running) { 3579 if (pkt_dev->running) {
@@ -3595,7 +3593,7 @@ static int pktgen_remove_device(struct pktgen_thread *t,
3595 _rem_dev_from_if_list(t, pkt_dev); 3593 _rem_dev_from_if_list(t, pkt_dev);
3596 3594
3597 if (pkt_dev->entry) 3595 if (pkt_dev->entry)
3598 remove_proc_entry(pkt_dev->entry->name, pn->proc_dir); 3596 proc_remove(pkt_dev->entry);
3599 3597
3600#ifdef CONFIG_XFRM 3598#ifdef CONFIG_XFRM
3601 free_SAs(pkt_dev); 3599 free_SAs(pkt_dev);
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 5852b249054f..0b732efd32e2 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -105,7 +105,7 @@ clusterip_config_entry_put(struct clusterip_config *c)
105 * functions are also incrementing the refcount on their own, 105 * functions are also incrementing the refcount on their own,
106 * so it's safe to remove the entry even if it's in use. */ 106 * so it's safe to remove the entry even if it's in use. */
107#ifdef CONFIG_PROC_FS 107#ifdef CONFIG_PROC_FS
108 remove_proc_entry(c->pde->name, c->pde->parent); 108 proc_remove(c->pde);
109#endif 109#endif
110 return; 110 return;
111 } 111 }
@@ -631,7 +631,7 @@ static int clusterip_proc_open(struct inode *inode, struct file *file)
631 631
632 if (!ret) { 632 if (!ret) {
633 struct seq_file *sf = file->private_data; 633 struct seq_file *sf = file->private_data;
634 struct clusterip_config *c = PDE(inode)->data; 634 struct clusterip_config *c = PDE_DATA(inode);
635 635
636 sf->private = c; 636 sf->private = c;
637 637
@@ -643,7 +643,7 @@ static int clusterip_proc_open(struct inode *inode, struct file *file)
643 643
644static int clusterip_proc_release(struct inode *inode, struct file *file) 644static int clusterip_proc_release(struct inode *inode, struct file *file)
645{ 645{
646 struct clusterip_config *c = PDE(inode)->data; 646 struct clusterip_config *c = PDE_DATA(inode);
647 int ret; 647 int ret;
648 648
649 ret = seq_release(inode, file); 649 ret = seq_release(inode, file);
@@ -657,7 +657,7 @@ static int clusterip_proc_release(struct inode *inode, struct file *file)
657static ssize_t clusterip_proc_write(struct file *file, const char __user *input, 657static ssize_t clusterip_proc_write(struct file *file, const char __user *input,
658 size_t size, loff_t *ofs) 658 size_t size, loff_t *ofs)
659{ 659{
660 struct clusterip_config *c = PDE(file_inode(file))->data; 660 struct clusterip_config *c = PDE_DATA(file_inode(file));
661#define PROC_WRITELEN 10 661#define PROC_WRITELEN 10
662 char buffer[PROC_WRITELEN+1]; 662 char buffer[PROC_WRITELEN+1];
663 unsigned long nodenum; 663 unsigned long nodenum;
@@ -736,7 +736,7 @@ static void __exit clusterip_tg_exit(void)
736{ 736{
737 pr_info("ClusterIP Version %s unloading\n", CLUSTERIP_VERSION); 737 pr_info("ClusterIP Version %s unloading\n", CLUSTERIP_VERSION);
738#ifdef CONFIG_PROC_FS 738#ifdef CONFIG_PROC_FS
739 remove_proc_entry(clusterip_procdir->name, clusterip_procdir->parent); 739 proc_remove(clusterip_procdir);
740#endif 740#endif
741 nf_unregister_hook(&cip_arp_ops); 741 nf_unregister_hook(&cip_arp_ops);
742 xt_unregister_target(&clusterip_tg_reg); 742 xt_unregister_target(&clusterip_tg_reg);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index d979657b8a12..719652305a29 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2583,7 +2583,7 @@ static void tcp_seq_stop(struct seq_file *seq, void *v)
2583 2583
2584int tcp_seq_open(struct inode *inode, struct file *file) 2584int tcp_seq_open(struct inode *inode, struct file *file)
2585{ 2585{
2586 struct tcp_seq_afinfo *afinfo = PDE(inode)->data; 2586 struct tcp_seq_afinfo *afinfo = PDE_DATA(inode);
2587 struct tcp_iter_state *s; 2587 struct tcp_iter_state *s;
2588 int err; 2588 int err;
2589 2589
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 3159d16441d0..6abbe6455129 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2100,7 +2100,7 @@ static void udp_seq_stop(struct seq_file *seq, void *v)
2100 2100
2101int udp_seq_open(struct inode *inode, struct file *file) 2101int udp_seq_open(struct inode *inode, struct file *file)
2102{ 2102{
2103 struct udp_seq_afinfo *afinfo = PDE(inode)->data; 2103 struct udp_seq_afinfo *afinfo = PDE_DATA(inode);
2104 struct udp_iter_state *s; 2104 struct udp_iter_state *s;
2105 int err; 2105 int err;
2106 2106
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 115cc58898f5..f3c1ff4357ff 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -251,7 +251,7 @@ static int snmp6_dev_seq_show(struct seq_file *seq, void *v)
251 251
252static int snmp6_dev_seq_open(struct inode *inode, struct file *file) 252static int snmp6_dev_seq_open(struct inode *inode, struct file *file)
253{ 253{
254 return single_open(file, snmp6_dev_seq_show, PDE(inode)->data); 254 return single_open(file, snmp6_dev_seq_show, PDE_DATA(inode));
255} 255}
256 256
257static const struct file_operations snmp6_dev_seq_fops = { 257static const struct file_operations snmp6_dev_seq_fops = {
@@ -291,8 +291,7 @@ int snmp6_unregister_dev(struct inet6_dev *idev)
291 return -ENOENT; 291 return -ENOENT;
292 if (!idev->stats.proc_dir_entry) 292 if (!idev->stats.proc_dir_entry)
293 return -EINVAL; 293 return -EINVAL;
294 remove_proc_entry(idev->stats.proc_dir_entry->name, 294 proc_remove(idev->stats.proc_dir_entry);
295 net->mib.proc_net_devsnmp6);
296 idev->stats.proc_dir_entry = NULL; 295 idev->stats.proc_dir_entry = NULL;
297 return 0; 296 return 0;
298} 297}
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 1a73b18683b6..8b03028cca69 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -1000,7 +1000,7 @@ static int xt_table_open(struct inode *inode, struct file *file)
1000 sizeof(struct xt_names_priv)); 1000 sizeof(struct xt_names_priv));
1001 if (!ret) { 1001 if (!ret) {
1002 priv = ((struct seq_file *)file->private_data)->private; 1002 priv = ((struct seq_file *)file->private_data)->private;
1003 priv->af = (unsigned long)PDE(inode)->data; 1003 priv->af = (unsigned long)PDE_DATA(inode);
1004 } 1004 }
1005 return ret; 1005 return ret;
1006} 1006}
@@ -1148,7 +1148,7 @@ static int xt_match_open(struct inode *inode, struct file *file)
1148 1148
1149 seq = file->private_data; 1149 seq = file->private_data;
1150 seq->private = trav; 1150 seq->private = trav;
1151 trav->nfproto = (unsigned long)PDE(inode)->data; 1151 trav->nfproto = (unsigned long)PDE_DATA(inode);
1152 return 0; 1152 return 0;
1153} 1153}
1154 1154
@@ -1212,7 +1212,7 @@ static int xt_target_open(struct inode *inode, struct file *file)
1212 1212
1213 seq = file->private_data; 1213 seq = file->private_data;
1214 seq->private = trav; 1214 seq->private = trav;
1215 trav->nfproto = (unsigned long)PDE(inode)->data; 1215 trav->nfproto = (unsigned long)PDE_DATA(inode);
1216 return 0; 1216 return 0;
1217} 1217}
1218 1218
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 0199e7bb8f81..9ff035c71403 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -108,6 +108,7 @@ struct xt_hashlimit_htable {
108 108
109 /* seq_file stuff */ 109 /* seq_file stuff */
110 struct proc_dir_entry *pde; 110 struct proc_dir_entry *pde;
111 const char *name;
111 struct net *net; 112 struct net *net;
112 113
113 struct hlist_head hash[0]; /* hashtable itself */ 114 struct hlist_head hash[0]; /* hashtable itself */
@@ -254,6 +255,11 @@ static int htable_create(struct net *net, struct xt_hashlimit_mtinfo1 *minfo,
254 hinfo->count = 0; 255 hinfo->count = 0;
255 hinfo->family = family; 256 hinfo->family = family;
256 hinfo->rnd_initialized = false; 257 hinfo->rnd_initialized = false;
258 hinfo->name = kstrdup(minfo->name, GFP_KERNEL);
259 if (!hinfo->name) {
260 vfree(hinfo);
261 return -ENOMEM;
262 }
257 spin_lock_init(&hinfo->lock); 263 spin_lock_init(&hinfo->lock);
258 264
259 hinfo->pde = proc_create_data(minfo->name, 0, 265 hinfo->pde = proc_create_data(minfo->name, 0,
@@ -261,6 +267,7 @@ static int htable_create(struct net *net, struct xt_hashlimit_mtinfo1 *minfo,
261 hashlimit_net->ipt_hashlimit : hashlimit_net->ip6t_hashlimit, 267 hashlimit_net->ipt_hashlimit : hashlimit_net->ip6t_hashlimit,
262 &dl_file_ops, hinfo); 268 &dl_file_ops, hinfo);
263 if (hinfo->pde == NULL) { 269 if (hinfo->pde == NULL) {
270 kfree(hinfo->name);
264 vfree(hinfo); 271 vfree(hinfo);
265 return -ENOMEM; 272 return -ENOMEM;
266 } 273 }
@@ -331,9 +338,10 @@ static void htable_destroy(struct xt_hashlimit_htable *hinfo)
331 parent = hashlimit_net->ip6t_hashlimit; 338 parent = hashlimit_net->ip6t_hashlimit;
332 339
333 if(parent != NULL) 340 if(parent != NULL)
334 remove_proc_entry(hinfo->pde->name, parent); 341 remove_proc_entry(hinfo->name, parent);
335 342
336 htable_selective_cleanup(hinfo, select_all); 343 htable_selective_cleanup(hinfo, select_all);
344 kfree(hinfo->name);
337 vfree(hinfo); 345 vfree(hinfo);
338} 346}
339 347
@@ -345,7 +353,7 @@ static struct xt_hashlimit_htable *htable_find_get(struct net *net,
345 struct xt_hashlimit_htable *hinfo; 353 struct xt_hashlimit_htable *hinfo;
346 354
347 hlist_for_each_entry(hinfo, &hashlimit_net->htables, node) { 355 hlist_for_each_entry(hinfo, &hashlimit_net->htables, node) {
348 if (!strcmp(name, hinfo->pde->name) && 356 if (!strcmp(name, hinfo->name) &&
349 hinfo->family == family) { 357 hinfo->family == family) {
350 hinfo->use++; 358 hinfo->use++;
351 return hinfo; 359 return hinfo;
@@ -842,7 +850,7 @@ static int dl_proc_open(struct inode *inode, struct file *file)
842 850
843 if (!ret) { 851 if (!ret) {
844 struct seq_file *sf = file->private_data; 852 struct seq_file *sf = file->private_data;
845 sf->private = PDE(inode)->data; 853 sf->private = PDE_DATA(inode);
846 } 854 }
847 return ret; 855 return ret;
848} 856}
@@ -888,7 +896,7 @@ static void __net_exit hashlimit_proc_net_exit(struct net *net)
888 pde = hashlimit_net->ip6t_hashlimit; 896 pde = hashlimit_net->ip6t_hashlimit;
889 897
890 hlist_for_each_entry(hinfo, &hashlimit_net->htables, node) 898 hlist_for_each_entry(hinfo, &hashlimit_net->htables, node)
891 remove_proc_entry(hinfo->pde->name, pde); 899 remove_proc_entry(hinfo->name, pde);
892 900
893 hashlimit_net->ipt_hashlimit = NULL; 901 hashlimit_net->ipt_hashlimit = NULL;
894 hashlimit_net->ip6t_hashlimit = NULL; 902 hashlimit_net->ip6t_hashlimit = NULL;
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index d9cad315229d..1e657cf715c4 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -401,8 +401,7 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
401 ret = -ENOMEM; 401 ret = -ENOMEM;
402 goto out; 402 goto out;
403 } 403 }
404 pde->uid = uid; 404 proc_set_user(pde, uid, gid);
405 pde->gid = gid;
406#endif 405#endif
407 spin_lock_bh(&recent_lock); 406 spin_lock_bh(&recent_lock);
408 list_add_tail(&t->list, &recent_net->tables); 407 list_add_tail(&t->list, &recent_net->tables);
@@ -525,14 +524,13 @@ static const struct seq_operations recent_seq_ops = {
525 524
526static int recent_seq_open(struct inode *inode, struct file *file) 525static int recent_seq_open(struct inode *inode, struct file *file)
527{ 526{
528 struct proc_dir_entry *pde = PDE(inode);
529 struct recent_iter_state *st; 527 struct recent_iter_state *st;
530 528
531 st = __seq_open_private(file, &recent_seq_ops, sizeof(*st)); 529 st = __seq_open_private(file, &recent_seq_ops, sizeof(*st));
532 if (st == NULL) 530 if (st == NULL)
533 return -ENOMEM; 531 return -ENOMEM;
534 532
535 st->table = pde->data; 533 st->table = PDE_DATA(inode);
536 return 0; 534 return 0;
537} 535}
538 536
@@ -540,8 +538,7 @@ static ssize_t
540recent_mt_proc_write(struct file *file, const char __user *input, 538recent_mt_proc_write(struct file *file, const char __user *input,
541 size_t size, loff_t *loff) 539 size_t size, loff_t *loff)
542{ 540{
543 const struct proc_dir_entry *pde = PDE(file_inode(file)); 541 struct recent_table *t = PDE_DATA(file_inode(file));
544 struct recent_table *t = pde->data;
545 struct recent_entry *e; 542 struct recent_entry *e;
546 char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")]; 543 char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")];
547 const char *c = buf; 544 const char *c = buf;
diff --git a/net/socket.c b/net/socket.c
index 280283f03ccc..b416093997da 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1160,15 +1160,6 @@ static int sock_mmap(struct file *file, struct vm_area_struct *vma)
1160 1160
1161static int sock_close(struct inode *inode, struct file *filp) 1161static int sock_close(struct inode *inode, struct file *filp)
1162{ 1162{
1163 /*
1164 * It was possible the inode is NULL we were
1165 * closing an unfinished socket.
1166 */
1167
1168 if (!inode) {
1169 printk(KERN_DEBUG "sock_close: NULL inode\n");
1170 return 0;
1171 }
1172 sock_release(SOCKET_I(inode)); 1163 sock_release(SOCKET_I(inode));
1173 return 0; 1164 return 0;
1174} 1165}
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index ce2d180d05a4..f1889be80912 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1460,7 +1460,7 @@ static ssize_t write_flush(struct file *file, const char __user *buf,
1460static ssize_t cache_read_procfs(struct file *filp, char __user *buf, 1460static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
1461 size_t count, loff_t *ppos) 1461 size_t count, loff_t *ppos)
1462{ 1462{
1463 struct cache_detail *cd = PDE(file_inode(filp))->data; 1463 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1464 1464
1465 return cache_read(filp, buf, count, ppos, cd); 1465 return cache_read(filp, buf, count, ppos, cd);
1466} 1466}
@@ -1468,14 +1468,14 @@ static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
1468static ssize_t cache_write_procfs(struct file *filp, const char __user *buf, 1468static ssize_t cache_write_procfs(struct file *filp, const char __user *buf,
1469 size_t count, loff_t *ppos) 1469 size_t count, loff_t *ppos)
1470{ 1470{
1471 struct cache_detail *cd = PDE(file_inode(filp))->data; 1471 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1472 1472
1473 return cache_write(filp, buf, count, ppos, cd); 1473 return cache_write(filp, buf, count, ppos, cd);
1474} 1474}
1475 1475
1476static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait) 1476static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
1477{ 1477{
1478 struct cache_detail *cd = PDE(file_inode(filp))->data; 1478 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1479 1479
1480 return cache_poll(filp, wait, cd); 1480 return cache_poll(filp, wait, cd);
1481} 1481}
@@ -1484,21 +1484,21 @@ static long cache_ioctl_procfs(struct file *filp,
1484 unsigned int cmd, unsigned long arg) 1484 unsigned int cmd, unsigned long arg)
1485{ 1485{
1486 struct inode *inode = file_inode(filp); 1486 struct inode *inode = file_inode(filp);
1487 struct cache_detail *cd = PDE(inode)->data; 1487 struct cache_detail *cd = PDE_DATA(inode);
1488 1488
1489 return cache_ioctl(inode, filp, cmd, arg, cd); 1489 return cache_ioctl(inode, filp, cmd, arg, cd);
1490} 1490}
1491 1491
1492static int cache_open_procfs(struct inode *inode, struct file *filp) 1492static int cache_open_procfs(struct inode *inode, struct file *filp)
1493{ 1493{
1494 struct cache_detail *cd = PDE(inode)->data; 1494 struct cache_detail *cd = PDE_DATA(inode);
1495 1495
1496 return cache_open(inode, filp, cd); 1496 return cache_open(inode, filp, cd);
1497} 1497}
1498 1498
1499static int cache_release_procfs(struct inode *inode, struct file *filp) 1499static int cache_release_procfs(struct inode *inode, struct file *filp)
1500{ 1500{
1501 struct cache_detail *cd = PDE(inode)->data; 1501 struct cache_detail *cd = PDE_DATA(inode);
1502 1502
1503 return cache_release(inode, filp, cd); 1503 return cache_release(inode, filp, cd);
1504} 1504}
@@ -1516,14 +1516,14 @@ static const struct file_operations cache_file_operations_procfs = {
1516 1516
1517static int content_open_procfs(struct inode *inode, struct file *filp) 1517static int content_open_procfs(struct inode *inode, struct file *filp)
1518{ 1518{
1519 struct cache_detail *cd = PDE(inode)->data; 1519 struct cache_detail *cd = PDE_DATA(inode);
1520 1520
1521 return content_open(inode, filp, cd); 1521 return content_open(inode, filp, cd);
1522} 1522}
1523 1523
1524static int content_release_procfs(struct inode *inode, struct file *filp) 1524static int content_release_procfs(struct inode *inode, struct file *filp)
1525{ 1525{
1526 struct cache_detail *cd = PDE(inode)->data; 1526 struct cache_detail *cd = PDE_DATA(inode);
1527 1527
1528 return content_release(inode, filp, cd); 1528 return content_release(inode, filp, cd);
1529} 1529}
@@ -1537,14 +1537,14 @@ static const struct file_operations content_file_operations_procfs = {
1537 1537
1538static int open_flush_procfs(struct inode *inode, struct file *filp) 1538static int open_flush_procfs(struct inode *inode, struct file *filp)
1539{ 1539{
1540 struct cache_detail *cd = PDE(inode)->data; 1540 struct cache_detail *cd = PDE_DATA(inode);
1541 1541
1542 return open_flush(inode, filp, cd); 1542 return open_flush(inode, filp, cd);
1543} 1543}
1544 1544
1545static int release_flush_procfs(struct inode *inode, struct file *filp) 1545static int release_flush_procfs(struct inode *inode, struct file *filp)
1546{ 1546{
1547 struct cache_detail *cd = PDE(inode)->data; 1547 struct cache_detail *cd = PDE_DATA(inode);
1548 1548
1549 return release_flush(inode, filp, cd); 1549 return release_flush(inode, filp, cd);
1550} 1550}
@@ -1552,7 +1552,7 @@ static int release_flush_procfs(struct inode *inode, struct file *filp)
1552static ssize_t read_flush_procfs(struct file *filp, char __user *buf, 1552static ssize_t read_flush_procfs(struct file *filp, char __user *buf,
1553 size_t count, loff_t *ppos) 1553 size_t count, loff_t *ppos)
1554{ 1554{
1555 struct cache_detail *cd = PDE(file_inode(filp))->data; 1555 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1556 1556
1557 return read_flush(filp, buf, count, ppos, cd); 1557 return read_flush(filp, buf, count, ppos, cd);
1558} 1558}
@@ -1561,7 +1561,7 @@ static ssize_t write_flush_procfs(struct file *filp,
1561 const char __user *buf, 1561 const char __user *buf,
1562 size_t count, loff_t *ppos) 1562 size_t count, loff_t *ppos)
1563{ 1563{
1564 struct cache_detail *cd = PDE(file_inode(filp))->data; 1564 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1565 1565
1566 return write_flush(filp, buf, count, ppos, cd); 1566 return write_flush(filp, buf, count, ppos, cd);
1567} 1567}
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index bc2068ee795b..21b75cb08c03 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -64,7 +64,7 @@ static int rpc_proc_show(struct seq_file *seq, void *v) {
64 64
65static int rpc_proc_open(struct inode *inode, struct file *file) 65static int rpc_proc_open(struct inode *inode, struct file *file)
66{ 66{
67 return single_open(file, rpc_proc_show, PDE(inode)->data); 67 return single_open(file, rpc_proc_show, PDE_DATA(inode));
68} 68}
69 69
70static const struct file_operations rpc_proc_fops = { 70static const struct file_operations rpc_proc_fops = {
diff --git a/net/wireless/lib80211_crypt_ccmp.c b/net/wireless/lib80211_crypt_ccmp.c
index 1526c211db66..dc0e59e53dbf 100644
--- a/net/wireless/lib80211_crypt_ccmp.c
+++ b/net/wireless/lib80211_crypt_ccmp.c
@@ -430,24 +430,23 @@ static int lib80211_ccmp_get_key(void *key, int len, u8 * seq, void *priv)
430 return CCMP_TK_LEN; 430 return CCMP_TK_LEN;
431} 431}
432 432
433static char *lib80211_ccmp_print_stats(char *p, void *priv) 433static void lib80211_ccmp_print_stats(struct seq_file *m, void *priv)
434{ 434{
435 struct lib80211_ccmp_data *ccmp = priv; 435 struct lib80211_ccmp_data *ccmp = priv;
436 436
437 p += sprintf(p, "key[%d] alg=CCMP key_set=%d " 437 seq_printf(m,
438 "tx_pn=%02x%02x%02x%02x%02x%02x " 438 "key[%d] alg=CCMP key_set=%d "
439 "rx_pn=%02x%02x%02x%02x%02x%02x " 439 "tx_pn=%02x%02x%02x%02x%02x%02x "
440 "format_errors=%d replays=%d decrypt_errors=%d\n", 440 "rx_pn=%02x%02x%02x%02x%02x%02x "
441 ccmp->key_idx, ccmp->key_set, 441 "format_errors=%d replays=%d decrypt_errors=%d\n",
442 ccmp->tx_pn[0], ccmp->tx_pn[1], ccmp->tx_pn[2], 442 ccmp->key_idx, ccmp->key_set,
443 ccmp->tx_pn[3], ccmp->tx_pn[4], ccmp->tx_pn[5], 443 ccmp->tx_pn[0], ccmp->tx_pn[1], ccmp->tx_pn[2],
444 ccmp->rx_pn[0], ccmp->rx_pn[1], ccmp->rx_pn[2], 444 ccmp->tx_pn[3], ccmp->tx_pn[4], ccmp->tx_pn[5],
445 ccmp->rx_pn[3], ccmp->rx_pn[4], ccmp->rx_pn[5], 445 ccmp->rx_pn[0], ccmp->rx_pn[1], ccmp->rx_pn[2],
446 ccmp->dot11RSNAStatsCCMPFormatErrors, 446 ccmp->rx_pn[3], ccmp->rx_pn[4], ccmp->rx_pn[5],
447 ccmp->dot11RSNAStatsCCMPReplays, 447 ccmp->dot11RSNAStatsCCMPFormatErrors,
448 ccmp->dot11RSNAStatsCCMPDecryptErrors); 448 ccmp->dot11RSNAStatsCCMPReplays,
449 449 ccmp->dot11RSNAStatsCCMPDecryptErrors);
450 return p;
451} 450}
452 451
453static struct lib80211_crypto_ops lib80211_crypt_ccmp = { 452static struct lib80211_crypto_ops lib80211_crypt_ccmp = {
diff --git a/net/wireless/lib80211_crypt_tkip.c b/net/wireless/lib80211_crypt_tkip.c
index d475cfc8568f..8c90ba79e56e 100644
--- a/net/wireless/lib80211_crypt_tkip.c
+++ b/net/wireless/lib80211_crypt_tkip.c
@@ -703,30 +703,30 @@ static int lib80211_tkip_get_key(void *key, int len, u8 * seq, void *priv)
703 return TKIP_KEY_LEN; 703 return TKIP_KEY_LEN;
704} 704}
705 705
706static char *lib80211_tkip_print_stats(char *p, void *priv) 706static void lib80211_tkip_print_stats(struct seq_file *m, void *priv)
707{ 707{
708 struct lib80211_tkip_data *tkip = priv; 708 struct lib80211_tkip_data *tkip = priv;
709 p += sprintf(p, "key[%d] alg=TKIP key_set=%d " 709 seq_printf(m,
710 "tx_pn=%02x%02x%02x%02x%02x%02x " 710 "key[%d] alg=TKIP key_set=%d "
711 "rx_pn=%02x%02x%02x%02x%02x%02x " 711 "tx_pn=%02x%02x%02x%02x%02x%02x "
712 "replays=%d icv_errors=%d local_mic_failures=%d\n", 712 "rx_pn=%02x%02x%02x%02x%02x%02x "
713 tkip->key_idx, tkip->key_set, 713 "replays=%d icv_errors=%d local_mic_failures=%d\n",
714 (tkip->tx_iv32 >> 24) & 0xff, 714 tkip->key_idx, tkip->key_set,
715 (tkip->tx_iv32 >> 16) & 0xff, 715 (tkip->tx_iv32 >> 24) & 0xff,
716 (tkip->tx_iv32 >> 8) & 0xff, 716 (tkip->tx_iv32 >> 16) & 0xff,
717 tkip->tx_iv32 & 0xff, 717 (tkip->tx_iv32 >> 8) & 0xff,
718 (tkip->tx_iv16 >> 8) & 0xff, 718 tkip->tx_iv32 & 0xff,
719 tkip->tx_iv16 & 0xff, 719 (tkip->tx_iv16 >> 8) & 0xff,
720 (tkip->rx_iv32 >> 24) & 0xff, 720 tkip->tx_iv16 & 0xff,
721 (tkip->rx_iv32 >> 16) & 0xff, 721 (tkip->rx_iv32 >> 24) & 0xff,
722 (tkip->rx_iv32 >> 8) & 0xff, 722 (tkip->rx_iv32 >> 16) & 0xff,
723 tkip->rx_iv32 & 0xff, 723 (tkip->rx_iv32 >> 8) & 0xff,
724 (tkip->rx_iv16 >> 8) & 0xff, 724 tkip->rx_iv32 & 0xff,
725 tkip->rx_iv16 & 0xff, 725 (tkip->rx_iv16 >> 8) & 0xff,
726 tkip->dot11RSNAStatsTKIPReplays, 726 tkip->rx_iv16 & 0xff,
727 tkip->dot11RSNAStatsTKIPICVErrors, 727 tkip->dot11RSNAStatsTKIPReplays,
728 tkip->dot11RSNAStatsTKIPLocalMICFailures); 728 tkip->dot11RSNAStatsTKIPICVErrors,
729 return p; 729 tkip->dot11RSNAStatsTKIPLocalMICFailures);
730} 730}
731 731
732static struct lib80211_crypto_ops lib80211_crypt_tkip = { 732static struct lib80211_crypto_ops lib80211_crypt_tkip = {
diff --git a/net/wireless/lib80211_crypt_wep.c b/net/wireless/lib80211_crypt_wep.c
index c1304018fc1c..1c292e4ea7b6 100644
--- a/net/wireless/lib80211_crypt_wep.c
+++ b/net/wireless/lib80211_crypt_wep.c
@@ -253,11 +253,10 @@ static int lib80211_wep_get_key(void *key, int len, u8 * seq, void *priv)
253 return wep->key_len; 253 return wep->key_len;
254} 254}
255 255
256static char *lib80211_wep_print_stats(char *p, void *priv) 256static void lib80211_wep_print_stats(struct seq_file *m, void *priv)
257{ 257{
258 struct lib80211_wep_data *wep = priv; 258 struct lib80211_wep_data *wep = priv;
259 p += sprintf(p, "key[%d] alg=WEP len=%d\n", wep->key_idx, wep->key_len); 259 seq_printf(m, "key[%d] alg=WEP len=%d\n", wep->key_idx, wep->key_len);
260 return p;
261} 260}
262 261
263static struct lib80211_crypto_ops lib80211_crypt_wep = { 262static struct lib80211_crypto_ops lib80211_crypt_wep = {
diff --git a/net/x25/x25_proc.c b/net/x25/x25_proc.c
index 2ffde4631ae2..0917f047f2cf 100644
--- a/net/x25/x25_proc.c
+++ b/net/x25/x25_proc.c
@@ -187,7 +187,6 @@ static int x25_seq_forward_open(struct inode *inode, struct file *file)
187} 187}
188 188
189static const struct file_operations x25_seq_socket_fops = { 189static const struct file_operations x25_seq_socket_fops = {
190 .owner = THIS_MODULE,
191 .open = x25_seq_socket_open, 190 .open = x25_seq_socket_open,
192 .read = seq_read, 191 .read = seq_read,
193 .llseek = seq_lseek, 192 .llseek = seq_lseek,
@@ -195,7 +194,6 @@ static const struct file_operations x25_seq_socket_fops = {
195}; 194};
196 195
197static const struct file_operations x25_seq_route_fops = { 196static const struct file_operations x25_seq_route_fops = {
198 .owner = THIS_MODULE,
199 .open = x25_seq_route_open, 197 .open = x25_seq_route_open,
200 .read = seq_read, 198 .read = seq_read,
201 .llseek = seq_lseek, 199 .llseek = seq_lseek,
@@ -203,55 +201,38 @@ static const struct file_operations x25_seq_route_fops = {
203}; 201};
204 202
205static const struct file_operations x25_seq_forward_fops = { 203static const struct file_operations x25_seq_forward_fops = {
206 .owner = THIS_MODULE,
207 .open = x25_seq_forward_open, 204 .open = x25_seq_forward_open,
208 .read = seq_read, 205 .read = seq_read,
209 .llseek = seq_lseek, 206 .llseek = seq_lseek,
210 .release = seq_release, 207 .release = seq_release,
211}; 208};
212 209
213static struct proc_dir_entry *x25_proc_dir;
214
215int __init x25_proc_init(void) 210int __init x25_proc_init(void)
216{ 211{
217 struct proc_dir_entry *p; 212 if (!proc_mkdir("x25", init_net.proc_net))
218 int rc = -ENOMEM; 213 return -ENOMEM;
219 214
220 x25_proc_dir = proc_mkdir("x25", init_net.proc_net); 215 if (!proc_create("x25/route", S_IRUGO, init_net.proc_net,
221 if (!x25_proc_dir) 216 &x25_seq_route_fops))
222 goto out; 217 goto out;
223 218
224 p = proc_create("route", S_IRUGO, x25_proc_dir, &x25_seq_route_fops); 219 if (!proc_create("x25/socket", S_IRUGO, init_net.proc_net,
225 if (!p) 220 &x25_seq_socket_fops))
226 goto out_route; 221 goto out;
227
228 p = proc_create("socket", S_IRUGO, x25_proc_dir, &x25_seq_socket_fops);
229 if (!p)
230 goto out_socket;
231 222
232 p = proc_create("forward", S_IRUGO, x25_proc_dir, 223 if (!proc_create("x25/forward", S_IRUGO, init_net.proc_net,
233 &x25_seq_forward_fops); 224 &x25_seq_forward_fops))
234 if (!p) 225 goto out;
235 goto out_forward; 226 return 0;
236 rc = 0;
237 227
238out: 228out:
239 return rc; 229 remove_proc_subtree("x25", init_net.proc_net);
240out_forward: 230 return -ENOMEM;
241 remove_proc_entry("socket", x25_proc_dir);
242out_socket:
243 remove_proc_entry("route", x25_proc_dir);
244out_route:
245 remove_proc_entry("x25", init_net.proc_net);
246 goto out;
247} 231}
248 232
249void __exit x25_proc_exit(void) 233void __exit x25_proc_exit(void)
250{ 234{
251 remove_proc_entry("forward", x25_proc_dir); 235 remove_proc_subtree("x25", init_net.proc_net);
252 remove_proc_entry("route", x25_proc_dir);
253 remove_proc_entry("socket", x25_proc_dir);
254 remove_proc_entry("x25", init_net.proc_net);
255} 236}
256 237
257#else /* CONFIG_PROC_FS */ 238#else /* CONFIG_PROC_FS */