Re: [PATCH v2.1 08/10] btrfs-progs: image: Introduce -d option to dump data

Anand Jain
2019-07-15T04:10:13Z

On 4/7/19 2:11 PM, Qu Wenruo wrote:
> static int copy_from_extent_tree(struct metadump_struct *metadump,
> - struct btrfs_path *path)
> + struct btrfs_path *path, bool dump_data)
> {
> struct btrfs_root *extent_root;
> struct extent_buffer *leaf;
> @@ -948,9 +960,15 @@ static int copy_from_extent_tree(struct metadump_struct *metadump,
> ei = btrfs_item_ptr(leaf, path->slots[0],
> struct btrfs_extent_item);
> if (btrfs_extent_flags(leaf, ei) &
> - BTRFS_EXTENT_FLAG_TREE_BLOCK) {
> + BTRFS_EXTENT_FLAG_TREE_BLOCK ||
> + btrfs_extent_flags(leaf, ei) &
> + BTRFS_EXTENT_FLAG_DATA) {
> + bool is_data;
> +
> + is_data = btrfs_extent_flags(leaf, ei) &
> + BTRFS_EXTENT_FLAG_DATA;
> ret = add_extent(bytenr, num_bytes, metadump,
> - 0);
> + is_data);

Both with and without -d option copies the data.
Should check dump_data.

Thanks, Anand