linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: 苏辉 <sh_def@163.com>
To: "Johannes Thumshirn" <Johannes.Thumshirn@wdc.com>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re:Re: [PATCH] blk: use REQ_OP_WRITE instead of hard code
Date: Mon, 19 Oct 2020 22:30:06 +0800 (CST)	[thread overview]
Message-ID: <3e965865.5946.17541447519.Coremail.sh_def@163.com> (raw)
In-Reply-To: <SN4PR0401MB3598441A5D53ED264496CF419B1E0@SN4PR0401MB3598.namprd04.prod.outlook.com>

Yeah, you are right, thanks for your explanation<br/><br/>Maybe we should define a MASK to do this?
At 2020-10-19 22:09:40, "Johannes Thumshirn" <Johannes.Thumshirn@wdc.com> wrote:
>On 19/10/2020 16:06, Hui Su wrote:
>> use REQ_OP_WRITE instead of hard code in
>> op_is_write().
>> 
>> Signed-off-by: Hui Su <sh_def@163.com>
>> ---
>>  include/linux/blk_types.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
>> index 7d7c13238fdb..7b9b02378c24 100644
>> --- a/include/linux/blk_types.h
>> +++ b/include/linux/blk_types.h
>> @@ -440,7 +440,7 @@ static inline void bio_set_op_attrs(struct bio *bio, unsigned op,
>>  
>>  static inline bool op_is_write(unsigned int op)
>>  {
>> -	return (op & 1);
>> +	return (op & REQ_OP_WRITE);
>
>op_is_write() returns true for every req_op that writes to a device (they all have 
>the lowest bit set), while REQ_OP_WRITE means a WRITE. You'll change the semantics
>with this patch.

  reply	other threads:[~2020-10-19 14:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 13:50 [PATCH] blk: use REQ_OP_WRITE instead of hard code Hui Su
2020-10-19 14:09 ` Johannes Thumshirn
2020-10-19 14:30   ` 苏辉 [this message]
2020-10-19 14:32     ` Johannes Thumshirn

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=3e965865.5946.17541447519.Coremail.sh_def@163.com \
    --to=sh_def@163.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).