diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-07-03 03:24:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:27:02 -0400 |
commit | e4d919188554a77c798a267e098059bc9aa39726 (patch) | |
tree | bb5e47e09f5d107db44358ad668988f5ae768ade /include/linux/seqlock.h | |
parent | 9cebb5526833059f327d237a032422c762378b2a (diff) |
[PATCH] lockdep: locking init debugging improvement
Locking init improvement:
- introduce and use __SPIN_LOCK_UNLOCKED for array initializations,
to pass in the name string of locks, used by debugging
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/seqlock.h')
-rw-r--r-- | include/linux/seqlock.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 7bc5c7c12b54..46000936f8f1 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -38,9 +38,17 @@ typedef struct { | |||
38 | * These macros triggered gcc-3.x compile-time problems. We think these are | 38 | * These macros triggered gcc-3.x compile-time problems. We think these are |
39 | * OK now. Be cautious. | 39 | * OK now. Be cautious. |
40 | */ | 40 | */ |
41 | #define SEQLOCK_UNLOCKED { 0, SPIN_LOCK_UNLOCKED } | 41 | #define __SEQLOCK_UNLOCKED(lockname) \ |
42 | #define seqlock_init(x) do { *(x) = (seqlock_t) SEQLOCK_UNLOCKED; } while (0) | 42 | { 0, __SPIN_LOCK_UNLOCKED(lockname) } |
43 | 43 | ||
44 | #define SEQLOCK_UNLOCKED \ | ||
45 | __SEQLOCK_UNLOCKED(old_style_seqlock_init) | ||
46 | |||
47 | #define seqlock_init(x) \ | ||
48 | do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); } while (0) | ||
49 | |||
50 | #define DEFINE_SEQLOCK(x) \ | ||
51 | seqlock_t x = __SEQLOCK_UNLOCKED(x) | ||
44 | 52 | ||
45 | /* Lock out other writers and update the count. | 53 | /* Lock out other writers and update the count. |
46 | * Acts like a normal spin_lock/unlock. | 54 | * Acts like a normal spin_lock/unlock. |