diff options
author | Luiz Capitulino <lcapitulino@mandriva.com.br> | 2006-03-21 01:24:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 01:24:27 -0500 |
commit | 222fa076652cc1faf56eb7d554c2797ace3c5beb (patch) | |
tree | e2321a6c17693e82a3aefcb95f948d45e2b21e4f | |
parent | 6756ae4b4e97aba48c042b4aa6b77a18f507d2cb (diff) |
[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>
-rw-r--r-- | net/core/pktgen.c | 7 |
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 @@ | |||
113 | #include <linux/moduleparam.h> | 113 | #include <linux/moduleparam.h> |
114 | #include <linux/kernel.h> | 114 | #include <linux/kernel.h> |
115 | #include <linux/smp_lock.h> | 115 | #include <linux/smp_lock.h> |
116 | #include <linux/mutex.h> | ||
116 | #include <linux/sched.h> | 117 | #include <linux/sched.h> |
117 | #include <linux/slab.h> | 118 | #include <linux/slab.h> |
118 | #include <linux/vmalloc.h> | 119 | #include <linux/vmalloc.h> |
@@ -180,8 +181,8 @@ | |||
180 | #define T_REMDEV (1<<4) /* Remove one dev */ | 181 | #define T_REMDEV (1<<4) /* Remove one dev */ |
181 | 182 | ||
182 | /* Locks */ | 183 | /* Locks */ |
183 | #define thread_lock() down(&pktgen_sem) | 184 | #define thread_lock() mutex_lock(&pktgen_thread_lock) |
184 | #define thread_unlock() up(&pktgen_sem) | 185 | #define thread_unlock() mutex_unlock(&pktgen_thread_lock) |
185 | 186 | ||
186 | /* If lock -- can be removed after some work */ | 187 | /* If lock -- can be removed after some work */ |
187 | #define if_lock(t) spin_lock(&(t->if_lock)); | 188 | #define if_lock(t) spin_lock(&(t->if_lock)); |
@@ -493,7 +494,7 @@ static int pg_delay_d; | |||
493 | static int pg_clone_skb_d; | 494 | static int pg_clone_skb_d; |
494 | static int debug; | 495 | static int debug; |
495 | 496 | ||
496 | static DECLARE_MUTEX(pktgen_sem); | 497 | static DEFINE_MUTEX(pktgen_thread_lock); |
497 | static LIST_HEAD(pktgen_threads); | 498 | static LIST_HEAD(pktgen_threads); |
498 | 499 | ||
499 | static struct notifier_block pktgen_notifier_block = { | 500 | static struct notifier_block pktgen_notifier_block = { |