* [PATCH] nvme: use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE for multipath_sysfs
@ 2026-05-13 9:50 John Garry
2026-05-15 4:45 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: John Garry @ 2026-05-13 9:50 UTC (permalink / raw)
To: hch, kbusch, sagi, axboe; +Cc: linux-nvme, bmarzins, John Garry
Use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE instead of
DEFINE_SYSFS_GROUP_VISIBLE, which means that we can drop
multipath_sysfs_attr_visible().
Incidentally, multipath_sysfs_attr_visible() should have returned a
umode_t.
This idea was suggested by Ben Marzinski elsewhere.
Signed-off-by: John Garry <john.g.garry@oracle.com>
diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index e59758616f277..52fca90c97d33 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -335,14 +335,7 @@ static bool multipath_sysfs_group_visible(struct kobject *kobj)
return nvme_disk_is_ns_head(dev_to_disk(dev));
}
-
-static bool multipath_sysfs_attr_visible(struct kobject *kobj,
- struct attribute *attr, int n)
-{
- return false;
-}
-
-DEFINE_SYSFS_GROUP_VISIBLE(multipath_sysfs)
+DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE(multipath_sysfs)
const struct attribute_group nvme_ns_mpath_attr_group = {
.name = "multipath",
--
2.43.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme: use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE for multipath_sysfs
2026-05-13 9:50 [PATCH] nvme: use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE for multipath_sysfs John Garry
@ 2026-05-15 4:45 ` Christoph Hellwig
2026-05-15 8:34 ` John Garry
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2026-05-15 4:45 UTC (permalink / raw)
To: John Garry; +Cc: kbusch, sagi, axboe, linux-nvme, bmarzins
On Wed, May 13, 2026 at 09:50:30AM +0000, John Garry wrote:
> Use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE instead of
> DEFINE_SYSFS_GROUP_VISIBLE, which means that we can drop
> multipath_sysfs_attr_visible().
>
> Incidentally, multipath_sysfs_attr_visible() should have returned a
> umode_t.
Looks ok, although all the magic symbol name concatenation in the
sysfs code drives me a bit crazy.
Signed-off-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme: use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE for multipath_sysfs
2026-05-15 4:45 ` Christoph Hellwig
@ 2026-05-15 8:34 ` John Garry
2026-05-15 11:34 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: John Garry @ 2026-05-15 8:34 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: kbusch, sagi, axboe, linux-nvme, bmarzins
On 15/05/2026 05:45, Christoph Hellwig wrote:
> On Wed, May 13, 2026 at 09:50:30AM +0000, John Garry wrote:
>> Use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE instead of
>> DEFINE_SYSFS_GROUP_VISIBLE, which means that we can drop
>> multipath_sysfs_attr_visible().
>>
>> Incidentally, multipath_sysfs_attr_visible() should have returned a
>> umode_t.
>
> Looks ok, although all the magic symbol name concatenation in the
> sysfs code drives me a bit crazy.
yeah, lots of #/## from those sysfs helpers
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by?
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme: use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE for multipath_sysfs
2026-05-15 8:34 ` John Garry
@ 2026-05-15 11:34 ` Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2026-05-15 11:34 UTC (permalink / raw)
To: John Garry; +Cc: Christoph Hellwig, kbusch, sagi, axboe, linux-nvme, bmarzins
On Fri, May 15, 2026 at 09:34:30AM +0100, John Garry wrote:
> yeah, lots of #/## from those sysfs helpers
>
>>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Reviewed-by?
Yes, sorry.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-15 11:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13 9:50 [PATCH] nvme: use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE for multipath_sysfs John Garry
2026-05-15 4:45 ` Christoph Hellwig
2026-05-15 8:34 ` John Garry
2026-05-15 11:34 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox