SOURCES (LINUX_2_6): linux-2.6-pom-ng-branch.diff - finished lockh...

baggins baggins at pld-linux.org
Mon Sep 5 23:23:06 CEST 2005


Author: baggins                      Date: Mon Sep  5 21:23:05 2005 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
- finished lockhelp.h removal

---- Files affected:
SOURCES:
   linux-2.6-pom-ng-branch.diff (1.1.2.20 -> 1.1.2.21) 

---- Diffs:

================================================================
Index: SOURCES/linux-2.6-pom-ng-branch.diff
diff -u SOURCES/linux-2.6-pom-ng-branch.diff:1.1.2.20 SOURCES/linux-2.6-pom-ng-branch.diff:1.1.2.21
--- SOURCES/linux-2.6-pom-ng-branch.diff:1.1.2.20	Mon Sep  5 19:56:53 2005
+++ SOURCES/linux-2.6-pom-ng-branch.diff	Mon Sep  5 23:22:56 2005
@@ -665,7 +665,7 @@
 ===================================================================
 --- include/linux/netfilter/nf_conntrack_core.h	(.../branches/vanilla-2.6.12.x)	(revision 0)
 +++ include/linux/netfilter/nf_conntrack_core.h	(.../trunk)	(revision 6284)
-@@ -0,0 +1,72 @@
+@@ -0,0 +1,71 @@
 +/*
 + * This header is used to share core functionality between the
 + * standalone connection tracking module, and the compatibility layer's use
@@ -681,7 +681,6 @@
 +#define _NF_CONNTRACK_CORE_H
 +
 +#include <linux/netfilter.h>
-+#include <linux/netfilter_ipv4/lockhelp.h>
 +
 +/* This header is used to share core functionality between the
 +   standalone connection tracking module, and the compatibility layer's use
@@ -736,7 +735,7 @@
 +
 +extern struct list_head *nf_conntrack_hash;
 +extern struct list_head nf_conntrack_expect_list;
-+DECLARE_RWLOCK_EXTERN(nf_conntrack_lock);
++extern rwlock_t nf_conntrack_lock
 +#endif /* _NF_CONNTRACK_CORE_H */
 Index: include/linux/netfilter/ipv6/nf_conntrack_icmpv6.h
 ===================================================================
@@ -774,7 +773,7 @@
 ===================================================================
 --- include/linux/netfilter/nf_conntrack_ftp.h	(.../branches/vanilla-2.6.12.x)	(revision 0)
 +++ include/linux/netfilter/nf_conntrack_ftp.h	(.../trunk)	(revision 6284)
-@@ -0,0 +1,59 @@
+@@ -0,0 +1,57 @@
 +/*
 + * nf_conntrack_ftp.h
 + *
@@ -792,10 +791,8 @@
 +
 +#ifdef __KERNEL__
 +
-+#include <linux/netfilter_ipv4/lockhelp.h>
-+
 +/* Protects ftp part of conntracks */
-+DECLARE_LOCK_EXTERN(ip_ftp_lock);
++extern DEFINE_SPINLOCK(ip_ftp_lock);
 +
 +#define FTP_PORT	21
 +
@@ -3360,7 +3357,7 @@
 ===================================================================
 --- include/linux/netfilter_ipv4/ip_conntrack_pptp.h	(.../branches/vanilla-2.6.12.x)	(revision 0)
 +++ include/linux/netfilter_ipv4/ip_conntrack_pptp.h	(.../trunk)	(revision 6284)
-@@ -0,0 +1,336 @@
+@@ -0,0 +1,334 @@
 +/* PPTP constants and structs */
 +#ifndef _CONNTRACK_PPTP_H
 +#define _CONNTRACK_PPTP_H
@@ -3412,9 +3409,7 @@
 +
 +#ifdef __KERNEL__
 +
-+
-+#include <linux/netfilter_ipv4/lockhelp.h>
-+DECLARE_LOCK_EXTERN(ip_pptp_lock);
++extern DEFINE_SPINLOCK(ip_pptp_lock);
 +
 +#define IP_CONNTR_PPTP		PPTP_CONTROL_PORT
 +
@@ -6672,7 +6667,7 @@
 ===================================================================
 --- net/ipv4/netfilter/ipt_layer7.c	(.../branches/vanilla-2.6.12.x)	(revision 0)
 +++ net/ipv4/netfilter/ipt_layer7.c	(.../trunk)	(revision 6284)
-@@ -0,0 +1,552 @@
+@@ -0,0 +1,551 @@
 +/* 
 +  Kernel module to match application layer (OSI layer 7) 
 +  data in connections.
@@ -6698,7 +6693,6 @@
 +#include <linux/ctype.h>
 +#include <net/ip.h>
 +#include <net/tcp.h>
-+#include <linux/netfilter_ipv4/lockhelp.h>
 +
 +#include "regexp/regexp.c"
 +
@@ -6743,8 +6737,8 @@
 +  time.  In this case, we have to protect the conntracks and the list of 
 +  compiled patterns.
 +*/
-+DECLARE_RWLOCK(ct_lock);
-+DECLARE_LOCK(list_lock);
++DEFINE_RWLOCK(ct_lock);
++DEFINE_SPINLOCK(list_lock);
 +
 +#if CONFIG_IP_NF_MATCH_LAYER7_DEBUG
 +/* Converts an unfriendly string into a friendly one by 
@@ -6913,7 +6907,7 @@
 +			struct ipt_layer7_info * info)
 +{
 +	/* If we're in here, throw the app data away */
-+	WRITE_LOCK(&ct_lock);
++	write_lock_bh(&ct_lock);
 +	if(master_conntrack->layer7.app_data != NULL) {
 +
 +	#ifdef CONFIG_IP_NF_MATCH_LAYER7_DEBUG
@@ -6932,38 +6926,38 @@
 +		kfree(master_conntrack->layer7.app_data);
 +		master_conntrack->layer7.app_data = NULL; /* don't free again */
 +	}
-+	WRITE_UNLOCK(&ct_lock);
++	write_unlock_bh(&ct_lock);
 +
 +	if(master_conntrack->layer7.app_proto){
 +		/* Here child connections set their .app_proto (for /proc/net/ip_conntrack) */
-+		WRITE_LOCK(&ct_lock);
++		write_lock_bh(&ct_lock);
 +		if(!conntrack->layer7.app_proto) {
 +			conntrack->layer7.app_proto = kmalloc(strlen(master_conntrack->layer7.app_proto)+1, GFP_ATOMIC);
 +			if(!conntrack->layer7.app_proto){
 +				if (net_ratelimit()) 
 +					printk(KERN_ERR "layer7: out of memory in match_no_append, bailing.\n");
-+				WRITE_UNLOCK(&ct_lock);
++				write_unlock_bh(&ct_lock);
 +				return 1;
 +			}
 +			strcpy(conntrack->layer7.app_proto, master_conntrack->layer7.app_proto);
 +		}
-+		WRITE_UNLOCK(&ct_lock);
++		write_unlock_bh(&ct_lock);
 +	
 +		return (!strcmp(master_conntrack->layer7.app_proto, info->protocol));
 +	}
 +	else {
 +		/* If not classified, set to "unknown" to distinguish from 
 +		connections that are still being tested. */
-+		WRITE_LOCK(&ct_lock);
++		write_lock_bh(&ct_lock);
 +		master_conntrack->layer7.app_proto = kmalloc(strlen("unknown")+1, GFP_ATOMIC);
 +		if(!master_conntrack->layer7.app_proto){
 +			if (net_ratelimit()) 
 +				printk(KERN_ERR "layer7: out of memory in match_no_append, bailing.\n");
-+			WRITE_UNLOCK(&ct_lock);
++			write_unlock_bh(&ct_lock);
 +			return 1;
 +		}
 +		strcpy(master_conntrack->layer7.app_proto, "unknown");
-+		WRITE_UNLOCK(&ct_lock);
++		write_unlock_bh(&ct_lock);
 +		return 0;
 +	}
 +}
