summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-05-27 20:59:46 +0200
committerJens Axboe <axboe@fb.com>2014-05-28 09:49:19 -0600
commit4ce01dd1a07d9cf3eaf44fbf4ea9a61b11badccc (patch)
treed3314a1d9affb10f9397d4351df26f4a95a5f047 /block/blk-mq.c
parent6fca6a611c27f1f0d90fbe1cc3c229dbf8c09e48 (diff)
downloadlinux-4ce01dd1a07d9cf3eaf44fbf4ea9a61b11badccc.tar.bz2
blk-mq: merge blk_mq_alloc_reserved_request into blk_mq_alloc_request
Instead of having two almost identical copies of the same code just let the callers pass in the reserved flag directly. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 67066ecc79c0..63d581d72a70 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -294,35 +294,21 @@ static struct request *blk_mq_alloc_request_pinned(struct request_queue *q,
return rq;
}
-struct request *blk_mq_alloc_request(struct request_queue *q, int rw, gfp_t gfp)
+struct request *blk_mq_alloc_request(struct request_queue *q, int rw, gfp_t gfp,
+ bool reserved)
{
struct request *rq;
if (blk_mq_queue_enter(q))
return NULL;
- rq = blk_mq_alloc_request_pinned(q, rw, gfp, false);
+ rq = blk_mq_alloc_request_pinned(q, rw, gfp, reserved);
if (rq)
blk_mq_put_ctx(rq->mq_ctx);
return rq;
}
EXPORT_SYMBOL(blk_mq_alloc_request);
-struct request *blk_mq_alloc_reserved_request(struct request_queue *q, int rw,
- gfp_t gfp)
-{
- struct request *rq;
-
- if (blk_mq_queue_enter(q))
- return NULL;
-
- rq = blk_mq_alloc_request_pinned(q, rw, gfp, true);
- if (rq)
- blk_mq_put_ctx(rq->mq_ctx);
- return rq;
-}
-EXPORT_SYMBOL(blk_mq_alloc_reserved_request);
-
static void __blk_mq_free_request(struct blk_mq_hw_ctx *hctx,
struct blk_mq_ctx *ctx, struct request *rq)
{