Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 94846
b: refs/heads/master
c: 8f45c1a
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Apr 29, 2008
1 parent 198f421 commit fd3ebf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 25a025863e024f6b86b48137b10b4960c50351b0
refs/heads/master: 8f45c1a58a25c3a1a2f42521445e1e786c4c0b92
10 changes: 8 additions & 2 deletions trunk/include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ struct request_queue
#define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */
#define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */

static inline int queue_is_locked(struct request_queue *q)
{
spinlock_t *lock = q->queue_lock;
return lock && spin_is_locked(lock);
}

static inline void queue_flag_set_unlocked(unsigned int flag,
struct request_queue *q)
{
Expand All @@ -418,7 +424,7 @@ static inline void queue_flag_set_unlocked(unsigned int flag,

static inline void queue_flag_set(unsigned int flag, struct request_queue *q)
{
WARN_ON_ONCE(!spin_is_locked(q->queue_lock));
WARN_ON_ONCE(!queue_is_locked(q));
__set_bit(flag, &q->queue_flags);
}

Expand All @@ -430,7 +436,7 @@ static inline void queue_flag_clear_unlocked(unsigned int flag,

static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
{
WARN_ON_ONCE(!spin_is_locked(q->queue_lock));
WARN_ON_ONCE(!queue_is_locked(q));
__clear_bit(flag, &q->queue_flags);
}

Expand Down

0 comments on commit fd3ebf7

Please sign in to comment.