aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2005-06-23 03:08:48 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:15 -0400
commit2bf0fdad51c6710bf15d0bf4b9b30b8498fe4ddd (patch)
treee4dea0ce02413260ca4dfc3b7de0bb91570f331b /drivers/block
parent15d20bfd606c4b4454aeaa05fc86f77994e48c92 (diff)
[PATCH] blk: use find_first_zero_bit() in blk_queue_start_tag()
blk_queue_start_tag() hand-coded searching for the first zero bit in the tag map. Replace it with find_first_zero_bit(). With this patch, blk_queue_star_tag() doesn't need to fill remains of tag map with 1, thus allowing it to work properly with the next remove_real_max_depth patch. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/ll_rw_blk.c13
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);
968int blk_queue_start_tag(request_queue_t *q, struct request *rq) 968int 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;