[1/6] block: initialize the write priority in blk_rq_bio_prep
diff mbox series

Message ID 20190606102904.4024-2-hch@lst.de
State New
Headers show
Series
  • [1/6] block: initialize the write priority in blk_rq_bio_prep
Related show

Commit Message

Christoph Hellwig June 6, 2019, 10:28 a.m. UTC
The priority field also makes sense for passthrough requests, so
initialize it in blk_rq_bio_prep.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hannes Reinecke June 7, 2019, 5:58 a.m. UTC | #1
On 6/6/19 12:28 PM, Christoph Hellwig wrote:
> The priority field also makes sense for passthrough requests, so
> initialize it in blk_rq_bio_prep.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  block/blk-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index ee1b35fe8572..9b88b1a3eb43 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -680,7 +680,6 @@ void blk_init_request_from_bio(struct request *req, struct bio *bio)
>  		req->cmd_flags |= REQ_FAILFAST_MASK;
>  
>  	req->__sector = bio->bi_iter.bi_sector;
> -	req->ioprio = bio_prio(bio);
>  	req->write_hint = bio->bi_write_hint;
>  	blk_rq_bio_prep(req->q, req, bio);
>  }
> @@ -1436,6 +1435,7 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
>  
>  	rq->__data_len = bio->bi_iter.bi_size;
>  	rq->bio = rq->biotail = bio;
> +	rq->ioprio = bio_prio(bio);
>  
>  	if (bio->bi_disk)
>  		rq->rq_disk = bio->bi_disk;
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
Minwoo Im June 7, 2019, 12:20 p.m. UTC | #2
It looks good to me:

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im June 20, 2019, 1:40 p.m. UTC | #3
Looks good to me"

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>

Patch
diff mbox series

diff --git a/block/blk-core.c b/block/blk-core.c
index ee1b35fe8572..9b88b1a3eb43 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -680,7 +680,6 @@  void blk_init_request_from_bio(struct request *req, struct bio *bio)
 		req->cmd_flags |= REQ_FAILFAST_MASK;
 
 	req->__sector = bio->bi_iter.bi_sector;
-	req->ioprio = bio_prio(bio);
 	req->write_hint = bio->bi_write_hint;
 	blk_rq_bio_prep(req->q, req, bio);
 }
@@ -1436,6 +1435,7 @@  void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
 
 	rq->__data_len = bio->bi_iter.bi_size;
 	rq->bio = rq->biotail = bio;
+	rq->ioprio = bio_prio(bio);
 
 	if (bio->bi_disk)
 		rq->rq_disk = bio->bi_disk;