diff options
Diffstat (limited to 'lib/atomic64.c')
-rw-r--r-- | lib/atomic64.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/atomic64.c b/lib/atomic64.c index 978537809d84..08a4f068e61e 100644 --- a/lib/atomic64.c +++ b/lib/atomic64.c | |||
@@ -31,7 +31,11 @@ | |||
31 | static union { | 31 | static union { |
32 | raw_spinlock_t lock; | 32 | raw_spinlock_t lock; |
33 | char pad[L1_CACHE_BYTES]; | 33 | char pad[L1_CACHE_BYTES]; |
34 | } atomic64_lock[NR_LOCKS] __cacheline_aligned_in_smp; | 34 | } atomic64_lock[NR_LOCKS] __cacheline_aligned_in_smp = { |
35 | [0 ... (NR_LOCKS - 1)] = { | ||
36 | .lock = __RAW_SPIN_LOCK_UNLOCKED(atomic64_lock.lock), | ||
37 | }, | ||
38 | }; | ||
35 | 39 | ||
36 | static inline raw_spinlock_t *lock_addr(const atomic64_t *v) | 40 | static inline raw_spinlock_t *lock_addr(const atomic64_t *v) |
37 | { | 41 | { |
@@ -173,14 +177,3 @@ int atomic64_add_unless(atomic64_t *v, long long a, long long u) | |||
173 | return ret; | 177 | return ret; |
174 | } | 178 | } |
175 | EXPORT_SYMBOL(atomic64_add_unless); | 179 | EXPORT_SYMBOL(atomic64_add_unless); |
176 | |||
177 | static int init_atomic64_lock(void) | ||
178 | { | ||
179 | int i; | ||
180 | |||
181 | for (i = 0; i < NR_LOCKS; ++i) | ||
182 | raw_spin_lock_init(&atomic64_lock[i].lock); | ||
183 | return 0; | ||
184 | } | ||
185 | |||
186 | pure_initcall(init_atomic64_lock); | ||