From: Jens Axboe Date: Tue, 29 Apr 2008 19:31:27 +0000 (+0200) Subject: Improve queue_is_locked() X-Git-Tag: v3.12-rc1~21234 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7663c1e2792a9662b23dec6e19bfcd3d55360b8f;p=kernel%2Fkernel-generic.git 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 --- diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 95864b3..d2a1b71 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,