Linux-NVME Archive mirror
 help / color / mirror / Atom feed
From: Guixin Liu <kanie@linux.alibaba.com>
To: Christoph Hellwig <hch@lst.de>
Cc: kbusch@kernel.org, axboe@kernel.dk, sagi@grimberg.me,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: use nvme_disk_is_ns_head helper
Date: Tue, 12 Mar 2024 20:47:47 +0800	[thread overview]
Message-ID: <a57b4b6d-baef-48fb-8a10-89985c4d5fc0@linux.alibaba.com> (raw)
In-Reply-To: <20240312123211.GB26641@lst.de>


在 2024/3/12 20:32, Christoph Hellwig 写道:
> On Tue, Mar 12, 2024 at 03:53:10PM +0800, Guixin Liu wrote:
>> Use nvme_disk_is_ns_head helper instead of check
>> fops directly.
>>
>> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
>> ---
>>   drivers/nvme/host/sysfs.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
>> index f2832f70e7e0..ac8d622b5fc0 100644
>> --- a/drivers/nvme/host/sysfs.c
>> +++ b/drivers/nvme/host/sysfs.c
>> @@ -240,7 +240,7 @@ static ssize_t nuse_show(struct device *dev, struct device_attribute *attr,
>>   	int ret;
>>   
>>   	if (IS_ENABLED(CONFIG_NVME_MULTIPATH) &&
>> -	    bdev->bd_disk->fops == &nvme_ns_head_ops)
>> +	    nvme_disk_is_ns_head(bdev->bd_disk))
> When using nvme_disk_is_ns_head we should also be able to drop the
> IS_ENABLED(CONFIG_NVME_MULTIPATH) check.
It will be changed in v2, and I will also remove

IS_ENABLED(CONFIG_NVME_MULTIPATH) check in nvme_send_pr_command().

Best regards,
Guixin Liu



      reply	other threads:[~2024-03-12 12:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12  7:53 [PATCH] nvme: use nvme_disk_is_ns_head helper Guixin Liu
2024-03-12 12:32 ` Christoph Hellwig
2024-03-12 12:47   ` Guixin Liu [this message]

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=a57b4b6d-baef-48fb-8a10-89985c4d5fc0@linux.alibaba.com \
    --to=kanie@linux.alibaba.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).