This change is required to track the priority for the flush operations
with blktrace extension.

Signed-off-by: Chaitanya Kulkarni <[email protected]>
---
 block/blk-flush.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/blk-flush.c b/block/blk-flush.c
index d95f94892015..af84ed4cafc9 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -70,6 +70,7 @@
 #include <linux/blkdev.h>
 #include <linux/gfp.h>
 #include <linux/blk-mq.h>
+#include <linux/ioprio.h>
 
 #include "blk.h"
 #include "blk-mq.h"
@@ -446,6 +447,7 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t 
gfp_mask,
        bio = bio_alloc(gfp_mask, 0);
        bio_set_dev(bio, bdev);
        bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;
+       bio_set_prio(bio, get_current_ioprio());
 
        ret = submit_bio_wait(bio);
 
-- 
2.19.1

Reply via email to