Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64918
b: refs/heads/master
c: dd94125
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Sep 14, 2007
1 parent ce9e357 commit fa7e506
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 19299b1a722198830e39264a0f2edadd3fde74c2
refs/heads/master: dd941252a81b02b5915e2db160fe02c972875846
10 changes: 10 additions & 0 deletions trunk/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,12 @@ void blk_queue_end_tag(struct request_queue *q, struct request *rq)

bqt->tag_index[tag] = NULL;

/*
* We use test_and_clear_bit's memory ordering properties here.
* The tag_map bit acts as a lock for tag_index[bit], so we need
* a barrer before clearing the bit (precisely: release semantics).
* Could use clear_bit_unlock when it is merged.
*/
if (unlikely(!test_and_clear_bit(tag, bqt->tag_map))) {
printk(KERN_ERR "%s: attempt to clear non-busy tag (%d)\n",
__FUNCTION__, tag);
Expand Down Expand Up @@ -1137,6 +1143,10 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
return 1;

} while (test_and_set_bit(tag, bqt->tag_map));
/*
* We rely on test_and_set_bit providing lock memory ordering semantics
* (could use test_and_set_bit_lock when it is merged).
*/

rq->cmd_flags |= REQ_QUEUED;
rq->tag = tag;
Expand Down

0 comments on commit fa7e506

Please sign in to comment.