public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvme: use nvme_disk_is_ns_head helper
@ 2024-03-12  7:53 Guixin Liu
  2024-03-12 12:32 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Guixin Liu @ 2024-03-12  7:53 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi; +Cc: linux-nvme

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))
 		ret = ns_head_update_nuse(head);
 	else
 		ret = ns_update_nuse(bdev->bd_disk->private_data);
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-12 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox