All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netfilter-devel@lists.netfilter.org, Patrick McHardy <kaber@trash.net>
Subject: [NETFILTER 08/12]: nfnetlink_log: remove conditional locking
Date: Fri, 23 Mar 2007 15:05:10 +0100 (MET)	[thread overview]
Message-ID: <20070323140444.22987.44402.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20070323140433.22987.44867.sendpatchset@localhost.localdomain>

[NETFILTER]: nfnetlink_log: remove conditional locking

This is gross, have the wrapper function take the lock.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 6f67806947ea58fd8bdf2b44dd748bb3fb8752d7
tree bc21f4b37cc3170aaf5b8130af193c643d367c7b
parent d5e28a22dfd6b5a6b2d80565cb0347b093a1a85b
author Patrick McHardy <kaber@trash.net> Thu, 22 Mar 2007 23:02:52 +0100
committer Patrick McHardy <kaber@trash.net> Fri, 23 Mar 2007 11:00:22 +0100

 net/netfilter/nfnetlink_log.c |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 34de3d8..0ae0656 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -195,20 +195,14 @@ out_unlock:
 static int __nfulnl_send(struct nfulnl_instance *inst);
 
 static void
-_instance_destroy2(struct nfulnl_instance *inst, int lock)
+__instance_destroy(struct nfulnl_instance *inst)
 {
 	/* first pull it out of the global list */
-	if (lock)
-		write_lock_bh(&instances_lock);
-
 	UDEBUG("removing instance %p (queuenum=%u) from hash\n",
 		inst, inst->group_num);
 
 	hlist_del(&inst->hlist);
 
-	if (lock)
-		write_unlock_bh(&instances_lock);
-
 	/* then flush all pending packets from skb */
 
 	spin_lock_bh(&inst->lock);
@@ -230,15 +224,11 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)
 }
 
 static inline void
-__instance_destroy(struct nfulnl_instance *inst)
-{
-	_instance_destroy2(inst, 0);
-}
-
-static inline void
 instance_destroy(struct nfulnl_instance *inst)
 {
-	_instance_destroy2(inst, 1);
+	write_lock_bh(&instances_lock);
+	__instance_destroy(inst);
+	write_unlock_bh(&instances_lock);
 }
 
 static int

  parent reply	other threads:[~2007-03-23 14:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-23 14:04 [NETFILTER 00/12]: Netfilter update part II Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 01/12]: Remove changelogs and CVS IDs Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 02/12]: nfnetlink_log: don't count max(a,b) twice Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 03/12]: nfnetlink_log: kill duplicate code Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 04/12]: nfnetlink_log: micro-optimization for inst==NULL in nfulnl_recv_config() Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 05/12]: nfnetlink_log: micro-optimization: don't modify destroyed instance Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 06/12]: nfnetlink_log: iterator functions need iter_state * only Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 07/12]: nfnetlink_log: micro-optimization: inst->skb != NULL in __nfulnl_send() Patrick McHardy
2007-03-23 14:05 ` Patrick McHardy [this message]
2007-03-23 14:05 ` [NETFILTER 09/12]: Use setup_timer Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 10/12]: nf_conntrack: don't use nfct in skb if conntrack is disabled Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 11/12]: nf_conntrack: kill destroy() in struct nf_conntrack for diet Patrick McHardy
2007-03-23 14:05 ` [NETFILTER] nfnetlink: netlink_run_queue() already checks for NLM_F_REQUEST Patrick McHardy
2007-03-23 18:24 ` [NETFILTER 00/12]: Netfilter update part II 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=20070323140444.22987.44402.sendpatchset@localhost.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netfilter-devel@lists.netfilter.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.