Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7663c1e2 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds
Browse files

Improve queue_is_locked()



spin_is_locked() doesn't work on UP without spinlock debugging. Make it
safer and just return 1 on UP, so we don't get false positives. The plan
is to kill this debug function during the -rc cycle.

Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 62035542
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -412,8 +412,12 @@ struct request_queue

static inline int queue_is_locked(struct request_queue *q)
{
#ifdef CONFIG_SMP
	spinlock_t *lock = q->queue_lock;
	return lock && spin_is_locked(lock);
#else
	return 1;
#endif
}

static inline void queue_flag_set_unlocked(unsigned int flag,