All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
To: Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>,
	"Paul E. McKenney"
	<paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>,
	Trond Myklebust
	<Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 11/17] net,rcu: convert call_rcu(sctp_local_addr_free) to kfree_rcu()
Date: Tue, 15 Mar 2011 18:05:02 +0800	[thread overview]
Message-ID: <4D7F39CE.80403@cn.fujitsu.com> (raw)
In-Reply-To: <4D7F3610.6000809-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>



The rcu callback sctp_local_addr_free() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(sctp_local_addr_free).

Signed-off-by: Lai Jiangshan <laijs-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
---
 include/net/sctp/sctp.h |    1 -
 net/sctp/bind_addr.c    |    2 +-
 net/sctp/ipv6.c         |    2 +-
 net/sctp/protocol.c     |    9 +--------
 4 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 505845d..01e094c 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -115,7 +115,6 @@
  * sctp/protocol.c
  */
 extern struct sock *sctp_get_ctl_sock(void);
-extern void sctp_local_addr_free(struct rcu_head *head);
 extern int sctp_copy_local_addr_list(struct sctp_bind_addr *,
 				     sctp_scope_t, gfp_t gfp,
 				     int flags);
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index faf71d1..3c06c87 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -219,7 +219,7 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
 	}
 
 	if (found) {
-		call_rcu(&addr->rcu, sctp_local_addr_free);
+		kfree_rcu(addr, rcu);
 		SCTP_DBG_OBJCNT_DEC(addr);
 		return 0;
 	}
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 95e0c8e..1960234 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -123,7 +123,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
 		}
 		spin_unlock_bh(&sctp_local_addr_lock);
 		if (found)
-			call_rcu(&addr->rcu, sctp_local_addr_free);
+			kfree_rcu(addr, rcu);
 		break;
 	}
 
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index e58f947..26c7697 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -230,13 +230,6 @@ static void sctp_free_local_addr_list(void)
 	}
 }
 
-void sctp_local_addr_free(struct rcu_head *head)
-{
-	struct sctp_sockaddr_entry *e = container_of(head,
-				struct sctp_sockaddr_entry, rcu);
-	kfree(e);
-}
-
 /* Copy the local addresses which are valid for 'scope' into 'bp'.  */
 int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope,
 			      gfp_t gfp, int copy_flags)
@@ -680,7 +673,7 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
 		}
 		spin_unlock_bh(&sctp_local_addr_lock);
 		if (found)
-			call_rcu(&addr->rcu, sctp_local_addr_free);
+			kfree_rcu(addr, rcu);
 		break;
 	}
 
