]> www.infradead.org Git - users/willy/pagecache.git/commit
locking: Add rwsem_is_write_locked()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 6 Sep 2023 18:39:24 +0000 (14:39 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 6 Sep 2023 20:57:49 +0000 (16:57 -0400)
commitccbb5ee5afc575de9522639e682b65b400bdc14b
treede0cf789790aefea8594c7108224368422814f23
parent2dde18cd1d8fac735875f2e4987f11817cc0bc2c
locking: Add rwsem_is_write_locked()

Several places want to know whether the lock is held by a writer, instead
of just whether it's held.  We can implement this for both normal and
rt rwsems.  RWSEM_WRITER_LOCKED is declared in rwsem.c and exposing
it outside that file might tempt other people to use it, so just use
a comment to note that's what the 1 means, and help anybody find it if
they're looking to change the implementation.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
include/linux/rwbase_rt.h
include/linux/rwsem.h