Skip to content

Commit b4a2a0e

Browse files
Jens Axboechrismason-xx
authored andcommitted
Btrfs: sysfs compile fixup
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>
1 parent bbf0d00 commit b4a2a0e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎fs/btrfs/sysfs.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@ static struct kobj_type btrfs_super_ktype = {
184184
.release = btrfs_super_release,
185185
};
186186

187-
static struct kset btrfs_kset = {
188-
.kobj = {.name = "btrfs"},
189-
};
187+
static struct kset btrfs_kset;
190188

191189
int btrfs_sysfs_add_super(struct btrfs_fs_info *fs)
192190
{
@@ -249,6 +247,7 @@ void btrfs_sysfs_del_super(struct btrfs_fs_info *fs)
249247
int btrfs_init_sysfs()
250248
{
251249
kobj_set_kset_s(&btrfs_kset, fs_subsys);
250+
kobject_set_name(&btrfs_kset.kobj, "btrfs");
252251
return kset_register(&btrfs_kset);
253252
}
254253

0 commit comments

Comments
 (0)