* [PATCH] md: use default_groups in kobj_type
@ 2022-01-06 10:03 Greg Kroah-Hartman
2022-01-06 18:42 ` Song Liu
0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2022-01-06 10:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, Song Liu, linux-raid
There are currently 2 ways to create a set of sysfs files for a
kobj_type, through the default_attrs field, and the default_groups
field. Move the md rdev sysfs code to use default_groups field which
has been the preferred way since aa30f47cf666 ("kobject: Add support for
default attribute groups to kobj_type") so that we can soon get rid of
the obsolete default_attrs field.
Cc: Song Liu <song@kernel.org>
Cc: linux-raid@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/md.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 5111ed966947..7642f3fb38e6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3602,6 +3602,7 @@ static struct attribute *rdev_default_attrs[] = {
&rdev_ppl_size.attr,
NULL,
};
+ATTRIBUTE_GROUPS(rdev_default);
static ssize_t
rdev_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
{
@@ -3651,7 +3652,7 @@ static const struct sysfs_ops rdev_sysfs_ops = {
static struct kobj_type rdev_ktype = {
.release = rdev_free,
.sysfs_ops = &rdev_sysfs_ops,
- .default_attrs = rdev_default_attrs,
+ .default_groups = rdev_default_groups,
};
int md_rdev_init(struct md_rdev *rdev)
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] md: use default_groups in kobj_type
2022-01-06 10:03 [PATCH] md: use default_groups in kobj_type Greg Kroah-Hartman
@ 2022-01-06 18:42 ` Song Liu
0 siblings, 0 replies; 2+ messages in thread
From: Song Liu @ 2022-01-06 18:42 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: open list, linux-raid
On Thu, Jan 6, 2022 at 2:03 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> There are currently 2 ways to create a set of sysfs files for a
> kobj_type, through the default_attrs field, and the default_groups
> field. Move the md rdev sysfs code to use default_groups field which
> has been the preferred way since aa30f47cf666 ("kobject: Add support for
> default attribute groups to kobj_type") so that we can soon get rid of
> the obsolete default_attrs field.
>
> Cc: Song Liu <song@kernel.org>
> Cc: linux-raid@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Applied to md-next. Thanks!
Song
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-06 18:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-06 10:03 [PATCH] md: use default_groups in kobj_type Greg Kroah-Hartman
2022-01-06 18:42 ` Song Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.