Skip to contentSkip to conversation

kill lockhelp.h for u32

PATCH In review Samir Bellabes 3 participants 3 messages Aug 30, 2005 – Sep 19, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kill lockhelp.h for u32

Hi,
this fix missing lockhelp.h for u32

regards,
Samir Bellabes

[NETFILTER] kill lockhelp.h for u32

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

 ipt_u32.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

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

net/ipv4/netfilter/ipt_u32.c +5 -6
Index: linux-2.6/net/ipv4/netfilter/ipt_u32.c
===================================================================
@@ -105,7 +105,6 @@
 
 #include <linux/netfilter_ipv4/ipt_u32.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
-#include <linux/netfilter_ipv4/lockhelp.h>
 
 /* #include <asm-i386/timex.h> for timing */
 
@@ -115,7 +114,7 @@
 
 /* This is slow, but it's simple. --RR */
 static char u32_buffer[65536];
-static DECLARE_LOCK(u32_lock);
+static DEFINE_SPINLOCK(u32_lock);
 
 static int
 match(const struct sk_buff *skb,
@@ -136,7 +135,7 @@
 
 	u_int32_t AttPos;
 
-	LOCK_BH(&u32_lock);
+	spin_lock_bh(&u32_lock);
 
 	head = skb_header_pointer(skb, 0, skb->len, u32_buffer);
 	BUG_ON(head == NULL);
@@ -148,7 +147,7 @@
 	        AttPos = 0;
 		pos = data->tests[testind].location[0].number;
 		if (AttPos + pos + 3 > skb->len || AttPos + pos < 0){
-			UNLOCK_BH(&u32_lock);
+			spin_unlock_bh(&u32_lock);
 			return 0;
 		}
 		val = (base[pos]<<24) + (base[pos+1]<<16) +
@@ -190,13 +189,13 @@
 			/* cycles2 = get_cycles(); 
 			   printk("failed %d in %d cycles\n", testind, 
 				  cycles2-cycles1); */
-			UNLOCK_BH(&u32_lock);
+			spin_unlock_bh(&u32_lock);
 			return 0;
 		}
 	}
 	/* cycles2 = get_cycles();
 	   printk("succeeded in %d cycles\n", cycles2-cycles1); */
-	UNLOCK_BH(&u32_lock);
+	spin_unlock_bh(&u32_lock);
 	return 1;
 }
 
#1 lore raw
Quoted 2 lines · Samir Bellabes

Hi,
this fix missing lockhelp.h for u32

Any chances for inclusion in pom-ng?

Best regards,

Krzysztof Olędzki

#2 lore raw
Quoted 8 lines · Krzysztof Oledzki
Quoted 2 lines · Samir Bellabes

Hi,
this fix missing lockhelp.h for u32

Any chances for inclusion in pom-ng?

done.

Signature · 5 lines
- Harald Welte <[email protected]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie