* [Ocfs2-devel] [PATCH] ocfs2: use default_groups in kobj_type
@ 2021-12-28 14:45 Greg Kroah-Hartman via Ocfs2-devel
2021-12-29 1:47 ` Joseph Qi via Ocfs2-devel
0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman via Ocfs2-devel @ 2021-12-28 14:45 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, ocfs2-devel
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 ocfs2 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: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: ocfs2-devel@oss.oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ocfs2/filecheck.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/ocfs2/filecheck.c b/fs/ocfs2/filecheck.c
index de56e6231af8..1ad7106741f8 100644
--- a/fs/ocfs2/filecheck.c
+++ b/fs/ocfs2/filecheck.c
@@ -94,6 +94,7 @@ static struct attribute *ocfs2_filecheck_attrs[] = {
&ocfs2_filecheck_attr_set.attr,
NULL
};
+ATTRIBUTE_GROUPS(ocfs2_filecheck);
static void ocfs2_filecheck_release(struct kobject *kobj)
{
@@ -138,7 +139,7 @@ static const struct sysfs_ops ocfs2_filecheck_ops = {
};
static struct kobj_type ocfs2_ktype_filecheck = {
- .default_attrs = ocfs2_filecheck_attrs,
+ .default_groups = ocfs2_filecheck_groups,
.sysfs_ops = &ocfs2_filecheck_ops,
.release = ocfs2_filecheck_release,
};
--
2.34.1
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Ocfs2-devel] [PATCH] ocfs2: use default_groups in kobj_type
2021-12-28 14:45 [Ocfs2-devel] [PATCH] ocfs2: use default_groups in kobj_type Greg Kroah-Hartman via Ocfs2-devel
@ 2021-12-29 1:47 ` Joseph Qi via Ocfs2-devel
0 siblings, 0 replies; 2+ messages in thread
From: Joseph Qi via Ocfs2-devel @ 2021-12-29 1:47 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-kernel, akpm; +Cc: ocfs2-devel
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
On 12/28/21 10:45 PM, Greg Kroah-Hartman 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 ocfs2 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: Mark Fasheh <mark@fasheh.com>
> Cc: Joel Becker <jlbec@evilplan.org>
> Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
> Cc: ocfs2-devel@oss.oracle.com
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> fs/ocfs2/filecheck.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/filecheck.c b/fs/ocfs2/filecheck.c
> index de56e6231af8..1ad7106741f8 100644
> --- a/fs/ocfs2/filecheck.c
> +++ b/fs/ocfs2/filecheck.c
> @@ -94,6 +94,7 @@ static struct attribute *ocfs2_filecheck_attrs[] = {
> &ocfs2_filecheck_attr_set.attr,
> NULL
> };
> +ATTRIBUTE_GROUPS(ocfs2_filecheck);
>
> static void ocfs2_filecheck_release(struct kobject *kobj)
> {
> @@ -138,7 +139,7 @@ static const struct sysfs_ops ocfs2_filecheck_ops = {
> };
>
> static struct kobj_type ocfs2_ktype_filecheck = {
> - .default_attrs = ocfs2_filecheck_attrs,
> + .default_groups = ocfs2_filecheck_groups,
> .sysfs_ops = &ocfs2_filecheck_ops,
> .release = ocfs2_filecheck_release,
> };
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-29 1:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28 14:45 [Ocfs2-devel] [PATCH] ocfs2: use default_groups in kobj_type Greg Kroah-Hartman via Ocfs2-devel
2021-12-29 1:47 ` Joseph Qi via Ocfs2-devel
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).