summaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2014-05-27 17:35:14 +0200
committerJens Axboe <axboe@fb.com>2014-05-27 17:37:08 +0200
commit3d2936f457a847d9d88a9cc127e0eb7a0ebba0ff (patch)
tree575a307f9715ee60ab45dbe31b677c644975f7ad /block/blk-core.c
parentblk-mq: avoid code duplication (diff)
downloadlinux-3d2936f457a847d9d88a9cc127e0eb7a0ebba0ff.tar.xz
linux-3d2936f457a847d9d88a9cc127e0eb7a0ebba0ff.zip
block: only allocate/free mq_usage_counter in blk-mq
The percpu counter is only used for blk-mq, so move its allocation and free inside blk-mq, and don't allocate it for legacy queue device. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 5b6f768a7c01..29d5fbafd94a 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -576,12 +576,9 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
if (!q)
return NULL;
- if (percpu_counter_init(&q->mq_usage_counter, 0))
- goto fail_q;
-
q->id = ida_simple_get(&blk_queue_ida, 0, 0, gfp_mask);
if (q->id < 0)
- goto fail_c;
+ goto fail_q;
q->backing_dev_info.ra_pages =
(VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
@@ -639,8 +636,6 @@ fail_bdi:
bdi_destroy(&q->backing_dev_info);
fail_id:
ida_simple_remove(&blk_queue_ida, q->id);
-fail_c:
- percpu_counter_destroy(&q->mq_usage_counter);
fail_q:
kmem_cache_free(blk_requestq_cachep, q);
return NULL;