diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-04-29 15:31:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 15:36:54 -0400 |
commit | 7663c1e2792a9662b23dec6e19bfcd3d55360b8f (patch) | |
tree | ff5f91fa9ac3603f242b8ae985d9cca611e3d56b /include | |
parent | 6203554207728f43cfb9fd48585cd6500da73d42 (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blkdev.h | 4 |
1 files changed, 4 insertions, 0 deletions
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 | |||
412 | 412 | ||
413 | static inline int queue_is_locked(struct request_queue *q) | 413 | static inline int queue_is_locked(struct request_queue *q) |
414 | { | 414 | { |
415 | #ifdef CONFIG_SMP | ||
415 | spinlock_t *lock = q->queue_lock; | 416 | spinlock_t *lock = q->queue_lock; |
416 | return lock && spin_is_locked(lock); | 417 | return lock && spin_is_locked(lock); |
418 | #else | ||
419 | return 1; | ||
420 | #endif | ||
417 | } | 421 | } |
418 | 422 | ||
419 | static inline void queue_flag_set_unlocked(unsigned int flag, | 423 | static inline void queue_flag_set_unlocked(unsigned int flag, |