aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index e0201c3a7dc9..be4fc30a30e4 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -442,7 +442,8 @@ insert:
442 442
443 fi = (struct btrfs_file_extent_item *)dst_ptr; 443 fi = (struct btrfs_file_extent_item *)dst_ptr;
444 extent_type = btrfs_file_extent_type(path->nodes[0], fi); 444 extent_type = btrfs_file_extent_type(path->nodes[0], fi);
445 if (extent_type == BTRFS_FILE_EXTENT_REG) { 445 if (extent_type == BTRFS_FILE_EXTENT_REG ||
446 extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
446 struct btrfs_key ins; 447 struct btrfs_key ins;
447 ins.objectid = btrfs_file_extent_disk_bytenr( 448 ins.objectid = btrfs_file_extent_disk_bytenr(
448 path->nodes[0], fi); 449 path->nodes[0], fi);
@@ -538,7 +539,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
538 item = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item); 539 item = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item);
539 found_type = btrfs_file_extent_type(eb, item); 540 found_type = btrfs_file_extent_type(eb, item);
540 541
541 if (found_type == BTRFS_FILE_EXTENT_REG) 542 if (found_type == BTRFS_FILE_EXTENT_REG ||
543 found_type == BTRFS_FILE_EXTENT_PREALLOC)
542 extent_end = start + btrfs_file_extent_num_bytes(eb, item); 544 extent_end = start + btrfs_file_extent_num_bytes(eb, item);
543 else if (found_type == BTRFS_FILE_EXTENT_INLINE) { 545 else if (found_type == BTRFS_FILE_EXTENT_INLINE) {
544 size = btrfs_file_extent_inline_len(eb, item); 546 size = btrfs_file_extent_inline_len(eb, item);
@@ -562,7 +564,9 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
562 ret = btrfs_lookup_file_extent(trans, root, path, inode->i_ino, 564 ret = btrfs_lookup_file_extent(trans, root, path, inode->i_ino,
563 start, 0); 565 start, 0);
564 566
565 if (ret == 0 && found_type == BTRFS_FILE_EXTENT_REG) { 567 if (ret == 0 &&
568 (found_type == BTRFS_FILE_EXTENT_REG ||
569 found_type == BTRFS_FILE_EXTENT_PREALLOC)) {
566 struct btrfs_file_extent_item cmp1; 570 struct btrfs_file_extent_item cmp1;
567 struct btrfs_file_extent_item cmp2; 571 struct btrfs_file_extent_item cmp2;
568 struct btrfs_file_extent_item *existing; 572 struct btrfs_file_extent_item *existing;
@@ -2522,7 +2526,8 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
2522 struct btrfs_file_extent_item); 2526 struct btrfs_file_extent_item);
2523 2527
2524 found_type = btrfs_file_extent_type(src, extent); 2528 found_type = btrfs_file_extent_type(src, extent);
2525 if (found_type == BTRFS_FILE_EXTENT_REG) { 2529 if (found_type == BTRFS_FILE_EXTENT_REG ||
2530 found_type == BTRFS_FILE_EXTENT_PREALLOC) {
2526 u64 ds = btrfs_file_extent_disk_bytenr(src, 2531 u64 ds = btrfs_file_extent_disk_bytenr(src,
2527 extent); 2532 extent);
2528 u64 dl = btrfs_file_extent_disk_num_bytes(src, 2533 u64 dl = btrfs_file_extent_disk_num_bytes(src,