diff options
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. |