Just use kobject_set_name(), that works in all kernels (I think...).
Kernels newer than 2.6.23 currently fail with:
/home/axboe/git/btrfs/btrfs-unstable/sysfs.c:188: error: unknown field
'name' specified in initializer
Signed-off-by: Chris Mason <chris.mason@oracle.com>
.release = btrfs_super_release,
};
-static struct kset btrfs_kset = {
- .kobj = {.name = "btrfs"},
-};
+static struct kset btrfs_kset;
int btrfs_sysfs_add_super(struct btrfs_fs_info *fs)
{
int btrfs_init_sysfs()
{
kobj_set_kset_s(&btrfs_kset, fs_subsys);
+ kobject_set_name(&btrfs_kset.kobj, "btrfs");
return kset_register(&btrfs_kset);
}