]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
btrfs: remove fsid argument from btrfs_sysfs_update_sprout_fsid
authorNikolay Borisov <nborisov@suse.com>
Wed, 12 Aug 2020 13:18:51 +0000 (16:18 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:06:50 +0000 (12:06 +0200)
It can be accessed from 'fs_devices' as it's identical to
fs_info->fs_devices. Also add a comment about why we are calling the
function. No semantic changes.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.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>
fs/btrfs/sysfs.c
fs/btrfs/sysfs.h
fs/btrfs/volumes.c

index 5be30066563c834a74aef42482b784c758065d16..d7c58c89fb9c1f19a67d11d5fd0226e518eb7773 100644 (file)
@@ -1328,8 +1328,8 @@ void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action)
                        &disk_to_dev(bdev->bd_disk)->kobj);
 }
 
-void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices,
-                                   const u8 *fsid)
+void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices)
+
 {
        char fsid_buf[BTRFS_UUID_UNPARSED_SIZE];
 
@@ -1337,7 +1337,7 @@ void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices,
         * Sprouting changes fsid of the mounted filesystem, rename the fsid
         * directory
         */
-       snprintf(fsid_buf, BTRFS_UUID_UNPARSED_SIZE, "%pU", fsid);
+       snprintf(fsid_buf, BTRFS_UUID_UNPARSED_SIZE, "%pU", fs_devices->fsid);
        if (kobject_rename(&fs_devices->fsid_kobj, fsid_buf))
                btrfs_warn(fs_devices->fs_info,
                                "sysfs: failed to create fsid for sprout");
index cf839c46a131bb44c75a86a6cd9f345f6b0b7a89..c9efa15f96e0da3bb9f9d792724a374f4eeef268 100644 (file)
@@ -20,8 +20,7 @@ int btrfs_sysfs_remove_devices_dir(struct btrfs_fs_devices *fs_devices,
                 struct btrfs_device *one_device);
 int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs);
 void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs);
-void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices,
-                                   const u8 *fsid);
+void btrfs_sysfs_update_sprout_fsid(struct btrfs_fs_devices *fs_devices);
 void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info,
                u64 bit, enum btrfs_feature_set set);
 void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action);
index 1997a7d67f22faa407162771143e111c091d6d7c..5d73c287314a8b3d3a06d728fdf7b205d8e3e563 100644 (file)
@@ -2645,8 +2645,11 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
                        goto error_sysfs;
                }
 
-               btrfs_sysfs_update_sprout_fsid(fs_devices,
-                               fs_info->fs_devices->fsid);
+               /*
+                * fs_devices now represents the newly sprouted filesystem and
+                * its fsid has been changed by btrfs_prepare_sprout
+                */
+               btrfs_sysfs_update_sprout_fsid(fs_devices);
        }
 
        ret = btrfs_commit_transaction(trans);