mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
blk-mq: allocate flush_rq in blk_mq_init_flush()
It is reasonable to allocate flush req in blk_mq_init_flush(). Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
08e98fc601
commit
1bcb1eada4
3 changed files with 17 additions and 12 deletions
|
|
@ -472,7 +472,16 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,
|
|||
}
|
||||
EXPORT_SYMBOL(blkdev_issue_flush);
|
||||
|
||||
void blk_mq_init_flush(struct request_queue *q)
|
||||
int blk_mq_init_flush(struct request_queue *q)
|
||||
{
|
||||
struct blk_mq_tag_set *set = q->tag_set;
|
||||
|
||||
spin_lock_init(&q->mq_flush_lock);
|
||||
|
||||
q->flush_rq = kzalloc(round_up(sizeof(struct request) +
|
||||
set->cmd_size, cache_line_size()),
|
||||
GFP_KERNEL);
|
||||
if (!q->flush_rq)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue