SOURCES (LINUX_2_6): linux-2.6-nf-ACCOUNT.patch - removed lockhelp...
baggins
baggins at pld-linux.org
Tue Sep 27 13:06:55 CEST 2005
Author: baggins Date: Tue Sep 27 11:06:55 2005 GMT
Module: SOURCES Tag: LINUX_2_6
---- Log message:
- removed lockhelp.h and users
---- Files affected:
SOURCES:
linux-2.6-nf-ACCOUNT.patch (1.1.2.3 -> 1.1.2.4)
---- Diffs:
================================================================
Index: SOURCES/linux-2.6-nf-ACCOUNT.patch
diff -u SOURCES/linux-2.6-nf-ACCOUNT.patch:1.1.2.3 SOURCES/linux-2.6-nf-ACCOUNT.patch:1.1.2.4
--- SOURCES/linux-2.6-nf-ACCOUNT.patch:1.1.2.3 Tue Sep 27 02:50:10 2005
+++ SOURCES/linux-2.6-nf-ACCOUNT.patch Tue Sep 27 13:06:50 2005
@@ -170,7 +170,7 @@
diff -Nur --exclude '*.orig' linux-2.6.13.1.org/net/ipv4/netfilter/ipt_ACCOUNT.c linux-2.6.13.1/net/ipv4/netfilter/ipt_ACCOUNT.c
--- linux-2.6.13.1.org/net/ipv4/netfilter/ipt_ACCOUNT.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.13.1/net/ipv4/netfilter/ipt_ACCOUNT.c 2005-09-16 16:04:05.000000000 +0200
-@@ -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 *
@@ -192,7 +192,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>
@@ -217,7 +216,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;
+
@@ -374,10 +373,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");
@@ -400,7 +399,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);
@@ -426,14 +425,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,
@@ -599,13 +598,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;
+ }
+
@@ -617,7 +616,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;
+ }
+
@@ -628,7 +627,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;
+ }
+
@@ -639,7 +638,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;
+ }
+
@@ -647,7 +646,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;
+}
+
@@ -1048,14 +1047,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;
@@ -1148,7 +1147,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++) {
@@ -1158,7 +1157,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;
@@ -1173,7 +1172,7 @@
+ tnames += name_len;
+ }
+ }
-+ UNLOCK_BH(&ipt_acc_lock);
++ spin_unlock_bh(&ipt_acc_lock);
+
+ /* Terminating NULL character */
+ *tnames = 0;
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/linux-2.6-nf-ACCOUNT.patch?r1=1.1.2.3&r2=1.1.2.4&f=u
More information about the pld-cvs-commit
mailing list