Commit 219aac5d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Darrick J. Wong

xfs: sysfs: use default_groups in kobj_type

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 xfs sysfs code to use default_groups field which has
been the preferred way since aa30f47c ("kobject: Add support for
default attribute groups to kobj_type") so that we can soon get rid of
the obsolete default_attrs field.

Cc: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent f8d92a66
...@@ -213,11 +213,12 @@ static struct attribute *xfs_errortag_attrs[] = { ...@@ -213,11 +213,12 @@ static struct attribute *xfs_errortag_attrs[] = {
XFS_ERRORTAG_ATTR_LIST(ag_resv_fail), XFS_ERRORTAG_ATTR_LIST(ag_resv_fail),
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(xfs_errortag);
static struct kobj_type xfs_errortag_ktype = { static struct kobj_type xfs_errortag_ktype = {
.release = xfs_sysfs_release, .release = xfs_sysfs_release,
.sysfs_ops = &xfs_errortag_sysfs_ops, .sysfs_ops = &xfs_errortag_sysfs_ops,
.default_attrs = xfs_errortag_attrs, .default_groups = xfs_errortag_groups,
}; };
int int
......
...@@ -67,11 +67,12 @@ static const struct sysfs_ops xfs_sysfs_ops = { ...@@ -67,11 +67,12 @@ static const struct sysfs_ops xfs_sysfs_ops = {
static struct attribute *xfs_mp_attrs[] = { static struct attribute *xfs_mp_attrs[] = {
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(xfs_mp);
struct kobj_type xfs_mp_ktype = { struct kobj_type xfs_mp_ktype = {
.release = xfs_sysfs_release, .release = xfs_sysfs_release,
.sysfs_ops = &xfs_sysfs_ops, .sysfs_ops = &xfs_sysfs_ops,
.default_attrs = xfs_mp_attrs, .default_groups = xfs_mp_groups,
}; };
#ifdef DEBUG #ifdef DEBUG
...@@ -239,11 +240,12 @@ static struct attribute *xfs_dbg_attrs[] = { ...@@ -239,11 +240,12 @@ static struct attribute *xfs_dbg_attrs[] = {
#endif #endif
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(xfs_dbg);
struct kobj_type xfs_dbg_ktype = { struct kobj_type xfs_dbg_ktype = {
.release = xfs_sysfs_release, .release = xfs_sysfs_release,
.sysfs_ops = &xfs_sysfs_ops, .sysfs_ops = &xfs_sysfs_ops,
.default_attrs = xfs_dbg_attrs, .default_groups = xfs_dbg_groups,
}; };
#endif /* DEBUG */ #endif /* DEBUG */
...@@ -296,11 +298,12 @@ static struct attribute *xfs_stats_attrs[] = { ...@@ -296,11 +298,12 @@ static struct attribute *xfs_stats_attrs[] = {
ATTR_LIST(stats_clear), ATTR_LIST(stats_clear),
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(xfs_stats);
struct kobj_type xfs_stats_ktype = { struct kobj_type xfs_stats_ktype = {
.release = xfs_sysfs_release, .release = xfs_sysfs_release,
.sysfs_ops = &xfs_sysfs_ops, .sysfs_ops = &xfs_sysfs_ops,
.default_attrs = xfs_stats_attrs, .default_groups = xfs_stats_groups,
}; };
/* xlog */ /* xlog */
...@@ -381,11 +384,12 @@ static struct attribute *xfs_log_attrs[] = { ...@@ -381,11 +384,12 @@ static struct attribute *xfs_log_attrs[] = {
ATTR_LIST(write_grant_head), ATTR_LIST(write_grant_head),
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(xfs_log);
struct kobj_type xfs_log_ktype = { struct kobj_type xfs_log_ktype = {
.release = xfs_sysfs_release, .release = xfs_sysfs_release,
.sysfs_ops = &xfs_sysfs_ops, .sysfs_ops = &xfs_sysfs_ops,
.default_attrs = xfs_log_attrs, .default_groups = xfs_log_groups,
}; };
/* /*
...@@ -534,12 +538,12 @@ static struct attribute *xfs_error_attrs[] = { ...@@ -534,12 +538,12 @@ static struct attribute *xfs_error_attrs[] = {
ATTR_LIST(retry_timeout_seconds), ATTR_LIST(retry_timeout_seconds),
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(xfs_error);
static struct kobj_type xfs_error_cfg_ktype = { static struct kobj_type xfs_error_cfg_ktype = {
.release = xfs_sysfs_release, .release = xfs_sysfs_release,
.sysfs_ops = &xfs_sysfs_ops, .sysfs_ops = &xfs_sysfs_ops,
.default_attrs = xfs_error_attrs, .default_groups = xfs_error_groups,
}; };
static struct kobj_type xfs_error_ktype = { static struct kobj_type xfs_error_ktype = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment