diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index bb70db0c9df4..03fea037667e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -563,6 +563,7 @@ static int btrfs_truncate_in_trans(struct btrfs_trans_handle *trans, | |||
563 | u64 extent_num_bytes = 0; | 563 | u64 extent_num_bytes = 0; |
564 | u64 item_end = 0; | 564 | u64 item_end = 0; |
565 | u64 root_gen = 0; | 565 | u64 root_gen = 0; |
566 | u64 root_owner = 0; | ||
566 | int found_extent; | 567 | int found_extent; |
567 | int del_item; | 568 | int del_item; |
568 | int extent_type = -1; | 569 | int extent_type = -1; |
@@ -673,15 +674,8 @@ static int btrfs_truncate_in_trans(struct btrfs_trans_handle *trans, | |||
673 | found_extent = 1; | 674 | found_extent = 1; |
674 | inode->i_blocks -= num_dec; | 675 | inode->i_blocks -= num_dec; |
675 | } | 676 | } |
676 | if (leaf == root->node) { | 677 | root_gen = btrfs_header_generation(leaf); |
677 | root_gen = | 678 | root_owner = btrfs_header_owner(leaf); |
678 | btrfs_header_generation(leaf); | ||
679 | } else { | ||
680 | struct extent_buffer *parent; | ||
681 | parent = path->nodes[1]; | ||
682 | root_gen = | ||
683 | btrfs_header_generation(parent); | ||
684 | } | ||
685 | } | 679 | } |
686 | } else if (extent_type == BTRFS_FILE_EXTENT_INLINE && | 680 | } else if (extent_type == BTRFS_FILE_EXTENT_INLINE && |
687 | !del_item) { | 681 | !del_item) { |
@@ -703,7 +697,7 @@ delete: | |||
703 | if (found_extent) { | 697 | if (found_extent) { |
704 | ret = btrfs_free_extent(trans, root, extent_start, | 698 | ret = btrfs_free_extent(trans, root, extent_start, |
705 | extent_num_bytes, | 699 | extent_num_bytes, |
706 | root->root_key.objectid, | 700 | root_owner, |
707 | root_gen, inode->i_ino, | 701 | root_gen, inode->i_ino, |
708 | found_key.offset, 0); | 702 | found_key.offset, 0); |
709 | BUG_ON(ret); | 703 | BUG_ON(ret); |