diff options
author | Qu Wenruo <wqu@suse.com> | 2019-04-04 14:45:35 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-04-29 19:02:49 +0200 |
commit | 82fa113fccc41fe5204b4ce35341d69ebde0020f (patch) | |
tree | 535631ce2f5f8f56ebf7286e897727ab1d105598 /fs/btrfs/inode.c | |
parent | ddf30cf03fb53b9a0ad0f355a69dbedf416edde9 (diff) | |
download | linux-stable-82fa113fccc41fe5204b4ce35341d69ebde0020f.tar.gz linux-stable-82fa113fccc41fe5204b4ce35341d69ebde0020f.tar.bz2 linux-stable-82fa113fccc41fe5204b4ce35341d69ebde0020f.zip |
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/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 837fd573991a..9e736794a6a9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2519,6 +2519,7 @@ static noinline int relink_extent_backref(struct btrfs_path *path, struct btrfs_file_extent_item *item; struct btrfs_ordered_extent *ordered; struct btrfs_trans_handle *trans; + struct btrfs_ref ref = { 0 }; struct btrfs_root *root; struct btrfs_key key; struct extent_buffer *leaf; @@ -2689,10 +2690,11 @@ again: inode_add_bytes(inode, len); btrfs_release_path(path); - ret = btrfs_inc_extent_ref(trans, root, new->bytenr, - new->disk_len, 0, - backref->root_id, backref->inum, - new->file_pos); /* start - extent_offset */ + btrfs_init_generic_ref(&ref, BTRFS_ADD_DELAYED_REF, new->bytenr, + new->disk_len, 0); + btrfs_init_data_ref(&ref, backref->root_id, backref->inum, + new->file_pos); /* start - extent_offset */ + ret = btrfs_inc_extent_ref(trans, &ref); if (ret) { btrfs_abort_transaction(trans, ret); goto out_free_path; |