diff mbox series

[2/3] block: set ioprio for flush bio

Message ID 20190710040224.12342-3-chaitanya.kulkarni@wdc.com (mailing list archive)
State New, archived
Headers show
Series block: set ioprio value | expand

Commit Message

Chaitanya Kulkarni July 10, 2019, 4:02 a.m. UTC
Set the current process's iopriority for flush bio.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-flush.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Martin K. Petersen July 12, 2019, 2:09 a.m. UTC | #1
Chaitanya,

> Set the current process's iopriority for flush bio.

Kind of weird for a flush command. But we might as well be consistent.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
diff mbox series

Patch

diff --git a/block/blk-flush.c b/block/blk-flush.c
index aedd9320e605..21013fcdf42c 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -69,6 +69,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"
@@ -445,6 +446,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);