aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-05-28 11:50:26 -0400
committerJens Axboe <axboe@fb.com>2014-05-28 11:50:26 -0400
commit6178976500ae61fa7b12ebb2d3de816dc9396388 (patch)
tree143df1479f56458801b676d038e6a7157a472981 /drivers/block
parent6314a108ec19aefa5160535b2bfe1ca9c38efe37 (diff)
parentd852564f8c88b0604490234fdeeb6fb47e4bcc7a (diff)
Merge branch 'for-3.16/core' into for-3.16/drivers
mtip32xx uses blk_mq_alloc_reserved_request(), so pull in the core changes so we have a properly merged end result. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/mtip32xx/mtip32xx.c2
-rw-r--r--drivers/block/null_blk.c35
-rw-r--r--drivers/block/skd_main.c4
3 files changed, 6 insertions, 35 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index ae331ab4a451..ea323e91903b 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -178,7 +178,7 @@ static struct mtip_cmd *mtip_get_int_command(struct driver_data *dd)
178{ 178{
179 struct request *rq; 179 struct request *rq;
180 180
181 rq = blk_mq_alloc_reserved_request(dd->queue, 0, __GFP_WAIT); 181 rq = blk_mq_alloc_request(dd->queue, 0, __GFP_WAIT, true);
182 return blk_mq_rq_to_pdu(rq); 182 return blk_mq_rq_to_pdu(rq);
183} 183}
184 184
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index e932398588aa..5a8081114df6 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -322,39 +322,10 @@ static int null_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq)
322} 322}
323 323
324static struct blk_mq_hw_ctx *null_alloc_hctx(struct blk_mq_tag_set *set, 324static struct blk_mq_hw_ctx *null_alloc_hctx(struct blk_mq_tag_set *set,
325 unsigned int hctx_index) 325 unsigned int hctx_index,
326 int node)
326{ 327{
327 int b_size = DIV_ROUND_UP(set->nr_hw_queues, nr_online_nodes); 328 return kzalloc_node(sizeof(struct blk_mq_hw_ctx), GFP_KERNEL, node);
328 int tip = (set->nr_hw_queues % nr_online_nodes);
329 int node = 0, i, n;
330
331 /*
332 * Split submit queues evenly wrt to the number of nodes. If uneven,
333 * fill the first buckets with one extra, until the rest is filled with
334 * no extra.
335 */
336 for (i = 0, n = 1; i < hctx_index; i++, n++) {
337 if (n % b_size == 0) {
338 n = 0;
339 node++;
340
341 tip--;
342 if (!tip)
343 b_size = set->nr_hw_queues / nr_online_nodes;
344 }
345 }
346
347 /*
348 * A node might not be online, therefore map the relative node id to the
349 * real node id.
350 */
351 for_each_online_node(n) {
352 if (!node)
353 break;
354 node--;
355 }
356
357 return kzalloc_node(sizeof(struct blk_mq_hw_ctx), GFP_KERNEL, n);
358} 329}
359 330
360static void null_free_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_index) 331static void null_free_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_index)
diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index 1dcf9067cffa..608532d3f8c9 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -743,6 +743,7 @@ static void skd_request_fn(struct request_queue *q)
743 break; 743 break;
744 } 744 }
745 skreq->discard_page = 1; 745 skreq->discard_page = 1;
746 req->completion_data = page;
746 skd_prep_discard_cdb(scsi_req, skreq, page, lba, count); 747 skd_prep_discard_cdb(scsi_req, skreq, page, lba, count);
747 748
748 } else if (flush == SKD_FLUSH_ZERO_SIZE_FIRST) { 749 } else if (flush == SKD_FLUSH_ZERO_SIZE_FIRST) {
@@ -855,10 +856,9 @@ static void skd_end_request(struct skd_device *skdev,
855 856
856 if ((io_flags & REQ_DISCARD) && 857 if ((io_flags & REQ_DISCARD) &&
857 (skreq->discard_page == 1)) { 858 (skreq->discard_page == 1)) {
858 struct bio *bio = req->bio;
859 pr_debug("%s:%s:%d, free the page!", 859 pr_debug("%s:%s:%d, free the page!",
860 skdev->name, __func__, __LINE__); 860 skdev->name, __func__, __LINE__);
861 __free_page(bio->bi_io_vec->bv_page); 861 __free_page(req->completion_data);
862 } 862 }
863 863
864 if (unlikely(error)) { 864 if (unlikely(error)) {