X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=block%2Fblk-mq.c;h=ade8a2d1b0aa8600ad31413b59db37392628bffc;hb=5353f65b859255a07e8bf5c096be4d5d268b46e8;hp=c82de08f3721c9f256d9837341c42290daeeef88;hpb=0f5abd4020bfd2b1eec6975b91bd5068aa674a93;p=firefly-linux-kernel-4.4.55.git diff --git a/block/blk-mq.c b/block/blk-mq.c index c82de08f3721..ade8a2d1b0aa 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -41,7 +41,7 @@ static bool blk_mq_hctx_has_pending(struct blk_mq_hw_ctx *hctx) { unsigned int i; - for (i = 0; i < hctx->ctx_map.map_size; i++) + for (i = 0; i < hctx->ctx_map.size; i++) if (hctx->ctx_map.map[i].word) return true; @@ -730,7 +730,7 @@ static void flush_busy_ctxs(struct blk_mq_hw_ctx *hctx, struct list_head *list) struct blk_mq_ctx *ctx; int i; - for (i = 0; i < hctx->ctx_map.map_size; i++) { + for (i = 0; i < hctx->ctx_map.size; i++) { struct blk_align_bitmap *bm = &hctx->ctx_map.map[i]; unsigned int off, bit; @@ -1818,7 +1818,7 @@ static void blk_mq_map_swqueue(struct request_queue *q) * This is more accurate and more efficient than looping * over all possibly mapped software queues. */ - map->map_size = hctx->nr_ctx / map->bits_per_word; + map->size = DIV_ROUND_UP(hctx->nr_ctx, map->bits_per_word); /* * Initialize batch roundrobin counts