mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: "linan666@huaweicloud.com" <linan666@huaweicloud.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linan122@huawei.com" <linan122@huawei.com>,
	"yukuai3@huawei.com" <yukuai3@huawei.com>,
	"yi.zhang@huawei.com" <yi.zhang@huawei.com>,
	"houtao1@huawei.com" <houtao1@huawei.com>,
	"yangerkun@huawei.com" <yangerkun@huawei.com>
Subject: Re: [PATCH] block: remove redundant req_op in blk_rq_is_passthrough
Date: Mon, 22 May 2023 09:31:54 +0000	[thread overview]
Message-ID: <41a739cb-1d17-3713-0648-1f91e2267cbc@nvidia.com> (raw)
In-Reply-To: <20230522085355.1740772-1-linan666@huaweicloud.com>

On 5/22/23 01:53, linan666@huaweicloud.com wrote:
> From: Li Nan <linan122@huawei.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@nvidia.com>

-ck



  reply	other threads:[~2023-05-22  9:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22  8:53 linan666
2023-05-22  9:31 ` Chaitanya Kulkarni [this message]
2023-05-23  6:19 ` Christoph Hellwig
2023-05-23 17:13 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41a739cb-1d17-3713-0648-1f91e2267cbc@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=axboe@kernel.dk \
    --cc=houtao1@huawei.com \
    --cc=linan122@huawei.com \
    --cc=linan666@huaweicloud.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®