diff options
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); |
