summaryrefslogtreecommitdiff
path: root/ctree.h
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2016-01-29 13:03:24 +0800
committerDavid Sterba <dsterba@suse.com>2016-06-07 18:15:19 +0200
commita21cc1ca3fcd685fe0a85d3d9b12d2d5cd72eb94 (patch)
tree9a8273d7e539325d34841ecc213671f3f6cc04cd /ctree.h
parentf5e77e4c520aa46583f7dd0f1d264ed93714acb2 (diff)
btrfs-progs: extent-tree: Enhance btrfs_record_file_extent
Btrfs_record_file_extent() has some small problems like: 1) Can't handle overlapping extents 2) May create extent larger than BTRFS_MAX_EXTENT_SIZE So enhance it using previously added facilites. This is used for later btrfs-convert, as for new convert, we create saved image first, then copy inode. Which will also cause extent overlapping. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'ctree.h')
-rw-r--r--ctree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ctree.h b/ctree.h
index 6dfd5113..cccbd5ba 100644
--- a/ctree.h
+++ b/ctree.h
@@ -578,6 +578,7 @@ struct btrfs_extent_item_v0 {
#define BTRFS_MAX_EXTENT_ITEM_SIZE(r) ((BTRFS_LEAF_DATA_SIZE(r) >> 4) - \
sizeof(struct btrfs_item))
+#define BTRFS_MAX_EXTENT_SIZE (128 * 1024 * 1024)
#define BTRFS_EXTENT_FLAG_DATA (1ULL << 0)
#define BTRFS_EXTENT_FLAG_TREE_BLOCK (1ULL << 1)