From 7663c1e2792a9662b23dec6e19bfcd3d55360b8f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 29 Apr 2008 21:31:27 +0200 Subject: [PATCH] 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 Signed-off-by: Linus Torvalds --- include/linux/blkdev.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 95864b3ff29..d2a1b71e93c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -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, -- 2.41.0