[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41a739cb-1d17-3713-0648-1f91e2267cbc@nvidia.com>
Date: Mon, 22 May 2023 09:31:54 +0000
From: Chaitanya Kulkarni <chaitanyak@...dia.com>
To: "linan666@...weicloud.com" <linan666@...weicloud.com>,
"axboe@...nel.dk" <axboe@...nel.dk>
CC: "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linan122@...wei.com" <linan122@...wei.com>,
"yukuai3@...wei.com" <yukuai3@...wei.com>,
"yi.zhang@...wei.com" <yi.zhang@...wei.com>,
"houtao1@...wei.com" <houtao1@...wei.com>,
"yangerkun@...wei.com" <yangerkun@...wei.com>
Subject: Re: [PATCH] block: remove redundant req_op in blk_rq_is_passthrough
On 5/22/23 01:53, linan666@...weicloud.com wrote:
> From: Li Nan <linan122@...wei.com>
>
> op &= REQ_OP_MASK in blk_op_is_passthrough() is exactly what req_op() do.
> Therefore, it is redundant to call req_op() for blk_op_is_passthrough().
I couldn't understand commit log, feel free to ignore following
if others are okay with it :-
req_op() returns the REQ_OP_XXX with req->cmd_flags & REQ_OP_MASKS.
blk_op_is_passthrugh() masks op with REQ_OP_MASKS to compare
REQ_OP_XXX with passthrough requests REQ_OP_IN/REQ_OP_OUT.
245
246 static inline bool blk_op_is_passthrough(blk_opf_t op)
247 {
248 op &= REQ_OP_MASK;
249 return op == REQ_OP_DRV_IN || op == REQ_OP_DRV_OUT;
250 }
251
Passing req_op(rq) argument to blk_op_is_passthru() results in double
masking of request flags first in req_op() and again in
blk_op_is_passthrough().
Avoid that by passing req->cmd_flags instead of req_op(req) as
an argument to blk_op_is_passthrough() when it is called from
blk_rq_is_passthruough().
irrespective of above suggestion, looks good.
Reviewed-by: Chaitanya Kulkarni <kch@...dia.com>
-ck
Powered by blists - more mailing lists