blk-mq: user (1 << order) to implement order_to_size()
authorMing Lei <tom.leiming@gmail.com>
Sat, 19 Apr 2014 10:00:18 +0000 (18:00 +0800)
committerJens Axboe <axboe@fb.com>
Mon, 21 Apr 2014 16:38:38 +0000 (10:38 -0600)
Cc: Jörg-Volker Peetz <jvpeetz@web.de>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c

index c2777970f28bd3188c5fc033116292c2ed290d50..3a560a4db0b4047f1d5c295208aaeb02fb69b328 100644 (file)
@@ -1130,12 +1130,7 @@ static void blk_mq_free_rq_map(struct blk_mq_tag_set *set,
 
 static size_t order_to_size(unsigned int order)
 {
-       size_t ret = PAGE_SIZE;
-
-       while (order--)
-               ret *= 2;
-
-       return ret;
+       return (size_t)PAGE_SIZE << order;
 }
 
 static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set,