ocfs2: use default_groups in kobj_type
There are currently two 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 aa30f47cf6 ("kobject: Add support for default
attribute groups to kobj_type") so that we can soon get rid of the
obsolete default_attrs field.
Link: https://lkml.kernel.org/r/20211228144517.391660-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
e07bf00c40
commit
59430cc114
@@ -94,6 +94,7 @@ static struct attribute *ocfs2_filecheck_attrs[] = {
|
|||||||
&ocfs2_filecheck_attr_set.attr,
|
&ocfs2_filecheck_attr_set.attr,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(ocfs2_filecheck);
|
||||||
|
|
||||||
static void ocfs2_filecheck_release(struct kobject *kobj)
|
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 = {
|
static struct kobj_type ocfs2_ktype_filecheck = {
|
||||||
.default_attrs = ocfs2_filecheck_attrs,
|
.default_groups = ocfs2_filecheck_groups,
|
||||||
.sysfs_ops = &ocfs2_filecheck_ops,
|
.sysfs_ops = &ocfs2_filecheck_ops,
|
||||||
.release = ocfs2_filecheck_release,
|
.release = ocfs2_filecheck_release,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user