]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
btrfs: merge calls to alloc_fs_devices in device_list_add
authorAnand Jain <anand.jain@oracle.com>
Wed, 24 May 2023 12:02:37 +0000 (20:02 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:29 +0000 (13:59 +0200)
Simplify has_metadata_uuid checks - by localizing the has_metadata_uuid
checked within alloc_fs_devices()'s second argument, it improves the
code readability.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c

index c98b45c350db915059a96e3bb89ef8745d1f49d8..de60a55dd7d3c5c6f56600ca7ebc952dbccc8fe0 100644 (file)
@@ -791,12 +791,8 @@ static noinline struct btrfs_device *device_list_add(const char *path,
 
 
        if (!fs_devices) {
-               if (has_metadata_uuid)
-                       fs_devices = alloc_fs_devices(disk_super->fsid,
-                                                     disk_super->metadata_uuid);
-               else
-                       fs_devices = alloc_fs_devices(disk_super->fsid, NULL);
-
+               fs_devices = alloc_fs_devices(disk_super->fsid,
+                               has_metadata_uuid ? disk_super->metadata_uuid : NULL);
                if (IS_ERR(fs_devices))
                        return ERR_CAST(fs_devices);