diff mbox series

[1/3] block/mq-deadline: Use dd_rq_ioclass() instead of open-coding it

Message ID 20231205053213.522772-2-bvanassche@acm.org (mailing list archive)
State New, archived
Headers show
Series Improve mq-deadline I/O priority support | expand

Commit Message

Bart Van Assche Dec. 5, 2023, 5:32 a.m. UTC
Use an existing helper function instead of open-coding it. No
functionality is changed by this patch.

Cc: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/mq-deadline.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Damien Le Moal Dec. 6, 2023, 2:35 a.m. UTC | #1
On 12/5/23 14:32, Bart Van Assche wrote:
> Use an existing helper function instead of open-coding it. No
> functionality is changed by this patch.
> 
> Cc: Damien Le Moal <dlemoal@kernel.org>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Looks good.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

> ---
>  block/mq-deadline.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/block/mq-deadline.c b/block/mq-deadline.c
> index f958e79277b8..e558f3660357 100644
> --- a/block/mq-deadline.c
> +++ b/block/mq-deadline.c
> @@ -798,8 +798,6 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>  	struct request_queue *q = hctx->queue;
>  	struct deadline_data *dd = q->elevator->elevator_data;
>  	const enum dd_data_dir data_dir = rq_data_dir(rq);
> -	u16 ioprio = req_get_ioprio(rq);
> -	u8 ioprio_class = IOPRIO_PRIO_CLASS(ioprio);
>  	struct dd_per_prio *per_prio;
>  	enum dd_prio prio;
>  
> @@ -811,7 +809,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>  	 */
>  	blk_req_zone_write_unlock(rq);
>  
> -	prio = ioprio_class_to_prio[ioprio_class];
> +	prio = ioprio_class_to_prio[dd_rq_ioclass(rq)];
>  	per_prio = &dd->per_prio[prio];
>  	if (!rq->elv.priv[0]) {
>  		per_prio->stats.inserted++;
Christoph Hellwig Dec. 11, 2023, 4:54 p.m. UTC | #2
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index f958e79277b8..e558f3660357 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -798,8 +798,6 @@  static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 	struct request_queue *q = hctx->queue;
 	struct deadline_data *dd = q->elevator->elevator_data;
 	const enum dd_data_dir data_dir = rq_data_dir(rq);
-	u16 ioprio = req_get_ioprio(rq);
-	u8 ioprio_class = IOPRIO_PRIO_CLASS(ioprio);
 	struct dd_per_prio *per_prio;
 	enum dd_prio prio;
 
@@ -811,7 +809,7 @@  static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 	 */
 	blk_req_zone_write_unlock(rq);
 
-	prio = ioprio_class_to_prio[ioprio_class];
+	prio = ioprio_class_to_prio[dd_rq_ioclass(rq)];
 	per_prio = &dd->per_prio[prio];
 	if (!rq->elv.priv[0]) {
 		per_prio->stats.inserted++;