From patchwork Mon May 2 16:13:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 1339 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:51:04 -0000 Delivered-To: patches@linaro.org Received: by 10.224.2.73 with SMTP id 9cs270085qai; Mon, 2 May 2011 14:37:36 -0700 (PDT) Received: by 10.151.82.4 with SMTP id j4mr2873690ybl.6.1304372255863; Mon, 02 May 2011 14:37:35 -0700 (PDT) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.144]) by mx.google.com with ESMTPS id f13si10552394ybi.34.2011.05.02.14.37.35 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 May 2011 14:37:35 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.144 as permitted sender) client-ip=32.97.182.144; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.144 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p42LH50u021408 for ; Mon, 2 May 2011 17:17:05 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p42LapRs178944 for ; Mon, 2 May 2011 17:37:16 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p42Lalki001360 for ; Mon, 2 May 2011 17:36:50 -0400 Received: from paulmck-ThinkPad-W500 (sig-9-65-212-103.mts.ibm.com [9.65.212.103]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p42Lai1S001134; Mon, 2 May 2011 17:36:45 -0400 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 487E713F7D7; Mon, 2 May 2011 09:13:45 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, patches@linaro.org, "Paul E. McKenney" , Patrick McHardy , "David S. Miller" Subject: [PATCH tip/core/rcu 1/7] net, rcu: convert call_rcu(sk_filter_release_rcu) to kfree_rcu Date: Mon, 2 May 2011 09:13:38 -0700 Message-Id: <1304352824-6563-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <20110502161321.GA6537@linux.vnet.ibm.com> References: <20110502161321.GA6537@linux.vnet.ibm.com> The RCU callback sk_filter_release_rcu just calls kfree(), so we use kfree_rcu() instead of call_rcu(). Signed-off-by: Paul E. McKenney Cc: Patrick McHardy Cc: David S. Miller --- include/net/sock.h | 4 +--- net/core/filter.c | 12 ------------ 2 files changed, 1 insertions(+), 15 deletions(-) diff --git a/include/net/sock.h b/include/net/sock.h index 01810a3..60caa06 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1179,8 +1179,6 @@ extern void sk_common_release(struct sock *sk); /* Initialise core socket variables */ extern void sock_init_data(struct socket *sock, struct sock *sk); -extern void sk_filter_release_rcu(struct rcu_head *rcu); - /** * sk_filter_release - release a socket filter * @fp: filter to remove @@ -1191,7 +1189,7 @@ extern void sk_filter_release_rcu(struct rcu_head *rcu); static inline void sk_filter_release(struct sk_filter *fp) { if (atomic_dec_and_test(&fp->refcnt)) - call_rcu(&fp->rcu, sk_filter_release_rcu); + kfree_rcu(fp, rcu); } static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) diff --git a/net/core/filter.c b/net/core/filter.c index afb8afb..7195ce0 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -631,18 +631,6 @@ int sk_chk_filter(struct sock_filter *filter, int flen) EXPORT_SYMBOL(sk_chk_filter); /** - * sk_filter_release_rcu - Release a socket filter by rcu_head - * @rcu: rcu_head that contains the sk_filter to free - */ -void sk_filter_release_rcu(struct rcu_head *rcu) -{ - struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); - - kfree(fp); -} -EXPORT_SYMBOL(sk_filter_release_rcu); - -/** * sk_attach_filter - attach a socket filter * @fprog: the filter program * @sk: the socket to use