aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/9p/client.c31
-rw-r--r--net/9p/protocol.c8
-rw-r--r--net/9p/trans_common.c13
-rw-r--r--net/9p/trans_virtio.c15
-rw-r--r--net/batman-adv/gateway_client.c10
-rw-r--r--net/batman-adv/originator.c10
-rw-r--r--net/batman-adv/soft-interface.c10
-rw-r--r--net/bluetooth/sco.c9
-rw-r--r--net/ceph/messenger.c26
-rw-r--r--net/ceph/osd_client.c16
-rw-r--r--net/core/dev_addr_lists.c12
-rw-r--r--net/core/drop_monitor.c12
-rw-r--r--net/core/dst.c1
-rw-r--r--net/core/gen_estimator.c9
-rw-r--r--net/core/net-sysfs.c34
-rw-r--r--net/core/net_namespace.c10
-rw-r--r--net/core/pktgen.c1
-rw-r--r--net/core/skbuff.c1
-rw-r--r--net/decnet/dn_dev.c7
-rw-r--r--net/ipv4/fib_semantics.c12
-rw-r--r--net/ipv4/fib_trie.c7
-rw-r--r--net/ipv4/igmp.c32
-rw-r--r--net/ipv6/addrconf.c16
-rw-r--r--net/ipv6/mcast.c8
-rw-r--r--net/ipv6/sit.c7
-rw-r--r--net/l2tp/l2tp_ip.c2
-rw-r--r--net/mac80211/agg-tx.c14
-rw-r--r--net/mac80211/work.c10
-rw-r--r--net/netfilter/nf_conntrack_extend.c8
-rw-r--r--net/netfilter/xt_osf.c11
-rw-r--r--net/netlabel/netlabel_unlabeled.c42
-rw-r--r--net/netlink/af_netlink.c8
-rw-r--r--net/phonet/pn_dev.c10
-rw-r--r--net/sched/act_api.c7
-rw-r--r--net/sched/act_police.c8
-rw-r--r--net/sctp/bind_addr.c2
-rw-r--r--net/sctp/ipv6.c2
-rw-r--r--net/sctp/protocol.c9
-rw-r--r--net/sctp/ulpevent.c2
-rw-r--r--net/socket.c11
-rw-r--r--net/sunrpc/Kconfig9
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c8
-rw-r--r--net/sunrpc/clnt.c5
-rw-r--r--net/sunrpc/xprt.c1
44 files changed, 114 insertions, 372 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index 0ce959218607..ceab943dfc49 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -614,7 +614,7 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
614 614
615 err = c->trans_mod->request(c, req); 615 err = c->trans_mod->request(c, req);
616 if (err < 0) { 616 if (err < 0) {
617 if (err != -ERESTARTSYS) 617 if (err != -ERESTARTSYS && err != -EFAULT)
618 c->status = Disconnected; 618 c->status = Disconnected;
619 goto reterr; 619 goto reterr;
620 } 620 }
@@ -929,15 +929,15 @@ error:
929} 929}
930EXPORT_SYMBOL(p9_client_attach); 930EXPORT_SYMBOL(p9_client_attach);
931 931
932struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames, 932struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname,
933 int clone) 933 char **wnames, int clone)
934{ 934{
935 int err; 935 int err;
936 struct p9_client *clnt; 936 struct p9_client *clnt;
937 struct p9_fid *fid; 937 struct p9_fid *fid;
938 struct p9_qid *wqids; 938 struct p9_qid *wqids;
939 struct p9_req_t *req; 939 struct p9_req_t *req;
940 int16_t nwqids, count; 940 uint16_t nwqids, count;
941 941
942 err = 0; 942 err = 0;
943 wqids = NULL; 943 wqids = NULL;
@@ -955,7 +955,7 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames,
955 fid = oldfid; 955 fid = oldfid;
956 956
957 957
958 P9_DPRINTK(P9_DEBUG_9P, ">>> TWALK fids %d,%d nwname %d wname[0] %s\n", 958 P9_DPRINTK(P9_DEBUG_9P, ">>> TWALK fids %d,%d nwname %ud wname[0] %s\n",
959 oldfid->fid, fid->fid, nwname, wnames ? wnames[0] : NULL); 959 oldfid->fid, fid->fid, nwname, wnames ? wnames[0] : NULL);
960 960
961 req = p9_client_rpc(clnt, P9_TWALK, "ddT", oldfid->fid, fid->fid, 961 req = p9_client_rpc(clnt, P9_TWALK, "ddT", oldfid->fid, fid->fid,
@@ -1220,27 +1220,6 @@ error:
1220} 1220}
1221EXPORT_SYMBOL(p9_client_fsync); 1221EXPORT_SYMBOL(p9_client_fsync);
1222 1222
1223int p9_client_sync_fs(struct p9_fid *fid)
1224{
1225 int err = 0;
1226 struct p9_req_t *req;
1227 struct p9_client *clnt;
1228
1229 P9_DPRINTK(P9_DEBUG_9P, ">>> TSYNC_FS fid %d\n", fid->fid);
1230
1231 clnt = fid->clnt;
1232 req = p9_client_rpc(clnt, P9_TSYNCFS, "d", fid->fid);
1233 if (IS_ERR(req)) {
1234 err = PTR_ERR(req);
1235 goto error;
1236 }
1237 P9_DPRINTK(P9_DEBUG_9P, "<<< RSYNCFS fid %d\n", fid->fid);
1238 p9_free_req(clnt, req);
1239error:
1240 return err;
1241}
1242EXPORT_SYMBOL(p9_client_sync_fs);
1243
1244int p9_client_clunk(struct p9_fid *fid) 1223int p9_client_clunk(struct p9_fid *fid)
1245{ 1224{
1246 int err; 1225 int err;
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 8a4084fa8b5a..a873277cb996 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -265,7 +265,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
265 } 265 }
266 break; 266 break;
267 case 'T':{ 267 case 'T':{
268 int16_t *nwname = va_arg(ap, int16_t *); 268 uint16_t *nwname = va_arg(ap, uint16_t *);
269 char ***wnames = va_arg(ap, char ***); 269 char ***wnames = va_arg(ap, char ***);
270 270
271 errcode = p9pdu_readf(pdu, proto_version, 271 errcode = p9pdu_readf(pdu, proto_version,
@@ -468,7 +468,8 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
468 case 'E':{ 468 case 'E':{
469 int32_t cnt = va_arg(ap, int32_t); 469 int32_t cnt = va_arg(ap, int32_t);
470 const char *k = va_arg(ap, const void *); 470 const char *k = va_arg(ap, const void *);
471 const char *u = va_arg(ap, const void *); 471 const char __user *u = va_arg(ap,
472 const void __user *);
472 errcode = p9pdu_writef(pdu, proto_version, "d", 473 errcode = p9pdu_writef(pdu, proto_version, "d",
473 cnt); 474 cnt);
474 if (!errcode && pdu_write_urw(pdu, k, u, cnt)) 475 if (!errcode && pdu_write_urw(pdu, k, u, cnt))
@@ -495,7 +496,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
495 } 496 }
496 break; 497 break;
497 case 'T':{ 498 case 'T':{
498 int16_t nwname = va_arg(ap, int); 499 uint16_t nwname = va_arg(ap, int);
499 const char **wnames = va_arg(ap, const char **); 500 const char **wnames = va_arg(ap, const char **);
500 501
501 errcode = p9pdu_writef(pdu, proto_version, "w", 502 errcode = p9pdu_writef(pdu, proto_version, "w",
@@ -673,6 +674,7 @@ int p9dirent_read(char *buf, int len, struct p9_dirent *dirent,
673 } 674 }
674 675
675 strcpy(dirent->d_name, nameptr); 676 strcpy(dirent->d_name, nameptr);
677 kfree(nameptr);
676 678
677out: 679out:
678 return fake_pdu.offset; 680 return fake_pdu.offset;
diff --git a/net/9p/trans_common.c b/net/9p/trans_common.c
index d47880e971dd..9a70ebdec56e 100644
--- a/net/9p/trans_common.c
+++ b/net/9p/trans_common.c
@@ -63,10 +63,10 @@ p9_payload_gup(struct p9_req_t *req, size_t *pdata_off, int *pdata_len,
63 int nr_pages, u8 rw) 63 int nr_pages, u8 rw)
64{ 64{
65 uint32_t first_page_bytes = 0; 65 uint32_t first_page_bytes = 0;
66 uint32_t pdata_mapped_pages; 66 int32_t pdata_mapped_pages;
67 struct trans_rpage_info *rpinfo; 67 struct trans_rpage_info *rpinfo;
68 68
69 *pdata_off = (size_t)req->tc->pubuf & (PAGE_SIZE-1); 69 *pdata_off = (__force size_t)req->tc->pubuf & (PAGE_SIZE-1);
70 70
71 if (*pdata_off) 71 if (*pdata_off)
72 first_page_bytes = min(((size_t)PAGE_SIZE - *pdata_off), 72 first_page_bytes = min(((size_t)PAGE_SIZE - *pdata_off),
@@ -75,14 +75,9 @@ p9_payload_gup(struct p9_req_t *req, size_t *pdata_off, int *pdata_len,
75 rpinfo = req->tc->private; 75 rpinfo = req->tc->private;
76 pdata_mapped_pages = get_user_pages_fast((unsigned long)req->tc->pubuf, 76 pdata_mapped_pages = get_user_pages_fast((unsigned long)req->tc->pubuf,
77 nr_pages, rw, &rpinfo->rp_data[0]); 77 nr_pages, rw, &rpinfo->rp_data[0]);
78 if (pdata_mapped_pages <= 0)
79 return pdata_mapped_pages;
78 80
79 if (pdata_mapped_pages < 0) {
80 printk(KERN_ERR "get_user_pages_fast failed:%d udata:%p"
81 "nr_pages:%d\n", pdata_mapped_pages,
82 req->tc->pubuf, nr_pages);
83 pdata_mapped_pages = 0;
84 return -EIO;
85 }
86 rpinfo->rp_nr_pages = pdata_mapped_pages; 81 rpinfo->rp_nr_pages = pdata_mapped_pages;
87 if (*pdata_off) { 82 if (*pdata_off) {
88 *pdata_len = first_page_bytes; 83 *pdata_len = first_page_bytes;
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index e8f046b07182..244e70742183 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -326,8 +326,11 @@ req_retry_pinned:
326 outp = pack_sg_list_p(chan->sg, out, VIRTQUEUE_NUM, 326 outp = pack_sg_list_p(chan->sg, out, VIRTQUEUE_NUM,
327 pdata_off, rpinfo->rp_data, pdata_len); 327 pdata_off, rpinfo->rp_data, pdata_len);
328 } else { 328 } else {
329 char *pbuf = req->tc->pubuf ? req->tc->pubuf : 329 char *pbuf;
330 req->tc->pkbuf; 330 if (req->tc->pubuf)
331 pbuf = (__force char *) req->tc->pubuf;
332 else
333 pbuf = req->tc->pkbuf;
331 outp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, pbuf, 334 outp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, pbuf,
332 req->tc->pbuf_size); 335 req->tc->pbuf_size);
333 } 336 }
@@ -352,8 +355,12 @@ req_retry_pinned:
352 in = pack_sg_list_p(chan->sg, out+inp, VIRTQUEUE_NUM, 355 in = pack_sg_list_p(chan->sg, out+inp, VIRTQUEUE_NUM,
353 pdata_off, rpinfo->rp_data, pdata_len); 356 pdata_off, rpinfo->rp_data, pdata_len);
354 } else { 357 } else {
355 char *pbuf = req->tc->pubuf ? req->tc->pubuf : 358 char *pbuf;
356 req->tc->pkbuf; 359 if (req->tc->pubuf)
360 pbuf = (__force char *) req->tc->pubuf;
361 else
362 pbuf = req->tc->pkbuf;
363
357 in = pack_sg_list(chan->sg, out+inp, VIRTQUEUE_NUM, 364 in = pack_sg_list(chan->sg, out+inp, VIRTQUEUE_NUM,
358 pbuf, req->tc->pbuf_size); 365 pbuf, req->tc->pbuf_size);
359 } 366 }
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 65f39530799d..61605a0f3f39 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -29,18 +29,10 @@
29#include <linux/udp.h> 29#include <linux/udp.h>
30#include <linux/if_vlan.h> 30#include <linux/if_vlan.h>
31 31
32static void gw_node_free_rcu(struct rcu_head *rcu)
33{
34 struct gw_node *gw_node;
35
36 gw_node = container_of(rcu, struct gw_node, rcu);
37 kfree(gw_node);
38}
39
40static void gw_node_free_ref(struct gw_node *gw_node) 32static void gw_node_free_ref(struct gw_node *gw_node)
41{ 33{
42 if (atomic_dec_and_test(&gw_node->refcount)) 34 if (atomic_dec_and_test(&gw_node->refcount))
43 call_rcu(&gw_node->rcu, gw_node_free_rcu); 35 kfree_rcu(gw_node, rcu);
44} 36}
45 37
46static struct gw_node *gw_get_selected_gw_node(struct bat_priv *bat_priv) 38static struct gw_node *gw_get_selected_gw_node(struct bat_priv *bat_priv)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 080ec88330a3..40a30bbcd147 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -54,18 +54,10 @@ err:
54 return 0; 54 return 0;
55} 55}
56 56
57static void neigh_node_free_rcu(struct rcu_head *rcu)
58{
59 struct neigh_node *neigh_node;
60
61 neigh_node = container_of(rcu, struct neigh_node, rcu);
62 kfree(neigh_node);
63}
64
65void neigh_node_free_ref(struct neigh_node *neigh_node) 57void neigh_node_free_ref(struct neigh_node *neigh_node)
66{ 58{
67 if (atomic_dec_and_test(&neigh_node->refcount)) 59 if (atomic_dec_and_test(&neigh_node->refcount))
68 call_rcu(&neigh_node->rcu, neigh_node_free_rcu); 60 kfree_rcu(neigh_node, rcu);
69} 61}
70 62
71/* increases the refcounter of a found router */ 63/* increases the refcounter of a found router */
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index c76a33eeb3f1..d5aa60999e83 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -72,18 +72,10 @@ int my_skb_head_push(struct sk_buff *skb, unsigned int len)
72 return 0; 72 return 0;
73} 73}
74 74
75static void softif_neigh_free_rcu(struct rcu_head *rcu)
76{
77 struct softif_neigh *softif_neigh;
78
79 softif_neigh = container_of(rcu, struct softif_neigh, rcu);
80 kfree(softif_neigh);
81}
82
83static void softif_neigh_free_ref(struct softif_neigh *softif_neigh) 75static void softif_neigh_free_ref(struct softif_neigh *softif_neigh)
84{ 76{
85 if (atomic_dec_and_test(&softif_neigh->refcount)) 77 if (atomic_dec_and_test(&softif_neigh->refcount))
86 call_rcu(&softif_neigh->rcu, softif_neigh_free_rcu); 78 kfree_rcu(softif_neigh, rcu);
87} 79}
88 80
89static void softif_neigh_vid_free_rcu(struct rcu_head *rcu) 81static void softif_neigh_vid_free_rcu(struct rcu_head *rcu)
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 94954c74f6ae..42fdffd1d76c 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -369,15 +369,6 @@ static void __sco_sock_close(struct sock *sk)
369 369
370 case BT_CONNECTED: 370 case BT_CONNECTED:
371 case BT_CONFIG: 371 case BT_CONFIG:
372 if (sco_pi(sk)->conn) {
373 sk->sk_state = BT_DISCONN;
374 sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT);
375 hci_conn_put(sco_pi(sk)->conn->hcon);
376 sco_pi(sk)->conn = NULL;
377 } else
378 sco_chan_del(sk, ECONNRESET);
379 break;
380
381 case BT_CONNECT: 372 case BT_CONNECT:
382 case BT_DISCONN: 373 case BT_DISCONN:
383 sco_chan_del(sk, ECONNRESET); 374 sco_chan_del(sk, ECONNRESET);
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 05f357828a2f..e15a82ccc05f 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2267,6 +2267,19 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags)
2267 m->more_to_follow = false; 2267 m->more_to_follow = false;
2268 m->pool = NULL; 2268 m->pool = NULL;
2269 2269
2270 /* middle */
2271 m->middle = NULL;
2272
2273 /* data */
2274 m->nr_pages = 0;
2275 m->page_alignment = 0;
2276 m->pages = NULL;
2277 m->pagelist = NULL;
2278 m->bio = NULL;
2279 m->bio_iter = NULL;
2280 m->bio_seg = 0;
2281 m->trail = NULL;
2282
2270 /* front */ 2283 /* front */
2271 if (front_len) { 2284 if (front_len) {
2272 if (front_len > PAGE_CACHE_SIZE) { 2285 if (front_len > PAGE_CACHE_SIZE) {
@@ -2286,19 +2299,6 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags)
2286 } 2299 }
2287 m->front.iov_len = front_len; 2300 m->front.iov_len = front_len;
2288 2301
2289 /* middle */
2290 m->middle = NULL;
2291
2292 /* data */
2293 m->nr_pages = 0;
2294 m->page_alignment = 0;
2295 m->pages = NULL;
2296 m->pagelist = NULL;
2297 m->bio = NULL;
2298 m->bio_iter = NULL;
2299 m->bio_seg = 0;
2300 m->trail = NULL;
2301
2302 dout("ceph_msg_new %p front %d\n", m, front_len); 2302 dout("ceph_msg_new %p front %d\n", m, front_len);
2303 return m; 2303 return m;
2304 2304
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 50af02737a3d..6b5dda1cb5df 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -470,8 +470,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
470 snapc, ops, 470 snapc, ops,
471 use_mempool, 471 use_mempool,
472 GFP_NOFS, NULL, NULL); 472 GFP_NOFS, NULL, NULL);
473 if (IS_ERR(req)) 473 if (!req)
474 return req; 474 return NULL;
475 475
476 /* calculate max write size */ 476 /* calculate max write size */
477 calc_layout(osdc, vino, layout, off, plen, req, ops); 477 calc_layout(osdc, vino, layout, off, plen, req, ops);
@@ -579,9 +579,15 @@ static void __kick_osd_requests(struct ceph_osd_client *osdc,
579 579
580 list_for_each_entry_safe(req, nreq, &osd->o_linger_requests, 580 list_for_each_entry_safe(req, nreq, &osd->o_linger_requests,
581 r_linger_osd) { 581 r_linger_osd) {
582 __unregister_linger_request(osdc, req); 582 /*
583 * reregister request prior to unregistering linger so
584 * that r_osd is preserved.
585 */
586 BUG_ON(!list_empty(&req->r_req_lru_item));
583 __register_request(osdc, req); 587 __register_request(osdc, req);
584 list_move(&req->r_req_lru_item, &osdc->req_unsent); 588 list_add(&req->r_req_lru_item, &osdc->req_unsent);
589 list_add(&req->r_osd_item, &req->r_osd->o_requests);
590 __unregister_linger_request(osdc, req);
585 dout("requeued lingering %p tid %llu osd%d\n", req, req->r_tid, 591 dout("requeued lingering %p tid %llu osd%d\n", req, req->r_tid,
586 osd->o_osd); 592 osd->o_osd);
587 } 593 }
@@ -798,7 +804,7 @@ static void __register_request(struct ceph_osd_client *osdc,
798 req->r_request->hdr.tid = cpu_to_le64(req->r_tid); 804 req->r_request->hdr.tid = cpu_to_le64(req->r_tid);
799 INIT_LIST_HEAD(&req->r_req_lru_item); 805 INIT_LIST_HEAD(&req->r_req_lru_item);
800 806
801 dout("register_request %p tid %lld\n", req, req->r_tid); 807 dout("__register_request %p tid %lld\n", req, req->r_tid);
802 __insert_request(osdc, req); 808 __insert_request(osdc, req);
803 ceph_osdc_get_request(req); 809 ceph_osdc_get_request(req);
804 osdc->num_requests++; 810 osdc->num_requests++;
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 7b39f3ed2fda..e2e66939ed00 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -68,14 +68,6 @@ static int __hw_addr_add(struct netdev_hw_addr_list *list, unsigned char *addr,
68 return __hw_addr_add_ex(list, addr, addr_len, addr_type, false); 68 return __hw_addr_add_ex(list, addr, addr_len, addr_type, false);
69} 69}
70 70
71static void ha_rcu_free(struct rcu_head *head)
72{
73 struct netdev_hw_addr *ha;
74
75 ha = container_of(head, struct netdev_hw_addr, rcu_head);
76 kfree(ha);
77}
78
79static int __hw_addr_del_ex(struct netdev_hw_addr_list *list, 71static int __hw_addr_del_ex(struct netdev_hw_addr_list *list,
80 unsigned char *addr, int addr_len, 72 unsigned char *addr, int addr_len,
81 unsigned char addr_type, bool global) 73 unsigned char addr_type, bool global)
@@ -94,7 +86,7 @@ static int __hw_addr_del_ex(struct netdev_hw_addr_list *list,
94 if (--ha->refcount) 86 if (--ha->refcount)
95 return 0; 87 return 0;
96 list_del_rcu(&ha->list); 88 list_del_rcu(&ha->list);
97 call_rcu(&ha->rcu_head, ha_rcu_free); 89 kfree_rcu(ha, rcu_head);
98 list->count--; 90 list->count--;
99 return 0; 91 return 0;
100 } 92 }
@@ -197,7 +189,7 @@ void __hw_addr_flush(struct netdev_hw_addr_list *list)
197 189
198 list_for_each_entry_safe(ha, tmp, &list->list, list) { 190 list_for_each_entry_safe(ha, tmp, &list->list, list) {
199 list_del_rcu(&ha->list); 191 list_del_rcu(&ha->list);
200 call_rcu(&ha->rcu_head, ha_rcu_free); 192 kfree_rcu(ha, rcu_head);
201 } 193 }
202 list->count = 0; 194 list->count = 0;
203} 195}
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 706502ff64aa..7f36b38e060f 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -207,14 +207,6 @@ static void trace_napi_poll_hit(void *ignore, struct napi_struct *napi)
207 rcu_read_unlock(); 207 rcu_read_unlock();
208} 208}
209 209
210
211static void free_dm_hw_stat(struct rcu_head *head)
212{
213 struct dm_hw_stat_delta *n;
214 n = container_of(head, struct dm_hw_stat_delta, rcu);
215 kfree(n);
216}
217
218static int set_all_monitor_traces(int state) 210static int set_all_monitor_traces(int state)
219{ 211{
220 int rc = 0; 212 int rc = 0;
@@ -245,7 +237,7 @@ static int set_all_monitor_traces(int state)
245 list_for_each_entry_safe(new_stat, temp, &hw_stats_list, list) { 237 list_for_each_entry_safe(new_stat, temp, &hw_stats_list, list) {
246 if (new_stat->dev == NULL) { 238 if (new_stat->dev == NULL) {
247 list_del_rcu(&new_stat->list); 239 list_del_rcu(&new_stat->list);
248 call_rcu(&new_stat->rcu, free_dm_hw_stat); 240 kfree_rcu(new_stat, rcu);
249 } 241 }
250 } 242 }
251 break; 243 break;
@@ -314,7 +306,7 @@ static int dropmon_net_event(struct notifier_block *ev_block,
314 new_stat->dev = NULL; 306 new_stat->dev = NULL;
315 if (trace_state == TRACE_OFF) { 307 if (trace_state == TRACE_OFF) {
316 list_del_rcu(&new_stat->list); 308 list_del_rcu(&new_stat->list);
317 call_rcu(&new_stat->rcu, free_dm_hw_stat); 309 kfree_rcu(new_stat, rcu);
318 break; 310 break;
319 } 311 }
320 } 312 }
diff --git a/net/core/dst.c b/net/core/dst.c
index da47a299618a..81a4fa1c95ed 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -19,6 +19,7 @@
19#include <linux/types.h> 19#include <linux/types.h>
20#include <net/net_namespace.h> 20#include <net/net_namespace.h>
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/prefetch.h>
22 23
23#include <net/dst.h> 24#include <net/dst.h>
24 25
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c
index 7c2373321b74..43b03dd71e85 100644
--- a/net/core/gen_estimator.c
+++ b/net/core/gen_estimator.c
@@ -249,13 +249,6 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
249} 249}
250EXPORT_SYMBOL(gen_new_estimator); 250EXPORT_SYMBOL(gen_new_estimator);
251 251
252static void __gen_kill_estimator(struct rcu_head *head)
253{
254 struct gen_estimator *e = container_of(head,
255 struct gen_estimator, e_rcu);
256 kfree(e);
257}
258
259/** 252/**
260 * gen_kill_estimator - remove a rate estimator 253 * gen_kill_estimator - remove a rate estimator
261 * @bstats: basic statistics 254 * @bstats: basic statistics
@@ -279,7 +272,7 @@ void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
279 write_unlock(&est_lock); 272 write_unlock(&est_lock);
280 273
281 list_del_rcu(&e->list); 274 list_del_rcu(&e->list);
282 call_rcu(&e->e_rcu, __gen_kill_estimator); 275 kfree_rcu(e, e_rcu);
283 } 276 }
284 spin_unlock_bh(&est_tree_lock); 277 spin_unlock_bh(&est_tree_lock);
285} 278}
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 1b122177c8fa..11b98bc2aa8f 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -561,13 +561,6 @@ static ssize_t show_rps_map(struct netdev_rx_queue *queue,
561 return len; 561 return len;
562} 562}
563 563
564static void rps_map_release(struct rcu_head *rcu)
565{
566 struct rps_map *map = container_of(rcu, struct rps_map, rcu);
567
568 kfree(map);
569}
570
571static ssize_t store_rps_map(struct netdev_rx_queue *queue, 564static ssize_t store_rps_map(struct netdev_rx_queue *queue,
572 struct rx_queue_attribute *attribute, 565 struct rx_queue_attribute *attribute,
573 const char *buf, size_t len) 566 const char *buf, size_t len)
@@ -615,7 +608,7 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue,
615 spin_unlock(&rps_map_lock); 608 spin_unlock(&rps_map_lock);
616 609
617 if (old_map) 610 if (old_map)
618 call_rcu(&old_map->rcu, rps_map_release); 611 kfree_rcu(old_map, rcu);
619 612
620 free_cpumask_var(mask); 613 free_cpumask_var(mask);
621 return len; 614 return len;
@@ -724,7 +717,7 @@ static void rx_queue_release(struct kobject *kobj)
724 map = rcu_dereference_raw(queue->rps_map); 717 map = rcu_dereference_raw(queue->rps_map);
725 if (map) { 718 if (map) {
726 RCU_INIT_POINTER(queue->rps_map, NULL); 719 RCU_INIT_POINTER(queue->rps_map, NULL);
727 call_rcu(&map->rcu, rps_map_release); 720 kfree_rcu(map, rcu);
728 } 721 }
729 722
730 flow_table = rcu_dereference_raw(queue->rps_flow_table); 723 flow_table = rcu_dereference_raw(queue->rps_flow_table);
@@ -894,21 +887,6 @@ static ssize_t show_xps_map(struct netdev_queue *queue,
894 return len; 887 return len;
895} 888}
896 889
897static void xps_map_release(struct rcu_head *rcu)
898{
899 struct xps_map *map = container_of(rcu, struct xps_map, rcu);
900
901 kfree(map);
902}
903
904static void xps_dev_maps_release(struct rcu_head *rcu)
905{
906 struct xps_dev_maps *dev_maps =
907 container_of(rcu, struct xps_dev_maps, rcu);
908
909 kfree(dev_maps);
910}
911
912static DEFINE_MUTEX(xps_map_mutex); 890static DEFINE_MUTEX(xps_map_mutex);
913#define xmap_dereference(P) \ 891#define xmap_dereference(P) \
914 rcu_dereference_protected((P), lockdep_is_held(&xps_map_mutex)) 892 rcu_dereference_protected((P), lockdep_is_held(&xps_map_mutex))
@@ -1005,7 +983,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
1005 map = dev_maps ? 983 map = dev_maps ?
1006 xmap_dereference(dev_maps->cpu_map[cpu]) : NULL; 984 xmap_dereference(dev_maps->cpu_map[cpu]) : NULL;
1007 if (map && xmap_dereference(new_dev_maps->cpu_map[cpu]) != map) 985 if (map && xmap_dereference(new_dev_maps->cpu_map[cpu]) != map)
1008 call_rcu(&map->rcu, xps_map_release); 986 kfree_rcu(map, rcu);
1009 if (new_dev_maps->cpu_map[cpu]) 987 if (new_dev_maps->cpu_map[cpu])
1010 nonempty = 1; 988 nonempty = 1;
1011 } 989 }
@@ -1018,7 +996,7 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
1018 } 996 }
1019 997
1020 if (dev_maps) 998 if (dev_maps)
1021 call_rcu(&dev_maps->rcu, xps_dev_maps_release); 999 kfree_rcu(dev_maps, rcu);
1022 1000
1023 netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node : 1001 netdev_queue_numa_node_write(queue, (numa_node >= 0) ? numa_node :
1024 NUMA_NO_NODE); 1002 NUMA_NO_NODE);
@@ -1080,7 +1058,7 @@ static void netdev_queue_release(struct kobject *kobj)
1080 else { 1058 else {
1081 RCU_INIT_POINTER(dev_maps->cpu_map[i], 1059 RCU_INIT_POINTER(dev_maps->cpu_map[i],
1082 NULL); 1060 NULL);
1083 call_rcu(&map->rcu, xps_map_release); 1061 kfree_rcu(map, rcu);
1084 map = NULL; 1062 map = NULL;
1085 } 1063 }
1086 } 1064 }
@@ -1090,7 +1068,7 @@ static void netdev_queue_release(struct kobject *kobj)
1090 1068
1091 if (!nonempty) { 1069 if (!nonempty) {
1092 RCU_INIT_POINTER(dev->xps_maps, NULL); 1070 RCU_INIT_POINTER(dev->xps_maps, NULL);
1093 call_rcu(&dev_maps->rcu, xps_dev_maps_release); 1071 kfree_rcu(dev_maps, rcu);
1094 } 1072 }
1095 } 1073 }
1096 1074
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 1abb50841046..2e2dce6583e1 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -27,14 +27,6 @@ EXPORT_SYMBOL(init_net);
27 27
28#define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */ 28#define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */
29 29
30static void net_generic_release(struct rcu_head *rcu)
31{
32 struct net_generic *ng;
33
34 ng = container_of(rcu, struct net_generic, rcu);
35 kfree(ng);
36}
37
38static int net_assign_generic(struct net *net, int id, void *data) 30static int net_assign_generic(struct net *net, int id, void *data)
39{ 31{
40 struct net_generic *ng, *old_ng; 32 struct net_generic *ng, *old_ng;
@@ -68,7 +60,7 @@ static int net_assign_generic(struct net *net, int id, void *data)
68 memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*)); 60 memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*));
69 61
70 rcu_assign_pointer(net->gen, ng); 62 rcu_assign_pointer(net->gen, ng);
71 call_rcu(&old_ng->rcu, net_generic_release); 63 kfree_rcu(old_ng, rcu);
72assign: 64assign:
73 ng->ptr[id - 1] = data; 65 ng->ptr[id - 1] = data;
74 return 0; 66 return 0;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 379270f14771..67870e9fd097 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -156,6 +156,7 @@
156#include <linux/wait.h> 156#include <linux/wait.h>
157#include <linux/etherdevice.h> 157#include <linux/etherdevice.h>
158#include <linux/kthread.h> 158#include <linux/kthread.h>
159#include <linux/prefetch.h>
159#include <net/net_namespace.h> 160#include <net/net_namespace.h>
160#include <net/checksum.h> 161#include <net/checksum.h>
161#include <net/ipv6.h> 162#include <net/ipv6.h>
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3e934fe96f29..46cbd28f40f9 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -57,6 +57,7 @@
57#include <linux/init.h> 57#include <linux/init.h>
58#include <linux/scatterlist.h> 58#include <linux/scatterlist.h>
59#include <linux/errqueue.h> 59#include <linux/errqueue.h>
60#include <linux/prefetch.h>
60 61
61#include <net/protocol.h> 62#include <net/protocol.h>
62#include <net/dst.h> 63#include <net/dst.h>
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 404fa1591027..cf26ac74a188 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -332,14 +332,9 @@ static struct dn_ifaddr *dn_dev_alloc_ifa(void)
332 return ifa; 332 return ifa;
333} 333}
334 334
335static void dn_dev_free_ifa_rcu(struct rcu_head *head)
336{
337 kfree(container_of(head, struct dn_ifaddr, rcu));
338}
339
340static void dn_dev_free_ifa(struct dn_ifaddr *ifa) 335static void dn_dev_free_ifa(struct dn_ifaddr *ifa)
341{ 336{
342 call_rcu(&ifa->rcu, dn_dev_free_ifa_rcu); 337 kfree_rcu(ifa, rcu);
343} 338}
344 339
345static void dn_dev_del_ifa(struct dn_dev *dn_db, struct dn_ifaddr __rcu **ifap, int destroy) 340static void dn_dev_del_ifa(struct dn_dev *dn_db, struct dn_ifaddr __rcu **ifap, int destroy)
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 641a5a2a9f9c..33e2c35b74b7 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -141,18 +141,8 @@ const struct fib_prop fib_props[RTN_MAX + 1] = {
141 }, 141 },
142}; 142};
143 143
144
145/* Release a nexthop info record */ 144/* Release a nexthop info record */
146 145
147static void free_fib_info_rcu(struct rcu_head *head)
148{
149 struct fib_info *fi = container_of(head, struct fib_info, rcu);
150
151 if (fi->fib_metrics != (u32 *) dst_default_metrics)
152 kfree(fi->fib_metrics);
153 kfree(fi);
154}
155
156void free_fib_info(struct fib_info *fi) 146void free_fib_info(struct fib_info *fi)
157{ 147{
158 if (fi->fib_dead == 0) { 148 if (fi->fib_dead == 0) {
@@ -166,7 +156,7 @@ void free_fib_info(struct fib_info *fi)
166 } endfor_nexthops(fi); 156 } endfor_nexthops(fi);
167 fib_info_cnt--; 157 fib_info_cnt--;
168 release_net(fi->fib_net); 158 release_net(fi->fib_net);
169 call_rcu(&fi->rcu, free_fib_info_rcu); 159 kfree_rcu(fi, rcu);
170} 160}
171 161
172void fib_release_info(struct fib_info *fi) 162void fib_release_info(struct fib_info *fi)
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 6375c1c5f642..c779ce96e5b5 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -369,14 +369,9 @@ static inline void free_leaf(struct leaf *l)
369 call_rcu_bh(&l->rcu, __leaf_free_rcu); 369 call_rcu_bh(&l->rcu, __leaf_free_rcu);
370} 370}
371 371
372static void __leaf_info_free_rcu(struct rcu_head *head)
373{
374 kfree(container_of(head, struct leaf_info, rcu));
375}
376
377static inline void free_leaf_info(struct leaf_info *leaf) 372static inline void free_leaf_info(struct leaf_info *leaf)
378{ 373{
379 call_rcu(&leaf->rcu, __leaf_info_free_rcu); 374 kfree_rcu(leaf, rcu);
380} 375}
381 376
382static struct tnode *tnode_alloc(size_t size) 377static struct tnode *tnode_alloc(size_t size)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index ec03c2fda6ce..672e476c8c8a 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -149,17 +149,11 @@ static void ip_mc_clear_src(struct ip_mc_list *pmc);
149static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, 149static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
150 int sfcount, __be32 *psfsrc, int delta); 150 int sfcount, __be32 *psfsrc, int delta);
151 151
152
153static void ip_mc_list_reclaim(struct rcu_head *head)
154{
155 kfree(container_of(head, struct ip_mc_list, rcu));
156}
157
158static void ip_ma_put(struct ip_mc_list *im) 152static void ip_ma_put(struct ip_mc_list *im)
159{ 153{
160 if (atomic_dec_and_test(&im->refcnt)) { 154 if (atomic_dec_and_test(&im->refcnt)) {
161 in_dev_put(im->interface); 155 in_dev_put(im->interface);
162 call_rcu(&im->rcu, ip_mc_list_reclaim); 156 kfree_rcu(im, rcu);
163 } 157 }
164} 158}
165 159
@@ -1828,12 +1822,6 @@ done:
1828} 1822}
1829EXPORT_SYMBOL(ip_mc_join_group); 1823EXPORT_SYMBOL(ip_mc_join_group);
1830 1824
1831static void ip_sf_socklist_reclaim(struct rcu_head *rp)
1832{
1833 kfree(container_of(rp, struct ip_sf_socklist, rcu));
1834 /* sk_omem_alloc should have been decreased by the caller*/
1835}
1836
1837static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, 1825static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
1838 struct in_device *in_dev) 1826 struct in_device *in_dev)
1839{ 1827{
@@ -1850,18 +1838,10 @@ static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
1850 rcu_assign_pointer(iml->sflist, NULL); 1838 rcu_assign_pointer(iml->sflist, NULL);
1851 /* decrease mem now to avoid the memleak warning */ 1839 /* decrease mem now to avoid the memleak warning */
1852 atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc); 1840 atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc);
1853 call_rcu(&psf->rcu, ip_sf_socklist_reclaim); 1841 kfree_rcu(psf, rcu);
1854 return err; 1842 return err;
1855} 1843}
1856 1844
1857
1858static void ip_mc_socklist_reclaim(struct rcu_head *rp)
1859{
1860 kfree(container_of(rp, struct ip_mc_socklist, rcu));
1861 /* sk_omem_alloc should have been decreased by the caller*/
1862}
1863
1864
1865/* 1845/*
1866 * Ask a socket to leave a group. 1846 * Ask a socket to leave a group.
1867 */ 1847 */
@@ -1901,7 +1881,7 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
1901 rtnl_unlock(); 1881 rtnl_unlock();
1902 /* decrease mem now to avoid the memleak warning */ 1882 /* decrease mem now to avoid the memleak warning */
1903 atomic_sub(sizeof(*iml), &sk->sk_omem_alloc); 1883 atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
1904 call_rcu(&iml->rcu, ip_mc_socklist_reclaim); 1884 kfree_rcu(iml, rcu);
1905 return 0; 1885 return 0;
1906 } 1886 }
1907 if (!in_dev) 1887 if (!in_dev)
@@ -2018,7 +1998,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
2018 newpsl->sl_addr[i] = psl->sl_addr[i]; 1998 newpsl->sl_addr[i] = psl->sl_addr[i];
2019 /* decrease mem now to avoid the memleak warning */ 1999 /* decrease mem now to avoid the memleak warning */
2020 atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); 2000 atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
2021 call_rcu(&psl->rcu, ip_sf_socklist_reclaim); 2001 kfree_rcu(psl, rcu);
2022 } 2002 }
2023 rcu_assign_pointer(pmc->sflist, newpsl); 2003 rcu_assign_pointer(pmc->sflist, newpsl);
2024 psl = newpsl; 2004 psl = newpsl;
@@ -2119,7 +2099,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
2119 psl->sl_count, psl->sl_addr, 0); 2099 psl->sl_count, psl->sl_addr, 0);
2120 /* decrease mem now to avoid the memleak warning */ 2100 /* decrease mem now to avoid the memleak warning */
2121 atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); 2101 atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
2122 call_rcu(&psl->rcu, ip_sf_socklist_reclaim); 2102 kfree_rcu(psl, rcu);
2123 } else 2103 } else
2124 (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, 2104 (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
2125 0, NULL, 0); 2105 0, NULL, 0);
@@ -2316,7 +2296,7 @@ void ip_mc_drop_socket(struct sock *sk)
2316 ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); 2296 ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr);
2317 /* decrease mem now to avoid the memleak warning */ 2297 /* decrease mem now to avoid the memleak warning */
2318 atomic_sub(sizeof(*iml), &sk->sk_omem_alloc); 2298 atomic_sub(sizeof(*iml), &sk->sk_omem_alloc);
2319 call_rcu(&iml->rcu, ip_mc_socklist_reclaim); 2299 kfree_rcu(iml, rcu);
2320 } 2300 }
2321 rtnl_unlock(); 2301 rtnl_unlock();
2322} 2302}
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 3cfbbf3387a0..498b927f68be 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -317,12 +317,6 @@ static void snmp6_free_dev(struct inet6_dev *idev)
317 317
318/* Nobody refers to this device, we may destroy it. */ 318/* Nobody refers to this device, we may destroy it. */
319 319
320static void in6_dev_finish_destroy_rcu(struct rcu_head *head)
321{
322 struct inet6_dev *idev = container_of(head, struct inet6_dev, rcu);
323 kfree(idev);
324}
325
326void in6_dev_finish_destroy(struct inet6_dev *idev) 320void in6_dev_finish_destroy(struct inet6_dev *idev)
327{ 321{
328 struct net_device *dev = idev->dev; 322 struct net_device *dev = idev->dev;
@@ -339,7 +333,7 @@ void in6_dev_finish_destroy(struct inet6_dev *idev)
339 return; 333 return;
340 } 334 }
341 snmp6_free_dev(idev); 335 snmp6_free_dev(idev);
342 call_rcu(&idev->rcu, in6_dev_finish_destroy_rcu); 336 kfree_rcu(idev, rcu);
343} 337}
344 338
345EXPORT_SYMBOL(in6_dev_finish_destroy); 339EXPORT_SYMBOL(in6_dev_finish_destroy);
@@ -535,12 +529,6 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
535} 529}
536#endif 530#endif
537 531
538static void inet6_ifa_finish_destroy_rcu(struct rcu_head *head)
539{
540 struct inet6_ifaddr *ifp = container_of(head, struct inet6_ifaddr, rcu);
541 kfree(ifp);
542}
543
544/* Nobody refers to this ifaddr, destroy it */ 532/* Nobody refers to this ifaddr, destroy it */
545void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp) 533void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp)
546{ 534{
@@ -561,7 +549,7 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp)
561 } 549 }
562 dst_release(&ifp->rt->dst); 550 dst_release(&ifp->rt->dst);
563 551
564 call_rcu(&ifp->rcu, inet6_ifa_finish_destroy_rcu); 552 kfree_rcu(ifp, rcu);
565} 553}
566 554
567static void 555static void
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index ff62e33ead07..3e6ebcdb4779 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -201,10 +201,6 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
201 return 0; 201 return 0;
202} 202}
203 203
204static void ipv6_mc_socklist_reclaim(struct rcu_head *head)
205{
206 kfree(container_of(head, struct ipv6_mc_socklist, rcu));
207}
208/* 204/*
209 * socket leave on multicast group 205 * socket leave on multicast group
210 */ 206 */
@@ -239,7 +235,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
239 (void) ip6_mc_leave_src(sk, mc_lst, NULL); 235 (void) ip6_mc_leave_src(sk, mc_lst, NULL);
240 rcu_read_unlock(); 236 rcu_read_unlock();
241 atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc); 237 atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc);
242 call_rcu(&mc_lst->rcu, ipv6_mc_socklist_reclaim); 238 kfree_rcu(mc_lst, rcu);
243 return 0; 239 return 0;
244 } 240 }
245 } 241 }
@@ -307,7 +303,7 @@ void ipv6_sock_mc_close(struct sock *sk)
307 rcu_read_unlock(); 303 rcu_read_unlock();
308 304
309 atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc); 305 atomic_sub(sizeof(*mc_lst), &sk->sk_omem_alloc);
310 call_rcu(&mc_lst->rcu, ipv6_mc_socklist_reclaim); 306 kfree_rcu(mc_lst, rcu);
311 307
312 spin_lock(&ipv6_sk_mc_lock); 308 spin_lock(&ipv6_sk_mc_lock);
313 } 309 }
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index a6a32b39b607..1cca5761aea9 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -396,11 +396,6 @@ out:
396 return err; 396 return err;
397} 397}
398 398
399static void prl_entry_destroy_rcu(struct rcu_head *head)
400{
401 kfree(container_of(head, struct ip_tunnel_prl_entry, rcu_head));
402}
403
404static void prl_list_destroy_rcu(struct rcu_head *head) 399static void prl_list_destroy_rcu(struct rcu_head *head)
405{ 400{
406 struct ip_tunnel_prl_entry *p, *n; 401 struct ip_tunnel_prl_entry *p, *n;
@@ -428,7 +423,7 @@ ipip6_tunnel_del_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a)
428 p = &x->next) { 423 p = &x->next) {
429 if (x->addr == a->addr) { 424 if (x->addr == a->addr) {
430 *p = x->next; 425 *p = x->next;
431 call_rcu(&x->rcu_head, prl_entry_destroy_rcu); 426 kfree_rcu(x, rcu_head);
432 t->prl_count--; 427 t->prl_count--;
433 goto out; 428 goto out;
434 } 429 }
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index f7fb09ecaf89..b6466e71f5e1 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -687,7 +687,7 @@ MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
687MODULE_DESCRIPTION("L2TP over IP"); 687MODULE_DESCRIPTION("L2TP over IP");
688MODULE_VERSION("1.0"); 688MODULE_VERSION("1.0");
689 689
690/* Use the value of SOCK_DGRAM (2) directory, because __stringify does't like 690/* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
691 * enums 691 * enums
692 */ 692 */
693MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP); 693MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index cd5125f77cc5..c8be8eff70da 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -144,14 +144,6 @@ void ieee80211_assign_tid_tx(struct sta_info *sta, int tid,
144 rcu_assign_pointer(sta->ampdu_mlme.tid_tx[tid], tid_tx); 144 rcu_assign_pointer(sta->ampdu_mlme.tid_tx[tid], tid_tx);
145} 145}
146 146
147static void kfree_tid_tx(struct rcu_head *rcu_head)
148{
149 struct tid_ampdu_tx *tid_tx =
150 container_of(rcu_head, struct tid_ampdu_tx, rcu_head);
151
152 kfree(tid_tx);
153}
154
155int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, 147int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
156 enum ieee80211_back_parties initiator, 148 enum ieee80211_back_parties initiator,
157 bool tx) 149 bool tx)
@@ -174,7 +166,7 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
174 /* not even started yet! */ 166 /* not even started yet! */
175 ieee80211_assign_tid_tx(sta, tid, NULL); 167 ieee80211_assign_tid_tx(sta, tid, NULL);
176 spin_unlock_bh(&sta->lock); 168 spin_unlock_bh(&sta->lock);
177 call_rcu(&tid_tx->rcu_head, kfree_tid_tx); 169 kfree_rcu(tid_tx, rcu_head);
178 return 0; 170 return 0;
179 } 171 }
180 172
@@ -333,7 +325,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
333 spin_unlock_bh(&sta->lock); 325 spin_unlock_bh(&sta->lock);
334 326
335 ieee80211_wake_queue_agg(local, tid); 327 ieee80211_wake_queue_agg(local, tid);
336 call_rcu(&tid_tx->rcu_head, kfree_tid_tx); 328 kfree_rcu(tid_tx, rcu_head);
337 return; 329 return;
338 } 330 }
339 331
@@ -718,7 +710,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid)
718 710
719 ieee80211_agg_splice_finish(local, tid); 711 ieee80211_agg_splice_finish(local, tid);
720 712
721 call_rcu(&tid_tx->rcu_head, kfree_tid_tx); 713 kfree_rcu(tid_tx, rcu_head);
722 714
723 unlock_sta: 715 unlock_sta:
724 spin_unlock_bh(&sta->lock); 716 spin_unlock_bh(&sta->lock);
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index a94b312dbfac..d2e7f0e86677 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -65,17 +65,9 @@ static void run_again(struct ieee80211_local *local,
65 mod_timer(&local->work_timer, timeout); 65 mod_timer(&local->work_timer, timeout);
66} 66}
67 67
68static void work_free_rcu(struct rcu_head *head)
69{
70 struct ieee80211_work *wk =
71 container_of(head, struct ieee80211_work, rcu_head);
72
73 kfree(wk);
74}
75
76void free_work(struct ieee80211_work *wk) 68void free_work(struct ieee80211_work *wk)
77{ 69{
78 call_rcu(&wk->rcu_head, work_free_rcu); 70 kfree_rcu(wk, rcu_head);
79} 71}
80 72
81static int ieee80211_compatible_rates(const u8 *supp_rates, int supp_rates_len, 73static int ieee80211_compatible_rates(const u8 *supp_rates, int supp_rates_len,
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c
index 80a23ed62bb0..05ecdc281a53 100644
--- a/net/netfilter/nf_conntrack_extend.c
+++ b/net/netfilter/nf_conntrack_extend.c
@@ -68,12 +68,6 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, gfp_t gfp)
68 return (void *)(*ext) + off; 68 return (void *)(*ext) + off;
69} 69}
70 70
71static void __nf_ct_ext_free_rcu(struct rcu_head *head)
72{
73 struct nf_ct_ext *ext = container_of(head, struct nf_ct_ext, rcu);
74 kfree(ext);
75}
76
77void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp) 71void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
78{ 72{
79 struct nf_ct_ext *old, *new; 73 struct nf_ct_ext *old, *new;
@@ -114,7 +108,7 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
114 (void *)old + old->offset[i]); 108 (void *)old + old->offset[i]);
115 rcu_read_unlock(); 109 rcu_read_unlock();
116 } 110 }
117 call_rcu(&old->rcu, __nf_ct_ext_free_rcu); 111 kfree_rcu(old, rcu);
118 ct->ext = new; 112 ct->ext = new;
119 } 113 }
120 114
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c
index 4327e101c047..846f895cb656 100644
--- a/net/netfilter/xt_osf.c
+++ b/net/netfilter/xt_osf.c
@@ -62,13 +62,6 @@ static const struct nla_policy xt_osf_policy[OSF_ATTR_MAX + 1] = {
62 [OSF_ATTR_FINGER] = { .len = sizeof(struct xt_osf_user_finger) }, 62 [OSF_ATTR_FINGER] = { .len = sizeof(struct xt_osf_user_finger) },
63}; 63};
64 64
65static void xt_osf_finger_free_rcu(struct rcu_head *rcu_head)
66{
67 struct xt_osf_finger *f = container_of(rcu_head, struct xt_osf_finger, rcu_head);
68
69 kfree(f);
70}
71
72static int xt_osf_add_callback(struct sock *ctnl, struct sk_buff *skb, 65static int xt_osf_add_callback(struct sock *ctnl, struct sk_buff *skb,
73 const struct nlmsghdr *nlh, 66 const struct nlmsghdr *nlh,
74 const struct nlattr * const osf_attrs[]) 67 const struct nlattr * const osf_attrs[])
@@ -133,7 +126,7 @@ static int xt_osf_remove_callback(struct sock *ctnl, struct sk_buff *skb,
133 * We are protected by nfnl mutex. 126 * We are protected by nfnl mutex.
134 */ 127 */
135 list_del_rcu(&sf->finger_entry); 128 list_del_rcu(&sf->finger_entry);
136 call_rcu(&sf->rcu_head, xt_osf_finger_free_rcu); 129 kfree_rcu(sf, rcu_head);
137 130
138 err = 0; 131 err = 0;
139 break; 132 break;
@@ -414,7 +407,7 @@ static void __exit xt_osf_fini(void)
414 407
415 list_for_each_entry_rcu(f, &xt_osf_fingers[i], finger_entry) { 408 list_for_each_entry_rcu(f, &xt_osf_fingers[i], finger_entry) {
416 list_del_rcu(&f->finger_entry); 409 list_del_rcu(&f->finger_entry);
417 call_rcu(&f->rcu_head, xt_osf_finger_free_rcu); 410 kfree_rcu(f, rcu_head);
418 } 411 }
419 } 412 }
420 rcu_read_unlock(); 413 rcu_read_unlock();
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index e2b0a680dd56..9c38658fba8b 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -154,44 +154,6 @@ static const struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1
154 */ 154 */
155 155
156/** 156/**
157 * netlbl_unlhsh_free_addr4 - Frees an IPv4 address entry from the hash table
158 * @entry: the entry's RCU field
159 *
160 * Description:
161 * This function is designed to be used as a callback to the call_rcu()
162 * function so that memory allocated to a hash table address entry can be
163 * released safely.
164 *
165 */
166static void netlbl_unlhsh_free_addr4(struct rcu_head *entry)
167{
168 struct netlbl_unlhsh_addr4 *ptr;
169
170 ptr = container_of(entry, struct netlbl_unlhsh_addr4, rcu);
171 kfree(ptr);
172}
173
174#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
175/**
176 * netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table
177 * @entry: the entry's RCU field
178 *
179 * Description:
180 * This function is designed to be used as a callback to the call_rcu()
181 * function so that memory allocated to a hash table address entry can be
182 * released safely.
183 *
184 */
185static void netlbl_unlhsh_free_addr6(struct rcu_head *entry)
186{
187 struct netlbl_unlhsh_addr6 *ptr;
188
189 ptr = container_of(entry, struct netlbl_unlhsh_addr6, rcu);
190 kfree(ptr);
191}
192#endif /* IPv6 */
193
194/**
195 * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table 157 * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table
196 * @entry: the entry's RCU field 158 * @entry: the entry's RCU field
197 * 159 *
@@ -568,7 +530,7 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
568 if (entry == NULL) 530 if (entry == NULL)
569 return -ENOENT; 531 return -ENOENT;
570 532
571 call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4); 533 kfree_rcu(entry, rcu);
572 return 0; 534 return 0;
573} 535}
574 536
@@ -629,7 +591,7 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
629 if (entry == NULL) 591 if (entry == NULL)
630 return -ENOENT; 592 return -ENOENT;
631 593
632 call_rcu(&entry->rcu, netlbl_unlhsh_free_addr6); 594 kfree_rcu(entry, rcu);
633 return 0; 595 return 0;
634} 596}
635#endif /* IPv6 */ 597#endif /* IPv6 */
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c8f35b5d2ee9..5fe4f3b04ed3 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1566,12 +1566,6 @@ netlink_kernel_release(struct sock *sk)
1566} 1566}
1567EXPORT_SYMBOL(netlink_kernel_release); 1567EXPORT_SYMBOL(netlink_kernel_release);
1568 1568
1569
1570static void listeners_free_rcu(struct rcu_head *head)
1571{
1572 kfree(container_of(head, struct listeners, rcu));
1573}
1574
1575int __netlink_change_ngroups(struct sock *sk, unsigned int groups) 1569int __netlink_change_ngroups(struct sock *sk, unsigned int groups)
1576{ 1570{
1577 struct listeners *new, *old; 1571 struct listeners *new, *old;
@@ -1588,7 +1582,7 @@ int __netlink_change_ngroups(struct sock *sk, unsigned int groups)
1588 memcpy(new->masks, old->masks, NLGRPSZ(tbl->groups)); 1582 memcpy(new->masks, old->masks, NLGRPSZ(tbl->groups));
1589 rcu_assign_pointer(tbl->listeners, new); 1583 rcu_assign_pointer(tbl->listeners, new);
1590 1584
1591 call_rcu(&old->rcu, listeners_free_rcu); 1585 kfree_rcu(old, rcu);
1592 } 1586 }
1593 tbl->groups = groups; 1587 tbl->groups = groups;
1594 1588
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 47b3452675b6..d2df8f33160b 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -162,14 +162,6 @@ int phonet_address_add(struct net_device *dev, u8 addr)
162 return err; 162 return err;
163} 163}
164 164
165static void phonet_device_rcu_free(struct rcu_head *head)
166{
167 struct phonet_device *pnd;
168
169 pnd = container_of(head, struct phonet_device, rcu);
170 kfree(pnd);
171}
172
173int phonet_address_del(struct net_device *dev, u8 addr) 165int phonet_address_del(struct net_device *dev, u8 addr)
174{ 166{
175 struct phonet_device_list *pndevs = phonet_device_list(dev_net(dev)); 167 struct phonet_device_list *pndevs = phonet_device_list(dev_net(dev));
@@ -188,7 +180,7 @@ int phonet_address_del(struct net_device *dev, u8 addr)
188 mutex_unlock(&pndevs->lock); 180 mutex_unlock(&pndevs->lock);
189 181
190 if (pnd) 182 if (pnd)
191 call_rcu(&pnd->rcu, phonet_device_rcu_free); 183 kfree_rcu(pnd, rcu);
192 184
193 return err; 185 return err;
194} 186}
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 14b42f4ad791..a606025814a1 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -26,11 +26,6 @@
26#include <net/act_api.h> 26#include <net/act_api.h>
27#include <net/netlink.h> 27#include <net/netlink.h>
28 28
29static void tcf_common_free_rcu(struct rcu_head *head)
30{
31 kfree(container_of(head, struct tcf_common, tcfc_rcu));
32}
33
34void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) 29void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo)
35{ 30{
36 unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask); 31 unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask);
@@ -47,7 +42,7 @@ void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo)
47 * gen_estimator est_timer() might access p->tcfc_lock 42 * gen_estimator est_timer() might access p->tcfc_lock
48 * or bstats, wait a RCU grace period before freeing p 43 * or bstats, wait a RCU grace period before freeing p
49 */ 44 */
50 call_rcu(&p->tcfc_rcu, tcf_common_free_rcu); 45 kfree_rcu(p, tcfc_rcu);
51 return; 46 return;
52 } 47 }
53 } 48 }
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 8a1630774fd6..b3b9b32f4e00 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -96,11 +96,6 @@ nla_put_failure:
96 goto done; 96 goto done;
97} 97}
98 98
99static void tcf_police_free_rcu(struct rcu_head *head)
100{
101 kfree(container_of(head, struct tcf_police, tcf_rcu));
102}
103
104static void tcf_police_destroy(struct tcf_police *p) 99static void tcf_police_destroy(struct tcf_police *p)
105{ 100{
106 unsigned int h = tcf_hash(p->tcf_index, POL_TAB_MASK); 101 unsigned int h = tcf_hash(p->tcf_index, POL_TAB_MASK);
@@ -121,7 +116,7 @@ static void tcf_police_destroy(struct tcf_police *p)
121 * gen_estimator est_timer() might access p->tcf_lock 116 * gen_estimator est_timer() might access p->tcf_lock
122 * or bstats, wait a RCU grace period before freeing p 117 * or bstats, wait a RCU grace period before freeing p
123 */ 118 */
124 call_rcu(&p->tcf_rcu, tcf_police_free_rcu); 119 kfree_rcu(p, tcf_rcu);
125 return; 120 return;
126 } 121 }
127 } 122 }
@@ -401,7 +396,6 @@ static void __exit
401police_cleanup_module(void) 396police_cleanup_module(void)
402{ 397{
403 tcf_unregister_action(&act_police_ops); 398 tcf_unregister_action(&act_police_ops);
404 rcu_barrier(); /* Wait for completion of call_rcu()'s (tcf_police_free_rcu) */
405} 399}
406 400
407module_init(police_init_module); 401module_init(police_init_module);
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 6150ac5cf5dd..6338413376c8 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -217,7 +217,7 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
217 } 217 }
218 218
219 if (found) { 219 if (found) {
220 call_rcu(&addr->rcu, sctp_local_addr_free); 220 kfree_rcu(addr, rcu);
221 SCTP_DBG_OBJCNT_DEC(addr); 221 SCTP_DBG_OBJCNT_DEC(addr);
222 return 0; 222 return 0;
223 } 223 }
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 500875f4dc41..0bb0d7cb9f10 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -130,7 +130,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
130 } 130 }
131 spin_unlock_bh(&sctp_local_addr_lock); 131 spin_unlock_bh(&sctp_local_addr_lock);
132 if (found) 132 if (found)
133 call_rcu(&addr->rcu, sctp_local_addr_free); 133 kfree_rcu(addr, rcu);
134 break; 134 break;
135 } 135 }
136 136
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 4de77cb80d88..67380a29e2e9 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -230,13 +230,6 @@ static void sctp_free_local_addr_list(void)
230 } 230 }
231} 231}
232 232
233void sctp_local_addr_free(struct rcu_head *head)
234{
235 struct sctp_sockaddr_entry *e = container_of(head,
236 struct sctp_sockaddr_entry, rcu);
237 kfree(e);
238}
239
240/* Copy the local addresses which are valid for 'scope' into 'bp'. */ 233/* Copy the local addresses which are valid for 'scope' into 'bp'. */
241int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope, 234int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope,
242 gfp_t gfp, int copy_flags) 235 gfp_t gfp, int copy_flags)
@@ -675,7 +668,7 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
675 } 668 }
676 spin_unlock_bh(&sctp_local_addr_lock); 669 spin_unlock_bh(&sctp_local_addr_lock);
677 if (found) 670 if (found)
678 call_rcu(&addr->rcu, sctp_local_addr_free); 671 kfree_rcu(addr, rcu);
679 break; 672 break;
680 } 673 }
681 674
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index c962c6062aab..e70e5fc87890 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -554,7 +554,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
554 memcpy(&ssf->ssf_info, &chunk->sinfo, sizeof(struct sctp_sndrcvinfo)); 554 memcpy(&ssf->ssf_info, &chunk->sinfo, sizeof(struct sctp_sndrcvinfo));
555 555
556 /* Per TSVWG discussion with Randy. Allow the application to 556 /* Per TSVWG discussion with Randy. Allow the application to
557 * resemble a fragmented message. 557 * reassemble a fragmented message.
558 */ 558 */
559 ssf->ssf_info.sinfo_flags = chunk->chunk_hdr->flags; 559 ssf->ssf_info.sinfo_flags = chunk->chunk_hdr->flags;
560 560
diff --git a/net/socket.c b/net/socket.c
index 2d5382d0de54..02dc82db3d23 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -263,15 +263,6 @@ static struct inode *sock_alloc_inode(struct super_block *sb)
263 return &ei->vfs_inode; 263 return &ei->vfs_inode;
264} 264}
265 265
266
267
268static void wq_free_rcu(struct rcu_head *head)
269{
270 struct socket_wq *wq = container_of(head, struct socket_wq, rcu);
271
272 kfree(wq);
273}
274
275static void sock_destroy_inode(struct inode *inode) 266static void sock_destroy_inode(struct inode *inode)
276{ 267{
277 struct socket_alloc *ei; 268 struct socket_alloc *ei;
@@ -279,7 +270,7 @@ static void sock_destroy_inode(struct inode *inode)
279 270
280 ei = container_of(inode, struct socket_alloc, vfs_inode); 271 ei = container_of(inode, struct socket_alloc, vfs_inode);
281 wq = rcu_dereference_protected(ei->socket.wq, 1); 272 wq = rcu_dereference_protected(ei->socket.wq, 1);
282 call_rcu(&wq->rcu, wq_free_rcu); 273 kfree_rcu(wq, rcu);
283 kmem_cache_free(sock_inode_cachep, ei); 274 kmem_cache_free(sock_inode_cachep, ei);
284} 275}
285 276
diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig
index 8873fd8ddacd..b2198e65d8bb 100644
--- a/net/sunrpc/Kconfig
+++ b/net/sunrpc/Kconfig
@@ -18,14 +18,13 @@ config SUNRPC_XPRT_RDMA
18 If unsure, say N. 18 If unsure, say N.
19 19
20config RPCSEC_GSS_KRB5 20config RPCSEC_GSS_KRB5
21 tristate 21 tristate "Secure RPC: Kerberos V mechanism"
22 depends on SUNRPC && CRYPTO 22 depends on SUNRPC && CRYPTO
23 prompt "Secure RPC: Kerberos V mechanism" if !(NFS_V4 || NFSD_V4) 23 depends on CRYPTO_MD5 && CRYPTO_DES && CRYPTO_CBC && CRYPTO_CTS
24 depends on CRYPTO_ECB && CRYPTO_HMAC && CRYPTO_SHA1 && CRYPTO_AES
25 depends on CRYPTO_ARC4
24 default y 26 default y
25 select SUNRPC_GSS 27 select SUNRPC_GSS
26 select CRYPTO_MD5
27 select CRYPTO_DES
28 select CRYPTO_CBC
29 help 28 help
30 Choose Y here to enable Secure RPC using the Kerberos version 5 29 Choose Y here to enable Secure RPC using the Kerberos version 5
31 GSS-API mechanism (RFC 1964). 30 GSS-API mechanism (RFC 1964).
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index f3914d0c5079..339ba64cce1e 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -520,7 +520,7 @@ gss_refresh_upcall(struct rpc_task *task)
520 warn_gssd(); 520 warn_gssd();
521 task->tk_timeout = 15*HZ; 521 task->tk_timeout = 15*HZ;
522 rpc_sleep_on(&pipe_version_rpc_waitqueue, task, NULL); 522 rpc_sleep_on(&pipe_version_rpc_waitqueue, task, NULL);
523 return 0; 523 return -EAGAIN;
524 } 524 }
525 if (IS_ERR(gss_msg)) { 525 if (IS_ERR(gss_msg)) {
526 err = PTR_ERR(gss_msg); 526 err = PTR_ERR(gss_msg);
@@ -563,10 +563,12 @@ retry:
563 if (PTR_ERR(gss_msg) == -EAGAIN) { 563 if (PTR_ERR(gss_msg) == -EAGAIN) {
564 err = wait_event_interruptible_timeout(pipe_version_waitqueue, 564 err = wait_event_interruptible_timeout(pipe_version_waitqueue,
565 pipe_version >= 0, 15*HZ); 565 pipe_version >= 0, 15*HZ);
566 if (pipe_version < 0) {
567 warn_gssd();
568 err = -EACCES;
569 }
566 if (err) 570 if (err)
567 goto out; 571 goto out;
568 if (pipe_version < 0)
569 warn_gssd();
570 goto retry; 572 goto retry;
571 } 573 }
572 if (IS_ERR(gss_msg)) { 574 if (IS_ERR(gss_msg)) {
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index e7a96e478f63..8d83f9d48713 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1508,7 +1508,10 @@ call_timeout(struct rpc_task *task)
1508 if (clnt->cl_chatty) 1508 if (clnt->cl_chatty)
1509 printk(KERN_NOTICE "%s: server %s not responding, timed out\n", 1509 printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
1510 clnt->cl_protname, clnt->cl_server); 1510 clnt->cl_protname, clnt->cl_server);
1511 rpc_exit(task, -EIO); 1511 if (task->tk_flags & RPC_TASK_TIMEOUT)
1512 rpc_exit(task, -ETIMEDOUT);
1513 else
1514 rpc_exit(task, -EIO);
1512 return; 1515 return;
1513 } 1516 }
1514 1517
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 9494c3767356..ce5eb68a9664 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -906,6 +906,7 @@ void xprt_transmit(struct rpc_task *task)
906 } 906 }
907 907
908 dprintk("RPC: %5u xmit complete\n", task->tk_pid); 908 dprintk("RPC: %5u xmit complete\n", task->tk_pid);
909 task->tk_flags |= RPC_TASK_SENT;
909 spin_lock_bh(&xprt->transport_lock); 910 spin_lock_bh(&xprt->transport_lock);
910 911
911 xprt->ops->set_retrans_timeout(task); 912 xprt->ops->set_retrans_timeout(task);