From: Jens Axboe Date: Tue, 29 Apr 2008 19:31:27 +0000 (+0200) Subject: Improve queue_is_locked() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7663c1e2792a9662b23dec6e19bfcd3d55360b8f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 95864b3ff298..d2a1b71e93c3 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,