diff options
author | Nikolay Borisov <nborisov@suse.com> | 2020-07-15 13:48:49 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-10-07 12:06:58 +0200 |
commit | c4989c2fd0eba6e164e9a29c4a865e57dd644451 (patch) | |
tree | 9c2fd2baeeaa4fbc7e69bd22d05e18f90ab19efd /fs/btrfs/sysfs.c | |
parent | 54eed6ae8d8e9df81202da64f0817d8e40d5db0e (diff) | |
download | linux-c4989c2fd0eba6e164e9a29c4a865e57dd644451.tar.gz linux-c4989c2fd0eba6e164e9a29c4a865e57dd644451.tar.bz2 linux-c4989c2fd0eba6e164e9a29c4a865e57dd644451.zip |
btrfs: simplify setting/clearing fs_info to btrfs_fs_devices
It makes no sense to have sysfs-related routines be responsible for
properly initialising the fs_info pointer of struct btrfs_fs_device.
Instead this can be streamlined by making it the responsibility of
btrfs_init_devices_late to initialize it. That function already
initializes fs_info of every individual device in btrfs_fs_devices.
As far as clearing it is concerned it makes sense to move it to
close_fs_devices. That function is only called when struct
btrfs_fs_devices is no longer in use - either for holding seeds or
main devices for a mounted filesystem.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/sysfs.c')
-rw-r--r-- | fs/btrfs/sysfs.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 81496ac43d09..438a367371c4 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -939,8 +939,6 @@ void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info) { struct kobject *fsid_kobj = &fs_info->fs_devices->fsid_kobj; - btrfs_reset_fs_info_ptr(fs_info); - sysfs_remove_link(fsid_kobj, "bdi"); if (fs_info->space_info_kobj) { @@ -1404,8 +1402,6 @@ int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info) struct btrfs_fs_devices *fs_devs = fs_info->fs_devices; struct kobject *fsid_kobj = &fs_devs->fsid_kobj; - btrfs_set_fs_info_ptr(fs_info); - error = btrfs_sysfs_add_devices_dir(fs_devs, NULL); if (error) return error; |