Skip to contentSkip to conversation

remove nfnl_[lock|unlock] functions

PATCH In review Pablo Neira Ayuso 2 participants 2 messages Feb 12, 2007 – Feb 13, 2007

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 2/7 remove nfnl_[lock|unlock] functions

Use nfnl_shlock instead

Signature · 2 lines
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

[PATCH] remove nfnl_[lock|unlock] functions

Use nfnl_shlock instead

net/netfilter/nfnetlink.c +5 -15
Index: net-2.6.git/net/netfilter/nfnetlink.c
===================================================================
@@ -46,34 +46,24 @@ 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();
+	nfnl_shlock();
 	if (subsys_table[n->subsys_id]) {
-		nfnl_unlock();
+		nfnl_shunlock();
 		return -EBUSY;
 	}
 	subsys_table[n->subsys_id] = n;
-	nfnl_unlock();
+	nfnl_shunlock();
 
 	return 0;
 }
 
 int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n)
 {
-	nfnl_lock();
+	nfnl_shlock();
 	subsys_table[n->subsys_id] = NULL;
-	nfnl_unlock();
+	nfnl_shunlock();
 
 	return 0;
 }
include/linux/netfilter/nfnetlink.h +0 -3
Index: net-2.6.git/include/linux/netfilter/nfnetlink.h
===================================================================
@@ -139,9 +139,6 @@ extern struct semaphore nfnl_sem;
 					    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);
 
#1 lore raw
Quoted 10 lines · Pablo Neira Ayuso

Use nfnl_shlock instead

------------------------------------------------------------------------

[PATCH] remove nfnl_[lock|unlock] functions

Use nfnl_shlock instead

I would prefer to keep nfnl_lock/unlock and remove _shlock instead, similar to rtnetlink.c.