-- 
1.7.4

  parent reply	other threads:[~2011-03-15 10:05 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15  9:49 [PATCH 0/17] rcu: covert call_rcu(simple_kfree_callbck) to kfree_rcu() (PART 1) Lai Jiangshan
     [not found] ` <4D7F3610.6000809-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15  9:53   ` [PATCH 01/17] cgroup, rcu: convert call_rcu(free_css_set_rcu) to kfree_rcu() Lai Jiangshan
     [not found]     ` <4D7F372A.6050407-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 20:03       ` Paul Menage
2011-03-15 20:03         ` Paul Menage
2011-03-15  9:55   ` [PATCH 02/17] cgroup, rcu: convert call_rcu(free_cgroup_rcu) " Lai Jiangshan
     [not found]     ` <4D7F3784.6090307-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 20:04       ` Paul Menage
2011-03-15 20:04         ` Paul Menage
2011-03-15  9:56   ` [PATCH 03/17] cgroup, rcu: convert call_rcu(__free_css_id_cb) " Lai Jiangshan
     [not found]     ` <4D7F37BA.5000308-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 20:04       ` Paul Menage
2011-03-15 20:04         ` Paul Menage
2011-03-15  9:57   ` [PATCH 04/17] net, rcu: convert call_rcu(tcf_common_free_rcu) " Lai Jiangshan
     [not found]     ` <4D7F37F0.1050801-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 21:02       ` [PATCH 04/17] net,rcu: " David Miller
2011-03-15 21:02         ` David Miller
2011-03-15 21:02         ` [PATCH 04/17] net,rcu: convert call_rcu(tcf_common_free_rcu) David Miller
2011-03-15 21:02         ` [PATCH 04/17] net,rcu: convert call_rcu(tcf_common_free_rcu) to kfree_rcu() David Miller
2011-03-15  9:58   ` [PATCH 05/17] net, rcu: convert call_rcu(tcf_police_free_rcu) " Lai Jiangshan
     [not found]     ` <4D7F3828.4040403-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 21:02       ` [PATCH 05/17] net,rcu: " David Miller
2011-03-15 21:02         ` David Miller
2011-03-15 21:02         ` [PATCH 05/17] net,rcu: convert call_rcu(tcf_police_free_rcu) David Miller
2011-03-15 21:02         ` [PATCH 05/17] net,rcu: convert call_rcu(tcf_police_free_rcu) to kfree_rcu() David Miller
2011-03-15  9:59   ` [PATCH 06/17] net,rcu: convert call_rcu(in6_dev_finish_destroy_rcu) " Lai Jiangshan
     [not found]     ` <4D7F3872.6090305-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 21:03       ` David Miller
2011-03-15 21:03     ` David Miller
2011-03-15 21:03       ` [PATCH 06/17] net,rcu: convert David Miller
2011-03-15 10:00   ` [PATCH 07/17] net, rcu: convert call_rcu(inet6_ifa_finish_destroy_rcu) to kfree_rcu() Lai Jiangshan
2011-03-15 21:03     ` [PATCH 07/17] net,rcu: " David Miller
2011-03-15 21:03       ` [PATCH 07/17] net,rcu: convert David Miller
     [not found]     ` <4D7F38AE.7060708-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 21:03       ` [PATCH 07/17] net,rcu: convert call_rcu(inet6_ifa_finish_destroy_rcu) to kfree_rcu() David Miller
2011-03-15 10:01   ` [PATCH 08/17] net, rcu: convert call_rcu(listeners_free_rcu) " Lai Jiangshan
     [not found]     ` <4D7F3906.3090107-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 21:03       ` [PATCH 08/17] net,rcu: " David Miller
2011-03-15 21:03         ` David Miller
2011-03-15 21:03         ` [PATCH 08/17] net,rcu: convert call_rcu(listeners_free_rcu) to David Miller
2011-03-15 21:03         ` [PATCH 08/17] net,rcu: convert call_rcu(listeners_free_rcu) to kfree_rcu() David Miller
2011-03-15 10:02   ` [PATCH 09/17] net,rcu: convert call_rcu(kfree_tid_tx) " Lai Jiangshan
2011-03-15 10:03   ` [PATCH 10/17] audit_tree, rcu: convert call_rcu(__put_tree) " Lai Jiangshan
2011-03-15 10:05   ` Lai Jiangshan [this message]
2011-03-15 21:03     ` [PATCH 11/17] net,rcu: convert call_rcu(sctp_local_addr_free) " David Miller
2011-03-15 21:03       ` David Miller
2011-03-15 21:03       ` David Miller
2011-03-15 21:03       ` [PATCH 11/17] net,rcu: convert call_rcu(sctp_local_addr_free) David Miller
     [not found]     ` <4D7F39CE.80403-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 21:03       ` [PATCH 11/17] net,rcu: convert call_rcu(sctp_local_addr_free) to kfree_rcu() David Miller
2011-03-15 10:06   ` [PATCH 12/17] block, rcu: convert call_rcu(cfq_cfqd_free) " Lai Jiangshan
2011-03-15 10:07   ` [PATCH 13/17] nfs, rcu: convert call_rcu(nfs_free_delegation_callback) " Lai Jiangshan
2011-03-15 10:07   ` [PATCH 14/17] security,rcu: convert call_rcu(whitelist_item_free) " Lai Jiangshan
2011-03-15 10:08   ` [PATCH 15/17] net,rcu: convert call_rcu(ha_rcu_free) " Lai Jiangshan
2011-03-15 21:04     ` David Miller
2011-03-15 21:04       ` David Miller
2011-03-15 21:04       ` David Miller
2011-03-15 21:04       ` [PATCH 15/17] net,rcu: convert call_rcu(ha_rcu_free) to David Miller
     [not found]     ` <4D7F3ABA.7020709-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 21:04       ` [PATCH 15/17] net,rcu: convert call_rcu(ha_rcu_free) to kfree_rcu() David Miller
2011-03-15 10:10   ` [PATCH 16/17] net, rcu: convert call_rcu(dn_dev_free_ifa_rcu) " Lai Jiangshan
2011-03-15 21:04     ` [PATCH 16/17] net,rcu: " David Miller
2011-03-15 21:04       ` [PATCH 16/17] net,rcu: convert call_rcu(dn_dev_free_ifa_rcu) David Miller
     [not found]     ` <4D7F3B04.9080504-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 21:04       ` [PATCH 16/17] net,rcu: convert call_rcu(dn_dev_free_ifa_rcu) to kfree_rcu() David Miller
2011-03-15 10:11   ` [PATCH 17/17] net,act_police,rcu: remove rcu_barrier() Lai Jiangshan
2011-03-15 21:04     ` David Miller
2011-03-15 21:04       ` David Miller
     [not found]     ` <4D7F3B62.6000005-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-03-15 11:04       ` Eric Dumazet
2011-03-15 11:04         ` Eric Dumazet
2011-03-16  3:13         ` Lai Jiangshan
2011-03-16  3:13           ` Lai Jiangshan
2011-03-15 21:04       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D7F39CE.80403@cn.fujitsu.com \
    --to=laijs-bthxqxjhjhxqfuhtdcdx3a@public.gmane.org \
    --cc=Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
    --cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=mingo-X9Un+BFzKDI@public.gmane.org \
    --cc=paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.