]> err.no Git - linux-2.6/commitdiff
[PKTGEN]: Convert thread lock to mutexes.
authorLuiz Capitulino <lcapitulino@mandriva.com.br>
Tue, 21 Mar 2006 06:24:27 +0000 (22:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2006 06:24:27 +0000 (22:24 -0800)
pktgen's thread semaphores are strict mutexes, convert them to the
mutex implementation.

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/pktgen.c

index 04c6d8e23e5008e38af54c6263a6a03642f84dd6..29a969ef2bb29892ad6ec07df2661b7d6ba70481 100644 (file)
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/smp_lock.h>
+#include <linux/mutex.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #define T_REMDEV      (1<<4)   /* Remove one dev */
 
 /* Locks */
-#define   thread_lock()        down(&pktgen_sem)
-#define   thread_unlock()      up(&pktgen_sem)
+#define   thread_lock()        mutex_lock(&pktgen_thread_lock)
+#define   thread_unlock()      mutex_unlock(&pktgen_thread_lock)
 
 /* If lock -- can be removed after some work */
 #define   if_lock(t)           spin_lock(&(t->if_lock));
@@ -493,7 +494,7 @@ static int pg_delay_d;
 static int pg_clone_skb_d;
 static int debug;
 
-static DECLARE_MUTEX(pktgen_sem);
+static DEFINE_MUTEX(pktgen_thread_lock);
 static LIST_HEAD(pktgen_threads);
 
 static struct notifier_block pktgen_notifier_block = {