@@ -7052,25 +7046,25 @@
 +	app_data = skb->data + app_data_offset(skb);
 +	appdatalen = skb->tail - app_data;
 +
-+	LOCK_BH(&list_lock);
++	spin_lock_bh(&list_lock);
 +	/* the return value gets checked later, when we're ready to use it */
 +	comppattern = compile_and_cache(info->pattern, info->protocol);
-+	UNLOCK_BH(&list_lock);
++	spin_unlock_bh(&list_lock);
 +
 +	/* On the first packet of a connection, allocate space for app data */
-+	WRITE_LOCK(&ct_lock);
++	write_lock_bh(&ct_lock);
 +	if(TOTAL_PACKETS == 1 && !skb->cb[0] && !master_conntrack->layer7.app_data) {
 +		master_conntrack->layer7.app_data = kmalloc(CONFIG_IP_NF_MATCH_LAYER7_MAXDATALEN, GFP_ATOMIC);
 +		if(!master_conntrack->layer7.app_data){
 +			if (net_ratelimit())
 +				printk(KERN_ERR "layer7: out of memory in match, bailing.\n");
-+			WRITE_UNLOCK(&ct_lock);
++			write_unlock_bh(&ct_lock);
 +			return info->invert;
 +		}
 +
 +		master_conntrack->layer7.app_data[0] = '\0';
 +	}
-+	WRITE_UNLOCK(&ct_lock);
++	write_unlock_bh(&ct_lock);
 +
 +	/* Can be here, but unallocated, if numpackets is increased near 
 +	the beginning of a connection */
