Message ID | 20240110203215.36396-3-brgl@bgdev.pl |
---|---|
State | New |
Headers | show |
Series | cleanup: provide and use a locking guard for nested read semaphores | expand |
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 9c29689ff505..298f5e60d30c 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -258,4 +258,10 @@ extern void up_read_non_owner(struct rw_semaphore *sem); # define up_read_non_owner(sem) up_read(sem) #endif +DEFINE_LOCK_GUARD_ARGS(rwsem_read_nested, + struct rw_semaphore *, + down_read_nested(_T, subclass), + up_read(_T), + int subclass); + #endif /* _LINUX_RWSEM_H */