summaryrefslogtreecommitdiffstats
path: root/block/blk-flush.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-flush.c')
-rw-r--r--block/blk-flush.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c
index 55028a7..c72ab32 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -472,7 +472,7 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,
}
EXPORT_SYMBOL(blkdev_issue_flush);
-int blk_mq_init_flush(struct request_queue *q)
+static int blk_mq_init_flush(struct request_queue *q)
{
struct blk_mq_tag_set *set = q->tag_set;
@@ -485,3 +485,20 @@ int blk_mq_init_flush(struct request_queue *q)
return -ENOMEM;
return 0;
}
+
+int blk_init_flush(struct request_queue *q)
+{
+ if (q->mq_ops)
+ return blk_mq_init_flush(q);
+
+ q->flush_rq = kzalloc(sizeof(struct request), GFP_KERNEL);
+ if (!q->flush_rq)
+ return -ENOMEM;
+
+ return 0;
+}
+
+void blk_exit_flush(struct request_queue *q)
+{
+ kfree(q->flush_rq);
+}
OpenPOWER on IntegriCloud