summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-01-03 14:52:44 +0300
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit847b2efc089af009f83c6c675af5d4c91ab7df02 (patch)
treefc18fcc2d4802f60fc41975429226569ccf30fcf /drivers/md
parent27628f225c7a40ecfaeae3fe1ee790d0eea37e9c (diff)
block: simplify blk_init_allocated_queue
Return an errno value instead of the passed in queue so that the callers don't have to keep track of two queues, and move the assignment of the request_fn and lock to the caller as passing them as argument doesn't simplify anything. While we're at it also remove two pointless NULL assignments, given that the request structure is zeroed on allocation. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com> (cherry picked from commit 5ea708d15a928f7a479987704203616d3274c03b) Conflicts: block/blk-core.c
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-rq.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index 03e8df440500..12bf9c079c4d 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -852,7 +852,8 @@ static void dm_old_request_fn(struct request_queue *q)
int dm_old_init_request_queue(struct mapped_device *md)
{
/* Fully initialize the queue */
- if (!blk_init_allocated_queue(md->queue, dm_old_request_fn, NULL))
+ md->queue->request_fn = dm_old_request_fn;
+ if (blk_init_allocated_queue(md->queue) < 0)
return -EINVAL;
/* disable dm_old_request_fn's merge heuristic by default */