Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jens Axboe and committed by
Linus Torvalds
7663c1e2 62035542

+4
+4
include/linux/blkdev.h
··· 412 412 413 413 static inline int queue_is_locked(struct request_queue *q) 414 414 { 415 + #ifdef CONFIG_SMP 415 416 spinlock_t *lock = q->queue_lock; 416 417 return lock && spin_is_locked(lock); 418 + #else 419 + return 1; 420 + #endif 417 421 } 418 422 419 423 static inline void queue_flag_set_unlocked(unsigned int flag,