@@ -7079,9 +7073,9 @@
 +
 +	if(!skb->cb[0]){
 +		int newbytes;
-+		WRITE_LOCK(&ct_lock);
++		write_lock_bh(&ct_lock);
 +		newbytes = add_data(master_conntrack, app_data, appdatalen);
-+		WRITE_UNLOCK(&ct_lock);
++		write_unlock_bh(&ct_lock);
 +
 +		if(newbytes == 0) { /* didn't add any data */
 +			skb->cb[0] = 1;
@@ -7101,16 +7095,16 @@
 +	} else pattern_result = 0;
 +
 +	if(pattern_result) {
-+		WRITE_LOCK(&ct_lock);
++		write_lock_bh(&ct_lock);
 +		master_conntrack->layer7.app_proto = kmalloc(strlen(info->protocol)+1, GFP_ATOMIC);
 +		if(!master_conntrack->layer7.app_proto){
 +			if (net_ratelimit()) 
 +				printk(KERN_ERR "layer7: out of memory in match, bailing.\n");
-+			WRITE_UNLOCK(&ct_lock);
++			write_unlock_bh(&ct_lock);
 +			return (pattern_result ^ info->invert);
 +		}
 +		strcpy(master_conntrack->layer7.app_proto, info->protocol);
-+		WRITE_UNLOCK(&ct_lock);
++		write_unlock_bh(&ct_lock);
 +	}
 +
 +	/* mark the packet seen */
@@ -13262,7 +13256,7 @@
 +MODULE_PARM_DESC(ports, "port numbers of Quake III master servers");
 +
 +static char quake3_buffer[65536];
-+static DECLARE_LOCK(quake3_buffer_lock);
++static DEFINE_SPINLOCK(quake3_buffer_lock);
 +
 +unsigned int (*ip_nat_quake3_hook)(struct ip_conntrack_expect *exp);
 +EXPORT_SYMBOL_GPL(ip_nat_quake3_hook);
@@ -13312,7 +13306,7 @@
 +	if (dataoff >= (*pskb)->len)
 +		return NF_ACCEPT;
 +
-+	LOCK_BH(&quake3_buffer_lock);
++	spin_lock_bh(&quake3_buffer_lock);
 +	qb_ptr = skb_header_pointer(*pskb, dataoff,
 +				    (*pskb)->len - dataoff, quake3_buffer);
 +	BUG_ON(qb_ptr == NULL);
@@ -18908,7 +18902,7 @@
 ===================================================================
 --- net/ipv4/netfilter/ip_conntrack_pptp.c	(.../branches/vanilla-2.6.12.x)	(revision 0)
 +++ net/ipv4/netfilter/ip_conntrack_pptp.c	(.../trunk)	(revision 6284)
-@@ -0,0 +1,790 @@
+@@ -0,0 +1,789 @@
 +/*
 + * ip_conntrack_pptp.c	- Version 3.0
 + *
@@ -18962,7 +18956,6 @@
 +#include <net/checksum.h>
 +#include <net/tcp.h>
 +
-+#include <linux/netfilter_ipv4/lockhelp.h>
 +#include <linux/netfilter_ipv4/ip_conntrack.h>
 +#include <linux/netfilter_ipv4/ip_conntrack_core.h>
 +#include <linux/netfilter_ipv4/ip_conntrack_helper.h>
@@ -18975,7 +18968,7 @@
 +MODULE_AUTHOR("Harald Welte <laforge at gnumonks.org>");
 +MODULE_DESCRIPTION("Netfilter connection tracking helper module for PPTP");
 +
-+DECLARE_LOCK(ip_pptp_lock);
++DEFINE_SPINLOCK(ip_pptp_lock);
 +
 +int
 +(*ip_nat_pptp_hook_outbound)(struct sk_buff **pskb,
@@ -19622,7 +19615,7 @@
 +	oldsstate = info->sstate;
 +	oldcstate = info->cstate;
 +
-+	LOCK_BH(&ip_pptp_lock);
++	spin_lock_bh(&ip_pptp_lock);
 +
 +	nexthdr_off += sizeof(_pptph);
 +	/* FIXME: We just blindly assume that the control connection is always
@@ -19637,7 +19630,7 @@
 +				       ctinfo);
 +	DEBUGP("sstate: %d->%d, cstate: %d->%d\n",
 +		oldsstate, info->sstate, oldcstate, info->cstate);
-+	UNLOCK_BH(&ip_pptp_lock);
++	spin_unlock_bh(&ip_pptp_lock);
 +
 +	return ret;
 +}
@@ -20429,7 +20422,7 @@
 ===================================================================
 --- net/ipv4/netfilter/ipt_u32.c	(.../branches/vanilla-2.6.12.x)	(revision 0)
 +++ net/ipv4/netfilter/ipt_u32.c	(.../trunk)	(revision 6284)
-@@ -0,0 +1,233 @@
+@@ -0,0 +1,232 @@
 +/* Kernel module to match u32 packet content. */
 +
 +/* 
@@ -20537,7 +20530,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 */
 +
@@ -20547,7 +20539,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,
@@ -20568,7 +20560,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);
@@ -20580,7 +20572,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) +
@@ -20622,13 +20614,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;
 +}
 +
@@ -21968,7 +21960,7 @@
 ===================================================================
 --- net/ipv4/netfilter/ipt_ACCOUNT.c	(.../branches/vanilla-2.6.12.x)	(revision 0)
 +++ net/ipv4/netfilter/ipt_ACCOUNT.c	(.../trunk)	(revision 6284)
-@@ -0,0 +1,1103 @@
+@@ -0,0 +1,1102 @@
 +/***************************************************************************
 + *   This is a module which is used for counting packets.                  *
 + *   See http://www.intra2net.com/opensource/ipt_account                   *
@@ -21990,7 +21982,6 @@
 +#include <net/udp.h>
 +#include <net/tcp.h>
 +#include <linux/netfilter_ipv4/ip_tables.h>
-+#include <linux/netfilter_ipv4/lockhelp.h>
 +#include <asm/semaphore.h>
 +#include <linux/kernel.h>
 +#include <linux/mm.h>
@@ -22015,7 +22006,7 @@
 +static void *ipt_acc_tmpbuf = NULL;
 +
 +/* Spinlock used for manipulating the current accounting tables/data */
