diff options
author | Christoph Hellwig <hch@lst.de> | 2017-01-27 09:51:45 -0700 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 6039fd083b82999c72ea3ff353d7e75f4485f6d1 (patch) | |
tree | 5dd30700b3cbfc088794014cadcf69b6ed892cf2 /block/blk-flush.c | |
parent | 847b2efc089af009f83c6c675af5d4c91ab7df02 (diff) |
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>
(cherry picked from commit 6d247d7f71d1fa4b66a5f4da7b1daa21510d529b)
Diffstat (limited to 'block/blk-flush.c')
-rw-r--r-- | block/blk-flush.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c index 71aba60b49b0..1cd7f2480081 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -541,11 +541,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; |