aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rwsem.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/rwsem.h')
-rw-r--r--include/linux/rwsem.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 8970c3e802e2..8b9c7e9f6910 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -34,6 +34,13 @@ struct rw_semaphore {
34 34
35/* Include the arch specific part */ 35/* Include the arch specific part */
36#include <asm/rwsem.h> 36#include <asm/rwsem.h>
37
38/* In all implementations count != 0 means locked */
39static inline int rwsem_is_locked(struct rw_semaphore *sem)
40{
41 return sem->count != 0;
42}
43
37#endif 44#endif
38 45
39/* Common initializer macros and functions */ 46/* Common initializer macros and functions */