diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-05 08:27:42 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-05 08:27:42 -0400 |
commit | cf57a308436653f3094590202c77459aab250ff3 (patch) | |
tree | 8a9e7096e494141911147a1f24865c3d79d583c1 /include/linux/rwsem-spinlock.h | |
parent | faac9bd0e3ce7cb0572ec66e0a426cacf6afa970 (diff) | |
parent | ca78f6baca863afe2e6a244a0fe94b3a70211d46 (diff) |
Merge branch 'master'
Diffstat (limited to 'include/linux/rwsem-spinlock.h')
-rw-r--r-- | include/linux/rwsem-spinlock.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h index f30f805080ae..ae1fcadd598e 100644 --- a/include/linux/rwsem-spinlock.h +++ b/include/linux/rwsem-spinlock.h | |||
@@ -32,30 +32,37 @@ struct rw_semaphore { | |||
32 | __s32 activity; | 32 | __s32 activity; |
33 | spinlock_t wait_lock; | 33 | spinlock_t wait_lock; |
34 | struct list_head wait_list; | 34 | struct list_head wait_list; |
35 | #if RWSEM_DEBUG | 35 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
36 | int debug; | 36 | struct lockdep_map dep_map; |
37 | #endif | 37 | #endif |
38 | }; | 38 | }; |
39 | 39 | ||
40 | /* | 40 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
41 | * initialisation | 41 | # define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname } |
42 | */ | ||
43 | #if RWSEM_DEBUG | ||
44 | #define __RWSEM_DEBUG_INIT , 0 | ||
45 | #else | 42 | #else |
46 | #define __RWSEM_DEBUG_INIT /* */ | 43 | # define __RWSEM_DEP_MAP_INIT(lockname) |
47 | #endif | 44 | #endif |
48 | 45 | ||
49 | #define __RWSEM_INITIALIZER(name) \ | 46 | #define __RWSEM_INITIALIZER(name) \ |
50 | { 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __RWSEM_DEBUG_INIT } | 47 | { 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } |
51 | 48 | ||
52 | #define DECLARE_RWSEM(name) \ | 49 | #define DECLARE_RWSEM(name) \ |
53 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 50 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
54 | 51 | ||
55 | extern void FASTCALL(init_rwsem(struct rw_semaphore *sem)); | 52 | extern void __init_rwsem(struct rw_semaphore *sem, const char *name, |
53 | struct lock_class_key *key); | ||
54 | |||
55 | #define init_rwsem(sem) \ | ||
56 | do { \ | ||
57 | static struct lock_class_key __key; \ | ||
58 | \ | ||
59 | __init_rwsem((sem), #sem, &__key); \ | ||
60 | } while (0) | ||
61 | |||
56 | extern void FASTCALL(__down_read(struct rw_semaphore *sem)); | 62 | extern void FASTCALL(__down_read(struct rw_semaphore *sem)); |
57 | extern int FASTCALL(__down_read_trylock(struct rw_semaphore *sem)); | 63 | extern int FASTCALL(__down_read_trylock(struct rw_semaphore *sem)); |
58 | extern void FASTCALL(__down_write(struct rw_semaphore *sem)); | 64 | extern void FASTCALL(__down_write(struct rw_semaphore *sem)); |
65 | extern void FASTCALL(__down_write_nested(struct rw_semaphore *sem, int subclass)); | ||
59 | extern int FASTCALL(__down_write_trylock(struct rw_semaphore *sem)); | 66 | extern int FASTCALL(__down_write_trylock(struct rw_semaphore *sem)); |
60 | extern void FASTCALL(__up_read(struct rw_semaphore *sem)); | 67 | extern void FASTCALL(__up_read(struct rw_semaphore *sem)); |
61 | extern void FASTCALL(__up_write(struct rw_semaphore *sem)); | 68 | extern void FASTCALL(__up_write(struct rw_semaphore *sem)); |