summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2019-04-04 02:45:35 -0400
committerDavid Sterba <dsterba@suse.com>2019-04-29 13:02:49 -0400
commit82fa113fccc41fe5204b4ce35341d69ebde0020f (patch)
tree535631ce2f5f8f56ebf7286e897727ab1d105598 /fs/btrfs/tree-log.c
parentddf30cf03fb53b9a0ad0f355a69dbedf416edde9 (diff)
btrfs: extent-tree: Use btrfs_ref to refactor btrfs_inc_extent_ref()
Use the new btrfs_ref structure and replace parameter list to clean up the usage of owner and level to distinguish the extent types. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 75a8e3c78fdb..b94a0cca4ecd 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -705,9 +705,11 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
705 goto out; 705 goto out;
706 706
707 if (ins.objectid > 0) { 707 if (ins.objectid > 0) {
708 struct btrfs_ref ref = { 0 };
708 u64 csum_start; 709 u64 csum_start;
709 u64 csum_end; 710 u64 csum_end;
710 LIST_HEAD(ordered_sums); 711 LIST_HEAD(ordered_sums);
712
711 /* 713 /*
712 * is this extent already allocated in the extent 714 * is this extent already allocated in the extent
713 * allocation tree? If so, just add a reference 715 * allocation tree? If so, just add a reference
@@ -715,10 +717,13 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
715 ret = btrfs_lookup_data_extent(fs_info, ins.objectid, 717 ret = btrfs_lookup_data_extent(fs_info, ins.objectid,
716 ins.offset); 718 ins.offset);
717 if (ret == 0) { 719 if (ret == 0) {
718 ret = btrfs_inc_extent_ref(trans, root, 720 btrfs_init_generic_ref(&ref,
719 ins.objectid, ins.offset, 721 BTRFS_ADD_DELAYED_REF,
720 0, root->root_key.objectid, 722 ins.objectid, ins.offset, 0);
723 btrfs_init_data_ref(&ref,
724 root->root_key.objectid,
721 key->objectid, offset); 725 key->objectid, offset);
726 ret = btrfs_inc_extent_ref(trans, &ref);
722 if (ret) 727 if (ret)
723 goto out; 728 goto out;
724 } else { 729 } else {