diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/ll_rw_blk.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index cd8cf302068c..808390c74200 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c | |||
@@ -968,8 +968,7 @@ EXPORT_SYMBOL(blk_queue_end_tag); | |||
968 | int blk_queue_start_tag(request_queue_t *q, struct request *rq) | 968 | int blk_queue_start_tag(request_queue_t *q, struct request *rq) |
969 | { | 969 | { |
970 | struct blk_queue_tag *bqt = q->queue_tags; | 970 | struct blk_queue_tag *bqt = q->queue_tags; |
971 | unsigned long *map = bqt->tag_map; | 971 | int tag; |
972 | int tag = 0; | ||
973 | 972 | ||
974 | if (unlikely((rq->flags & REQ_QUEUED))) { | 973 | if (unlikely((rq->flags & REQ_QUEUED))) { |
975 | printk(KERN_ERR | 974 | printk(KERN_ERR |
@@ -978,14 +977,10 @@ int blk_queue_start_tag(request_queue_t *q, struct request *rq) | |||
978 | BUG(); | 977 | BUG(); |
979 | } | 978 | } |
980 | 979 | ||
981 | for (map = bqt->tag_map; *map == -1UL; map++) { | 980 | tag = find_first_zero_bit(bqt->tag_map, bqt->max_depth); |
982 | tag += BLK_TAGS_PER_LONG; | 981 | if (tag >= bqt->max_depth) |
983 | 982 | return 1; | |
984 | if (tag >= bqt->max_depth) | ||
985 | return 1; | ||
986 | } | ||
987 | 983 | ||
988 | tag += ffz(*map); | ||
989 | __set_bit(tag, bqt->tag_map); | 984 | __set_bit(tag, bqt->tag_map); |
990 | 985 | ||
991 | rq->flags |= REQ_QUEUED; | 986 | rq->flags |= REQ_QUEUED; |