Skip to content

Commit 219aac5

Browse files
gregkhDarrick J. Wong
authored andcommitted
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 aa30f47 ("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
1 parent f8d92a6 commit 219aac5

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

fs/xfs/xfs_error.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,12 @@ static struct attribute *xfs_errortag_attrs[] = {
213213
XFS_ERRORTAG_ATTR_LIST(ag_resv_fail),
214214
NULL,
215215
};
216+
ATTRIBUTE_GROUPS(xfs_errortag);
216217

217218
static struct kobj_type xfs_errortag_ktype = {
218219
.release = xfs_sysfs_release,
219220
.sysfs_ops = &xfs_errortag_sysfs_ops,
220-
.default_attrs = xfs_errortag_attrs,
221+
.default_groups = xfs_errortag_groups,
221222
};
222223

223224
int

fs/xfs/xfs_sysfs.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ static const struct sysfs_ops xfs_sysfs_ops = {
6767
static struct attribute *xfs_mp_attrs[] = {
6868
NULL,
6969
};
70+
ATTRIBUTE_GROUPS(xfs_mp);
7071

7172
struct kobj_type xfs_mp_ktype = {
7273
.release = xfs_sysfs_release,
7374
.sysfs_ops = &xfs_sysfs_ops,
74-
.default_attrs = xfs_mp_attrs,
75+
.default_groups = xfs_mp_groups,
7576
};
7677

7778
#ifdef DEBUG
@@ -239,11 +240,12 @@ static struct attribute *xfs_dbg_attrs[] = {
239240
#endif
240241
NULL,
241242
};
243+
ATTRIBUTE_GROUPS(xfs_dbg);
242244

243245
struct kobj_type xfs_dbg_ktype = {
244246
.release = xfs_sysfs_release,
245247
.sysfs_ops = &xfs_sysfs_ops,
246-
.default_attrs = xfs_dbg_attrs,
248+
.default_groups = xfs_dbg_groups,
247249
};
248250

249251
#endif /* DEBUG */
@@ -296,11 +298,12 @@ static struct attribute *xfs_stats_attrs[] = {
296298
ATTR_LIST(stats_clear),
297299
NULL,
298300
};
301+
ATTRIBUTE_GROUPS(xfs_stats);
299302

300303
struct kobj_type xfs_stats_ktype = {
301304
.release = xfs_sysfs_release,
302305
.sysfs_ops = &xfs_sysfs_ops,
303-
.default_attrs = xfs_stats_attrs,
306+
.default_groups = xfs_stats_groups,
304307
};
305308

306309
/* xlog */
@@ -381,11 +384,12 @@ static struct attribute *xfs_log_attrs[] = {
381384
ATTR_LIST(write_grant_head),
382385
NULL,
383386
};
387+
ATTRIBUTE_GROUPS(xfs_log);
384388

385389
struct kobj_type xfs_log_ktype = {
386390
.release = xfs_sysfs_release,
387391
.sysfs_ops = &xfs_sysfs_ops,
388-
.default_attrs = xfs_log_attrs,
392+
.default_groups = xfs_log_groups,
389393
};
390394

391395
/*
@@ -534,12 +538,12 @@ static struct attribute *xfs_error_attrs[] = {
534538
ATTR_LIST(retry_timeout_seconds),
535539
NULL,
536540
};
537-
541+
ATTRIBUTE_GROUPS(xfs_error);
538542

539543
static struct kobj_type xfs_error_cfg_ktype = {
540544
.release = xfs_sysfs_release,
541545
.sysfs_ops = &xfs_sysfs_ops,
542-
.default_attrs = xfs_error_attrs,
546+
.default_groups = xfs_error_groups,
543547
};
544548

545549
static struct kobj_type xfs_error_ktype = {

0 commit comments

Comments
 (0)