All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Subject: [PATCH 2/6] remove nfnl_[shlock|shunlock] functions
Date: Thu, 15 Feb 2007 04:22:55 +0100	[thread overview]
Message-ID: <45D3D20F.3090409@netfilter.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

Use nfnl_[lock|unlock] instead

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

[-- Attachment #2: 02.patch --]
[-- Type: text/plain, Size: 2746 bytes --]

[PATCH] remove nfnl_[shlock|shunlock] functions

Use nfnl_[lock|unlock] instead

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Index: net-2.6.git/net/netfilter/nfnetlink.c
===================================================================
--- net-2.6.git.orig/net/netfilter/nfnetlink.c	2007-02-15 02:54:51.000000000 +0100
+++ net-2.6.git/net/netfilter/nfnetlink.c	2007-02-15 03:03:17.000000000 +0100
@@ -46,16 +46,6 @@ static struct sock *nfnl = NULL;
 static struct nfnetlink_subsystem *subsys_table[NFNL_SUBSYS_COUNT];
 DECLARE_MUTEX(nfnl_sem);
 
-void nfnl_lock(void)
-{
-	nfnl_shlock();
-}
-
-void nfnl_unlock(void)
-{
-	nfnl_shunlock();
-}
-
 int nfnetlink_subsys_register(struct nfnetlink_subsystem *n)
 {
 	nfnl_lock();
@@ -224,11 +214,11 @@ static int nfnetlink_rcv_msg(struct sk_b
 	ss = nfnetlink_get_subsys(type);
 	if (!ss) {
 #ifdef CONFIG_KMOD
-		/* don't call nfnl_shunlock, since it would reenter
+		/* don't call nfnl_unlock, since it would reenter
 		 * with further packet processing */
 		up(&nfnl_sem);
 		request_module("nfnetlink-subsys-%d", NFNL_SUBSYS_ID(type));
-		nfnl_shlock();
+		nfnl_lock();
 		ss = nfnetlink_get_subsys(type);
 		if (!ss)
 #endif
@@ -294,7 +284,7 @@ static void nfnetlink_rcv(struct sock *s
 	do {
 		struct sk_buff *skb;
 
-		if (nfnl_shlock_nowait())
+		if (nfnl_lock_nowait())
 			return;
 
 		while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) {
@@ -309,7 +299,7 @@ static void nfnetlink_rcv(struct sock *s
 			kfree_skb(skb);
 		}
 
-		/* don't call nfnl_shunlock, since it would reenter
+		/* don't call nfnl_unlock, since it would reenter
 		 * with further packet processing */
 		up(&nfnl_sem);
 	} while(nfnl && nfnl->sk_receive_queue.qlen);
Index: net-2.6.git/include/linux/netfilter/nfnetlink.h
===================================================================
--- net-2.6.git.orig/include/linux/netfilter/nfnetlink.h	2007-02-15 02:51:43.000000000 +0100
+++ net-2.6.git/include/linux/netfilter/nfnetlink.h	2007-02-15 03:03:37.000000000 +0100
@@ -131,17 +131,14 @@ extern void __nfa_fill(struct sk_buff *s
 
 extern struct semaphore nfnl_sem;
 
-#define nfnl_shlock()		down(&nfnl_sem)
-#define nfnl_shlock_nowait()	down_trylock(&nfnl_sem)
+#define nfnl_lock()		down(&nfnl_sem)
+#define nfnl_lock_nowait()	down_trylock(&nfnl_sem)
 
-#define nfnl_shunlock()		do { up(&nfnl_sem); \
+#define nfnl_unlock()		do { up(&nfnl_sem); \
 				     if(nfnl && nfnl->sk_receive_queue.qlen) \
 					    nfnl->sk_data_ready(nfnl, 0); \
                         	} while(0)
 
-extern void nfnl_lock(void);
-extern void nfnl_unlock(void);
-
 extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n);
 extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n);
 

                 reply	other threads:[~2007-02-15  3:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=45D3D20F.3090409@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.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.