Skip to content

Commit 319baaf

Browse files
asjkdave
authored andcommitted
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 <[email protected]> Tested-by: Guilherme G. Piccoli <[email protected]> Signed-off-by: Anand Jain <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 4844c36 commit 319baaf

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

fs/btrfs/volumes.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -841,15 +841,8 @@ static noinline struct btrfs_device *device_list_add(const char *path,
841841
found_transid > fs_devices->latest_generation) {
842842
memcpy(fs_devices->fsid, disk_super->fsid,
843843
BTRFS_FSID_SIZE);
844-
845-
if (has_metadata_uuid)
846-
memcpy(fs_devices->metadata_uuid,
847-
disk_super->metadata_uuid,
848-
BTRFS_FSID_SIZE);
849-
else
850-
memcpy(fs_devices->metadata_uuid,
851-
disk_super->fsid, BTRFS_FSID_SIZE);
852-
844+
memcpy(fs_devices->metadata_uuid,
845+
btrfs_sb_fsid_ptr(disk_super), BTRFS_FSID_SIZE);
853846
fs_devices->fsid_change = false;
854847
}
855848
}

0 commit comments

Comments
 (0)