-+DECLARE_LOCK(ipt_acc_lock);
++DEFINE_SPINLOCK(ipt_acc_lock);
 +/* Mutex (semaphore) used for manipulating userspace handles/snapshot data */
 +static struct semaphore ipt_acc_userspace_mutex;
 +
@@ -22172,10 +22163,10 @@
 +        return 0;
 +    }
 +
-+    LOCK_BH(&ipt_acc_lock);
++    spin_lock_bh(&ipt_acc_lock);
 +    table_nr = ipt_acc_table_insert(info->table_name, info->net_ip,
 +                                                      info->net_mask);
-+    UNLOCK_BH(&ipt_acc_lock);
++    spin_unlock_bh(&ipt_acc_lock);
 +    
 +    if (table_nr == -1) {
 +        printk("ACCOUNT: Table insert problem. Aborting\n");
@@ -22198,7 +22189,7 @@
 +               targinfosize, IPT_ALIGN(sizeof(struct ipt_acc_info)));
 +    }
 +
-+    LOCK_BH(&ipt_acc_lock);
++    spin_lock_bh(&ipt_acc_lock);
 +
 +    DEBUGP("ACCOUNT: ipt_acc_deleteentry called for table: %s (#%d)\n", 
 +           info->table_name, info->table_nr);
@@ -22224,14 +22215,14 @@
 +                       sizeof(struct ipt_acc_table));
 +            }
 +
-+            UNLOCK_BH(&ipt_acc_lock);
++            spin_unlock_bh(&ipt_acc_lock);
 +            return;
 +        }
 +    }
 +
 +    /* Table not found */
 +    printk("ACCOUNT: Table %s not found for destroy\n", info->table_name);
-+    UNLOCK_BH(&ipt_acc_lock);
++    spin_unlock_bh(&ipt_acc_lock);
 +}
 +
 +static void ipt_acc_depth0_insert(struct ipt_acc_mask_24 *mask_24,
@@ -22397,13 +22388,13 @@
 +    u_int32_t dst_ip = (*pskb)->nh.iph->daddr;
 +    u_int32_t size = ntohs((*pskb)->nh.iph->tot_len);
 +
-+    LOCK_BH(&ipt_acc_lock);
++    spin_lock_bh(&ipt_acc_lock);
 +
 +    if (ipt_acc_tables[info->table_nr].name[0] == 0) {
 +        printk("ACCOUNT: ipt_acc_target: Invalid table id %u. "
 +               "IPs %u.%u.%u.%u/%u.%u.%u.%u\n", info->table_nr, 
 +               NIPQUAD(src_ip), NIPQUAD(dst_ip));
-+        UNLOCK_BH(&ipt_acc_lock);
++        spin_unlock_bh(&ipt_acc_lock);
 +        return IPT_CONTINUE;
 +    }
 +
@@ -22415,7 +22406,7 @@
 +            ipt_acc_tables[info->table_nr].ip, 
 +            ipt_acc_tables[info->table_nr].netmask,
 +            src_ip, dst_ip, size, &ipt_acc_tables[info->table_nr].itemcount);
-+        UNLOCK_BH(&ipt_acc_lock);
++        spin_unlock_bh(&ipt_acc_lock);
 +        return IPT_CONTINUE;
 +    }
 +
@@ -22426,7 +22417,7 @@
 +            ipt_acc_tables[info->table_nr].ip, 
 +            ipt_acc_tables[info->table_nr].netmask,
 +            src_ip, dst_ip, size, &ipt_acc_tables[info->table_nr].itemcount);
-+        UNLOCK_BH(&ipt_acc_lock);
++        spin_unlock_bh(&ipt_acc_lock);
 +        return IPT_CONTINUE;
 +    }
 +
