summaryrefslogtreecommitdiffstats
path: root/block/blk-flush.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-01-27 09:51:45 -0700
committerJens Axboe <axboe@fb.com>2017-01-27 15:08:35 -0700
commit6d247d7f71d1fa4b66a5f4da7b1daa21510d529b (patch)
tree449921f154b9bd0176453478fdd7a8c6911be5ad /block/blk-flush.c
parent5ea708d15a928f7a479987704203616d3274c03b (diff)
downloadlinux-6d247d7f71d1fa4b66a5f4da7b1daa21510d529b.tar.bz2
block: allow specifying size for extra command data
This mirrors the blk-mq capabilities to allocate extra drivers-specific data behind struct request by setting a cmd_size field, as well as having a constructor / destructor for it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-flush.c')
-rw-r--r--block/blk-flush.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c
index 4427896641ac..0a0358e48b76 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -547,11 +547,10 @@ struct blk_flush_queue *blk_alloc_flush_queue(struct request_queue *q,
if (!fq)
goto fail;
- if (q->mq_ops) {
+ if (q->mq_ops)
spin_lock_init(&fq->mq_flush_lock);
- rq_sz = round_up(rq_sz + cmd_size, cache_line_size());
- }
+ rq_sz = round_up(rq_sz + cmd_size, cache_line_size());
fq->flush_rq = kzalloc_node(rq_sz, GFP_KERNEL, node);
if (!fq->flush_rq)
goto fail_rq;