mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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 <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
e6f7f93d58
commit
5ea708d15a
3 changed files with 18 additions and 26 deletions
|
|
@ -823,7 +823,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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue