Skip to content

Commit 7663c1e

Browse files
Jens Axboetorvalds
authored andcommitted
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>
1 parent 6203554 commit 7663c1e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎include/linux/blkdev.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,12 @@ struct request_queue
412412

413413
static inline int queue_is_locked(struct request_queue *q)
414414
{
415+
#ifdef CONFIG_SMP
415416
spinlock_t *lock = q->queue_lock;
416417
return lock && spin_is_locked(lock);
418+
#else
419+
return 1;
420+
#endif
417421
}
418422

419423
static inline void queue_flag_set_unlocked(unsigned int flag,

0 commit comments

Comments
 (0)