* [PATCH] pktgen: Convert thread lock to mutexes.
@ 2006-03-01 13:52 Luiz Fernando Capitulino
0 siblings, 0 replies; only message in thread
From: Luiz Fernando Capitulino @ 2006-03-01 13:52 UTC (permalink / raw)
To: davem; +Cc: lkml, netdev, robert.olsson
Hi!
pktgen's thread semaphores are strict mutexes, convert them to the mutex
implementation.
Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
---
net/core/pktgen.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
1185abd5dacbca3052ccd93e059c497bbc8869b2
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 2221b86..2618a7b 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>
@@ -153,7 +154,7 @@
#include <asm/div64.h> /* do_div */
#include <asm/timex.h>
-#define VERSION "pktgen v2.65: Packet Generator for packet performance testing.\n"
+#define VERSION "pktgen v2.66: Packet Generator for packet performance testing.\n"
/* #define PG_DEBUG(a) a */
#define PG_DEBUG(a)
@@ -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_mutex)
+#define thread_unlock() mutex_unlock(&pktgen_mutex)
/* 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_mutex);
static LIST_HEAD(pktgen_threads);
static struct notifier_block pktgen_notifier_block = {
--
1.2.3.g8fcf1
--
Luiz Fernando N. Capitulino
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-03-01 13:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-01 13:52 [PATCH] pktgen: Convert thread lock to mutexes Luiz Fernando Capitulino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).