Commit 319baafc authored by Anand Jain's avatar Anand Jain Committed by David Sterba
Browse files

btrfs: simplify memcpy either of metadata_uuid or fsid



There is a helper which provides either metadata_uuid or fsid as per
METADATA_UUID flag. So use it.

Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tested-by: default avatarGuilherme G. Piccoli <gpiccoli@igalia.com>
Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 4844c366
Loading
Loading
Loading
Loading
+2 −9
Original line number Original line Diff line number Diff line
@@ -841,15 +841,8 @@ static noinline struct btrfs_device *device_list_add(const char *path,
		    found_transid > fs_devices->latest_generation) {
		    found_transid > fs_devices->latest_generation) {
			memcpy(fs_devices->fsid, disk_super->fsid,
			memcpy(fs_devices->fsid, disk_super->fsid,
					BTRFS_FSID_SIZE);
					BTRFS_FSID_SIZE);

			if (has_metadata_uuid)
			memcpy(fs_devices->metadata_uuid,
			memcpy(fs_devices->metadata_uuid,
				       disk_super->metadata_uuid,
			       btrfs_sb_fsid_ptr(disk_super), BTRFS_FSID_SIZE);
				       BTRFS_FSID_SIZE);
			else
				memcpy(fs_devices->metadata_uuid,
				       disk_super->fsid, BTRFS_FSID_SIZE);

			fs_devices->fsid_change = false;
			fs_devices->fsid_change = false;
		}
		}
	}
	}