From: Anand Jain Date: Mon, 31 Jul 2023 11:16:33 +0000 (+0800) Subject: btrfs: simplify memcpy either of metadata_uuid or fsid X-Git-Tag: v6.6.17~3697^2~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=319baafcef2e075f515fce6a89e833f7aeae8484;p=platform%2Fkernel%2Flinux-rpi.git 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: Johannes Thumshirn Tested-by: Guilherme G. Piccoli Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 2669206..7338421 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -841,15 +841,8 @@ static noinline struct btrfs_device *device_list_add(const char *path, found_transid > fs_devices->latest_generation) { memcpy(fs_devices->fsid, disk_super->fsid, BTRFS_FSID_SIZE); - - if (has_metadata_uuid) - memcpy(fs_devices->metadata_uuid, - disk_super->metadata_uuid, - BTRFS_FSID_SIZE); - else - memcpy(fs_devices->metadata_uuid, - disk_super->fsid, BTRFS_FSID_SIZE); - + memcpy(fs_devices->metadata_uuid, + btrfs_sb_fsid_ptr(disk_super), BTRFS_FSID_SIZE); fs_devices->fsid_change = false; } }