Skip to content

Commit

Permalink
Improve queue_is_locked()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed Apr 29, 2008
1 parent 6203554 commit 7663c1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7663c1e

Please sign in to comment.