summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/sysfs.c
diff options
context:
space:
mode:
authorKimberly Brown <kimbrownkd@gmail.com>2019-05-02 19:34:45 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-21 15:38:59 +0200
commit7c7e301406d0a93051d236600a72066278c2e4dc (patch)
tree73359d05f765596b699d3fd2001846be6ca43b16 /fs/btrfs/sysfs.c
parentfirmware: arm_scmi: Use the correct style for SPDX License Identifier (diff)
downloadlinux-7c7e301406d0a93051d236600a72066278c2e4dc.tar.xz
linux-7c7e301406d0a93051d236600a72066278c2e4dc.zip
btrfs: sysfs: Replace default_attrs in ktypes with groups
The kobj_type default_attrs field is being replaced by the default_groups field. Replace the default_attrs fields in btrfs_raid_ktype and space_info_ktype with default_groups. Change "raid_attributes" to "raid_attrs", and use the ATTRIBUTE_GROUPS macro to create raid_groups and space_info_groups. Signed-off-by: Kimberly Brown <kimbrownkd@gmail.com> Acked-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs/sysfs.c')
-rw-r--r--fs/btrfs/sysfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index a1481808db80..c1dfc97893ba 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -303,11 +303,12 @@ static ssize_t raid_bytes_show(struct kobject *kobj,
return snprintf(buf, PAGE_SIZE, "%llu\n", val);
}
-static struct attribute *raid_attributes[] = {
+static struct attribute *raid_attrs[] = {
BTRFS_ATTR_PTR(raid, total_bytes),
BTRFS_ATTR_PTR(raid, used_bytes),
NULL
};
+ATTRIBUTE_GROUPS(raid);
static void release_raid_kobj(struct kobject *kobj)
{
@@ -317,7 +318,7 @@ static void release_raid_kobj(struct kobject *kobj)
struct kobj_type btrfs_raid_ktype = {
.sysfs_ops = &kobj_sysfs_ops,
.release = release_raid_kobj,
- .default_attrs = raid_attributes,
+ .default_groups = raid_groups,
};
#define SPACE_INFO_ATTR(field) \
@@ -364,6 +365,7 @@ static struct attribute *space_info_attrs[] = {
BTRFS_ATTR_PTR(space_info, total_bytes_pinned),
NULL,
};
+ATTRIBUTE_GROUPS(space_info);
static void space_info_release(struct kobject *kobj)
{
@@ -375,7 +377,7 @@ static void space_info_release(struct kobject *kobj)
struct kobj_type space_info_ktype = {
.sysfs_ops = &kobj_sysfs_ops,
.release = space_info_release,
- .default_attrs = space_info_attrs,
+ .default_groups = space_info_groups,
};
static const struct attribute *allocation_attrs[] = {