summaryrefslogtreecommitdiff
path: root/extent-tree.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2016-08-11 12:45:00 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2016-08-11 12:45:00 +0100
commitffd998be34a1a3d208106d051e85058ff9ac9667 (patch)
tree3f93a4a7362dcbdbadf5086e9404dc58ea22200a /extent-tree.c
parent3d69435ee3292b4b1db2d61c4784789d75883821 (diff)
Imported Upstream version 4.7
Diffstat (limited to 'extent-tree.c')
-rw-r--r--extent-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/extent-tree.c b/extent-tree.c
index 5ca53fa9..a58da237 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -3985,10 +3985,11 @@ static int __btrfs_record_file_extent(struct btrfs_trans_handle *trans,
u64 extent_offset;
u64 num_bytes = *ret_num_bytes;
- num_bytes = min_t(u64, num_bytes, BTRFS_MAX_EXTENT_SIZE);
/*
* All supported file system should not use its 0 extent.
* As it's for hole
+ *
+ * And hole extent has no size limit, no need to loop.
*/
if (disk_bytenr == 0) {
ret = btrfs_insert_file_extent(trans, root, objectid,
@@ -3996,6 +3997,7 @@ static int __btrfs_record_file_extent(struct btrfs_trans_handle *trans,
num_bytes, num_bytes);
return ret;
}
+ num_bytes = min_t(u64, num_bytes, BTRFS_MAX_EXTENT_SIZE);
path = btrfs_alloc_path();
if (!path)