diff options
| author | Ingo Molnar <mingo@elte.hu> | 2006-07-10 07:44:02 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-10 16:24:14 -0400 |
| commit | 5fca80e8b4bf5d69b900115b14342133ce81d79e (patch) | |
| tree | 0dfa5b922438edf36ff9da2ff8a03e0d8f89c29f /include | |
| parent | f9829cceb686f3719215fe43c8593e5f3efe1710 (diff) | |
[PATCH] lockdep: add more rwsem.h documentation
Add more documentation to rwsem.h.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/rwsem.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 658afb37c3f5..7b524b4109a0 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h | |||
| @@ -61,12 +61,25 @@ extern void downgrade_write(struct rw_semaphore *sem); | |||
| 61 | 61 | ||
| 62 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 62 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 63 | /* | 63 | /* |
| 64 | * nested locking: | 64 | * nested locking. NOTE: rwsems are not allowed to recurse |
| 65 | * (which occurs if the same task tries to acquire the same | ||
| 66 | * lock instance multiple times), but multiple locks of the | ||
| 67 | * same lock class might be taken, if the order of the locks | ||
| 68 | * is always the same. This ordering rule can be expressed | ||
| 69 | * to lockdep via the _nested() APIs, but enumerating the | ||
| 70 | * subclasses that are used. (If the nesting relationship is | ||
| 71 | * static then another method for expressing nested locking is | ||
| 72 | * the explicit definition of lock class keys and the use of | ||
| 73 | * lockdep_set_class() at lock initialization time. | ||
| 74 | * See Documentation/lockdep-design.txt for more details.) | ||
| 65 | */ | 75 | */ |
| 66 | extern void down_read_nested(struct rw_semaphore *sem, int subclass); | 76 | extern void down_read_nested(struct rw_semaphore *sem, int subclass); |
| 67 | extern void down_write_nested(struct rw_semaphore *sem, int subclass); | 77 | extern void down_write_nested(struct rw_semaphore *sem, int subclass); |
| 68 | /* | 78 | /* |
| 69 | * Take/release a lock when not the owner will release it: | 79 | * Take/release a lock when not the owner will release it. |
| 80 | * | ||
| 81 | * [ This API should be avoided as much as possible - the | ||
| 82 | * proper abstraction for this case is completions. ] | ||
| 70 | */ | 83 | */ |
| 71 | extern void down_read_non_owner(struct rw_semaphore *sem); | 84 | extern void down_read_non_owner(struct rw_semaphore *sem); |
| 72 | extern void up_read_non_owner(struct rw_semaphore *sem); | 85 | extern void up_read_non_owner(struct rw_semaphore *sem); |
