/* downgrade a write lock into a read lock */
void __downgrade_write(struct rw_semaphore *sem)
/* downgrade a write lock into a read lock */
void __downgrade_write(struct rw_semaphore *sem)
{
	unsigned long flags;
	spin_lock_irqsave(&sem->wait_lock, flags);
	sem->activity = 1;
	if (!list_empty(&sem->wait_list))
		sem = __rwsem_do_wake(sem, 0);
	spin_unlock_irqrestore(&sem->wait_lock, flags);
}