From 797a937e5dd8db0092add633a80f3cd698e182df Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Fri, 6 Feb 2015 13:03:12 -0500 Subject: Btrfs-progs: Introduce metadump_v2 The METADUMP super flag makes us skip doing the chunk tree reading which isn't helpful for the new restore since we have a valid chunk tree. But we still want to have a way for the kernel to know that this is a metadump restore so it doesn't do things like verify data checksums. We also want to skip some of the device extent checks in fsck since those will obviously not match. Thanks, Signed-off-by: Josef Bacik --- btrfs-image.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'btrfs-image.c') diff --git a/btrfs-image.c b/btrfs-image.c index ea855425..feb4a620 100644 --- a/btrfs-image.c +++ b/btrfs-image.c @@ -1455,6 +1455,7 @@ static int update_super(struct mdrestore_struct *mdres, u8 *buffer) struct btrfs_chunk *chunk; struct btrfs_disk_key *disk_key; struct btrfs_key key; + u64 flags = btrfs_super_flags(super); u32 new_array_size = 0; u32 array_size; u32 cur = 0; @@ -1510,6 +1511,8 @@ static int update_super(struct mdrestore_struct *mdres, u8 *buffer) if (mdres->clear_space_cache) btrfs_set_super_cache_generation(super, 0); + flags |= BTRFS_SUPER_FLAG_METADUMP_V2; + btrfs_set_super_flags(super, flags); btrfs_set_super_sys_array_size(super, new_array_size); csum_block(buffer, BTRFS_SUPER_INFO_SIZE); -- cgit v1.2.3