From: Jens Axboe Date: Tue, 29 Apr 2008 19:31:27 +0000 (+0200) Subject: Improve queue_is_locked() X-Git-Tag: v2.6.26-rc1~359 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7663c1e2792a9662b23dec6e19bfcd3d55360b8f;p=linux-2.6 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 95864b3ff2..d2a1b71e93 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,