@@ -22437,7 +22428,7 @@
 +            ipt_acc_tables[info->table_nr].ip, 
 +            ipt_acc_tables[info->table_nr].netmask,
 +            src_ip, dst_ip, size, &ipt_acc_tables[info->table_nr].itemcount);
-+        UNLOCK_BH(&ipt_acc_lock);
++        spin_unlock_bh(&ipt_acc_lock);
 +        return IPT_CONTINUE;
 +    }
 +
@@ -22445,7 +22436,7 @@
 +           "Table id %u. IPs %u.%u.%u.%u/%u.%u.%u.%u\n", 
 +           info->table_nr, NIPQUAD(src_ip), NIPQUAD(dst_ip));
 +
-+    UNLOCK_BH(&ipt_acc_lock);
++    spin_unlock_bh(&ipt_acc_lock);
 +    return IPT_CONTINUE;
 +}
 +
@@ -22846,14 +22837,14 @@
 +                break;
 +            }
 +    
-+            LOCK_BH(&ipt_acc_lock);
++            spin_lock_bh(&ipt_acc_lock);
 +            if (cmd == IPT_SO_GET_ACCOUNT_PREPARE_READ_FLUSH)
 +                ret = ipt_acc_handle_prepare_read_flush(
 +                                    handle.name, &dest, &handle.itemcount);
 +            else
 +                ret = ipt_acc_handle_prepare_read(
 +                                    handle.name, &dest, &handle.itemcount);
-+            UNLOCK_BH(&ipt_acc_lock);
++            spin_unlock_bh(&ipt_acc_lock);
 +            // Error occured during prepare_read?
 +           if (ret == -1)
 +                return -EINVAL;
@@ -22946,7 +22937,7 @@
 +            u_int32_t size = 0, i, name_len;
 +            char *tnames;
 +
-+            LOCK_BH(&ipt_acc_lock);
++            spin_lock_bh(&ipt_acc_lock);
 +
 +            /* Determine size of table names */
 +            for (i = 0; i < ACCOUNT_MAX_TABLES; i++) {
@@ -22956,7 +22947,7 @@
 +            size += 1;    /* Terminating NULL character */
 +
 +            if (*len < size || size > PAGE_SIZE) {
-+                UNLOCK_BH(&ipt_acc_lock);
++                spin_unlock_bh(&ipt_acc_lock);
 +                printk("ACCOUNT: ipt_acc_get_ctl: not enough space (%u < %u < %lu)"
 +                       " to store table names\n", *len, size, PAGE_SIZE);
 +                ret = -ENOMEM;
@@ -22971,7 +22962,7 @@
 +                    tnames += name_len;
 +                }
 +            }
-+            UNLOCK_BH(&ipt_acc_lock);
++            spin_unlock_bh(&ipt_acc_lock);
 +            
 +            /* Terminating NULL character */
 +            *tnames = 0;
@@ -23817,7 +23808,7 @@
 +
 +static struct list_head set_type_list;		/* all registered sets */
 +static struct ip_set **ip_set_list;		/* all individual sets */
-+static DECLARE_RWLOCK(ip_set_lock);		/* protects the lists and the hash */
++static DEFINE_RWLOCK(ip_set_lock);		/* protects the lists and the hash */
 +static DECLARE_MUTEX(ip_set_app_mutex);		/* serializes user access */
 +static ip_set_id_t ip_set_max = CONFIG_IP_NF_SET_MAX;
 +static ip_set_id_t ip_set_bindings_hash_size =  CONFIG_IP_NF_SET_HASHSIZE;
@@ -23868,7 +23859,7 @@
 +				% ip_set_bindings_hash_size;
 +	struct ip_set_hash *set_hash;
 +
-+	MUST_BE_READ_LOCKED(&ip_set_lock);
++	ASSERT_READ_LOCK(&ip_set_lock);
 +	IP_SET_ASSERT(ip_set_list[id]);
 +	DP("set: %s, ip: %u.%u.%u.%u", ip_set_list[id]->name, HIPQUAD(ip));	
 +	
