Skip to contentSkip to conversation

ext4: replace ktype default_attrs with default_groups

PATCH In review Kimberly Brown 2 participants 2 messages May 8, 2019 – Jul 3, 2019 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: replace ktype default_attrs with default_groups

The kobj_type default_attrs field is being replaced by the default_groups field. Replace the default_attrs field in ext4_sb_ktype and ext4_feat_ktype with default_groups. Use the ATTRIBUTE_GROUPS macro to create ext4_groups and ext4_feat_groups.

---

This patch depends on a patch in the driver-core tree:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-next&id=aa30f47cf666111f6bbfd15f290a27e8a7b9d854

Greg KH can take this patch through the driver-core tree, or this patch can wait a release cycle and go through the subsystem's tree, whichever the subsystem maintainer is more comfortable with.

 fs/ext4/sysfs.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/ext4/sysfs.c +4 -2
index 616c075da062..ef3b82dba59b 100644
@@ -230,6 +230,7 @@ static struct attribute *ext4_attrs[] = {
 	ATTR_LIST(journal_task),
 	NULL,
 };
+ATTRIBUTE_GROUPS(ext4);
 
 /* Features this copy of ext4 supports */
 EXT4_ATTR_FEATURE(lazy_itable_init);
@@ -250,6 +251,7 @@ static struct attribute *ext4_feat_attrs[] = {
 	ATTR_LIST(metadata_csum_seed),
 	NULL,
 };
+ATTRIBUTE_GROUPS(ext4_feat);
 
 static void *calc_ptr(struct ext4_attr *a, struct ext4_sb_info *sbi)
 {
@@ -368,13 +370,13 @@ static const struct sysfs_ops ext4_attr_ops = {
 };
 
 static struct kobj_type ext4_sb_ktype = {
-	.default_attrs	= ext4_attrs,
+	.default_groups = ext4_groups,
 	.sysfs_ops	= &ext4_attr_ops,
 	.release	= ext4_sb_release,
 };
 
 static struct kobj_type ext4_feat_ktype = {
-	.default_attrs	= ext4_feat_attrs,
+	.default_groups = ext4_feat_groups,
 	.sysfs_ops	= &ext4_attr_ops,
 	.release	= (void (*)(struct kobject *))kfree,
 };
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 6 lines · Kimberly Brown

The kobj_type default_attrs field is being replaced by the default_groups field. Replace the default_attrs field in ext4_sb_ktype and ext4_feat_ktype with default_groups. Use the ATTRIBUTE_GROUPS macro to create ext4_groups and ext4_feat_groups.

Quoted 8 lines

---

This patch depends on a patch in the driver-core tree:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-next&id=aa30f47cf666111f6bbfd15f290a27e8a7b9d854

Greg KH can take this patch through the driver-core tree, or this patch can wait a release cycle and go through the subsystem's tree, whichever the subsystem maintainer is more comfortable with.

Thanks, since that commit is in 5.2-rc2, I've applied this patch.

- Ted