lkml.org 
[lkml]   [2021]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch] locking, rwsem: Add missing __init_rwsem() for PREEMPT_RT
From
Date

730633f0b7f95 became the first direct caller of __init_rwsem() vs the
usual init_rwsem(), exposing PREEMPT_RT's lack thereof. Add it.

Signed-off-by: Mike Galbraith <efault@gmx.de>
---
include/linux/rwsem.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -152,12 +152,18 @@ static inline void __rwsem_init(struct
}
#endif

+static inline void __init_rwsem(struct rw_semaphore *sem, const char *name,
+ struct lock_class_key *key)
+{
+ init_rwbase_rt(&(sem)->rwbase);
+ __rwsem_init(sem, name, key);
+}
+
#define init_rwsem(sem) \
do { \
static struct lock_class_key __key; \
\
- init_rwbase_rt(&(sem)->rwbase); \
- __rwsem_init((sem), #sem, &__key); \
+ __init_rwsem((sem), #sem, &__key); \
} while (0)

static __always_inline int rwsem_is_locked(struct rw_semaphore *sem)
\
 
 \ /
  Last update: 2021-08-31 08:38    [W:0.525 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site