[PATCH] add sem_is_read/write_locked()

Add sem_is_read/write_locked functions to the read/write semaphores, along the
same lines of the *_is_locked spinlock functions.  The swap token tuning patch
uses sem_is_read_locked; sem_is_write_locked is added for completeness.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Rik Van Riel 2005-10-29 18:15:44 -07:00 committed by Linus Torvalds
parent 63f324cf07
commit eb92f4ef32
10 changed files with 50 additions and 0 deletions

View file

@ -61,5 +61,10 @@ extern void FASTCALL(__up_read(struct rw_semaphore *sem));
extern void FASTCALL(__up_write(struct rw_semaphore *sem));
extern void FASTCALL(__downgrade_write(struct rw_semaphore *sem));
static inline int rwsem_is_locked(struct rw_semaphore *sem)
{
return (sem->activity != 0);
}
#endif /* __KERNEL__ */
#endif /* _LINUX_RWSEM_SPINLOCK_H */