summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@mandriva.com.br>2006-03-21 07:24:27 +0100
committerDavid S. Miller <davem@davemloft.net>2006-03-21 07:24:27 +0100
commit222fa076652cc1faf56eb7d554c2797ace3c5beb (patch)
treee2321a6c17693e82a3aefcb95f948d45e2b21e4f /net/core
parent[NET]: Convert RTNL to mutex. (diff)
downloadlinux-222fa076652cc1faf56eb7d554c2797ace3c5beb.tar.xz
linux-222fa076652cc1faf56eb7d554c2797ace3c5beb.zip
[PKTGEN]: Convert thread lock to mutexes.
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>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/pktgen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 04c6d8e23e50..29a969ef2bb2 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -113,6 +113,7 @@
#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>
@@ -180,8 +181,8 @@
#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 = {