diff options
author | Anand Jain <Anand.Jain@oracle.com> | 2015-03-10 06:38:29 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-05-27 12:27:20 +0200 |
commit | 2e7910d6ca359ff1dbe05b74e3d7f353b5b65362 (patch) | |
tree | 084502e31f72b6137d46e2e12919640d38ec4be3 /fs/btrfs/volumes.c | |
parent | 00c921c23f9155597ff4ac1263a6ff46dc9e2206 (diff) | |
download | op-kernel-dev-2e7910d6ca359ff1dbe05b74e3d7f353b5b65362.zip op-kernel-dev-2e7910d6ca359ff1dbe05b74e3d7f353b5b65362.tar.gz |
Btrfs: sysfs: move super_kobj and device_dir_kobj from fs_info to btrfs_fs_devices
This patch will provide a framework and help to create attributes
from the structure btrfs_fs_devices which are available even before
fs_info is created. So by moving the parent kobject super_kobj from
fs_info to btrfs_fs_devices, it will help to create attributes
from the btrfs_fs_devices as well.
Patches on top of this patch now will be able to create the
sys/fs/btrfs/fsid kobject and attributes from btrfs_fs_devices
when devices are scanned and registered to the kernel.
Just to note, this does not change any of the existing btrfs sysfs
external kobject names and its attributes and not even the life
cycle of them. Changes are internal only. And to ensure the same,
this path has been tested with various device operations and,
checking and comparing the sysfs kobjects and attributes with
sysfs kobject and attributes with out this patch, and they remain
same.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 174f5e1..39ff99e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2252,7 +2252,8 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) */ snprintf(fsid_buf, BTRFS_UUID_UNPARSED_SIZE, "%pU", root->fs_info->fsid); - if (kobject_rename(&root->fs_info->super_kobj, fsid_buf)) + if (kobject_rename(&root->fs_info->fs_devices->super_kobj, + fsid_buf)) goto error_trans; } |