X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=include%2Flinux%2Frwsem.h;h=efd348fe8ca75f6d9effcf8f05e87bd276e46d97;hb=a14d0404088a7b0d51bb5219baf33d77e5592007;hp=658afb37c3f51456766ffb10e02a336462189ec2;hpb=4ea2176dfa714882e88180b474e4cbcd888b70af;p=mv-sheeva.git diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 658afb37c3f..efd348fe8ca 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -9,8 +9,6 @@ #include -#ifdef __KERNEL__ - #include #include #include @@ -61,12 +59,25 @@ extern void downgrade_write(struct rw_semaphore *sem); #ifdef CONFIG_DEBUG_LOCK_ALLOC /* - * nested locking: + * nested locking. NOTE: rwsems are not allowed to recurse + * (which occurs if the same task tries to acquire the same + * lock instance multiple times), but multiple locks of the + * same lock class might be taken, if the order of the locks + * is always the same. This ordering rule can be expressed + * to lockdep via the _nested() APIs, but enumerating the + * subclasses that are used. (If the nesting relationship is + * static then another method for expressing nested locking is + * the explicit definition of lock class keys and the use of + * lockdep_set_class() at lock initialization time. + * See Documentation/lockdep-design.txt for more details.) */ extern void down_read_nested(struct rw_semaphore *sem, int subclass); extern void down_write_nested(struct rw_semaphore *sem, int subclass); /* - * Take/release a lock when not the owner will release it: + * Take/release a lock when not the owner will release it. + * + * [ This API should be avoided as much as possible - the + * proper abstraction for this case is completions. ] */ extern void down_read_non_owner(struct rw_semaphore *sem); extern void up_read_non_owner(struct rw_semaphore *sem); @@ -77,5 +88,4 @@ extern void up_read_non_owner(struct rw_semaphore *sem); # define up_read_non_owner(sem) up_read(sem) #endif -#endif /* __KERNEL__ */ #endif /* _LINUX_RWSEM_H */