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