@@ -23885,7 +23876,7 @@
 +static inline void 
 +__set_hash_del(struct ip_set_hash *set_hash)
 +{
-+	MUST_BE_WRITE_LOCKED(&ip_set_lock);
++	ASSERT_WRITE_LOCK(&ip_set_lock);
 +	IP_SET_ASSERT(ip_set_list[set_hash->binding]);	
 +
 +	__ip_set_put(set_hash->binding);
@@ -23902,7 +23893,7 @@
 +	
 +	IP_SET_ASSERT(ip_set_list[id]);
 +	DP("set: %s, ip: %u.%u.%u.%u", ip_set_list[id]->name, HIPQUAD(ip));	
-+	WRITE_LOCK(&ip_set_lock);
++	write_lock_bh(&ip_set_lock);
 +	set_hash = LIST_FIND(&ip_set_hash[key], ip_hash_cmp,
 +			     struct ip_set_hash *, id, ip);
 +	DP("set: %s, ip: %u.%u.%u.%u, binding: %s", ip_set_list[id]->name,
@@ -23911,7 +23902,7 @@
 +
 +	if (set_hash != NULL)
 +		__set_hash_del(set_hash);
-+	WRITE_UNLOCK(&ip_set_lock);
++	write_unlock_bh(&ip_set_lock);
 +	return 0;
 +}
 +
@@ -23927,7 +23918,7 @@
 +	IP_SET_ASSERT(ip_set_list[binding]);
 +	DP("set: %s, ip: %u.%u.%u.%u, binding: %s", ip_set_list[id]->name, 
 +	   HIPQUAD(ip), ip_set_list[binding]->name);
-+	WRITE_LOCK(&ip_set_lock);
++	write_lock_bh(&ip_set_lock);
 +	set_hash = LIST_FIND(&ip_set_hash[key], ip_hash_cmp,
 +			     struct ip_set_hash *, id, ip);
 +	if (!set_hash) {
@@ -23949,7 +23940,7 @@
 +	set_hash->binding = binding;
 +	__ip_set_get(set_hash->binding);
 +    unlock:
-+	WRITE_UNLOCK(&ip_set_lock);
++	write_unlock_bh(&ip_set_lock);
 +	return ret;
 +}
 +
@@ -23969,7 +23960,7 @@
 +	ip_set_id_t __key;							\
 +	struct ip_set_hash *__set_hash, *__n;					\
 +										\
-+	MUST_BE_WRITE_LOCKED(&ip_set_lock);					\
++	ASSERT_WRITE_LOCK(&ip_set_lock);					\
 +	for (__key = 0; __key < ip_set_bindings_hash_size; __key++) {		\
 +		list_for_each_entry_safe(__set_hash, __n, &ip_set_hash[__key], list)\
 +			fn(__set_hash , ## args);				\
@@ -23992,7 +23983,7 @@
 +	int res, i = 0;
 +	
 +	IP_SET_ASSERT(flags[i]);
-+	READ_LOCK(&ip_set_lock);
++	read_lock_bh(&ip_set_lock);
 +	do {
 +		set = ip_set_list[index];
 +		IP_SET_ASSERT(set);
@@ -24003,7 +23994,7 @@
 +	} while (res > 0 
 +		 && flags[++i] 
 +		 && follow_bindings(index, set, ip));
-+	READ_UNLOCK(&ip_set_lock);
++	read_unlock_bh(&ip_set_lock);
 +
 +	return res;
 +}
@@ -24019,7 +24010,7 @@
 +
 +	IP_SET_ASSERT(flags[i]);
 +   retry:
-+	READ_LOCK(&ip_set_lock);
++	read_lock_bh(&ip_set_lock);
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/linux-2.6-pom-ng-branch.diff?r1=1.1.2.20&r2=1.1.2.21&f=u




More information about the pld-cvs-commit mailing list