btrfs-progs: make btrfs-image restore to support dup
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>
Thu, 26 May 2016 09:43:00 +0000 (17:43 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 1 Jun 2016 12:56:56 +0000 (14:56 +0200)
commit9088ab6a10679eccb70255d0bf5c7e31fbbb8c97
tree71132b4fd1cff0796aa7bb7f671fd97a6df5a9d0
parent0993ae5a73d5d0709b543faa0c528931a0f7fc36
btrfs-progs: make btrfs-image restore to support dup

Previously btrfs-image restore would set the chunk items to have 1 stripe,
even if the chunk is dup. If you use btrfsck on the restored file system,
some dev_extent will not find any relative chunk stripe, and the
bytes-used of dev_item will not equal to the dev_extents's total_bytes.
This patch store a additional physical just for the dup case when build
the in-memory chunk-tree.
Currently btrfsck on the restored file system, only single and dup is no
problem. raid* support should be added in the future.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-image.c