diff options
author | Nikolay Borisov <nborisov@suse.com> | 2020-06-03 08:55:02 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-07-27 12:55:25 +0200 |
commit | 43c69849ae78d83adc2a9ed077bc4c6353b09bc5 (patch) | |
tree | f40434116563754c2fb75ac6dec03370c07597a3 /fs/btrfs | |
parent | da69fea9f785d8460059dd1ff8d654cea22e26df (diff) | |
download | linux-43c69849ae78d83adc2a9ed077bc4c6353b09bc5.tar.bz2 |
btrfs: make get_extent_allocation_hint take btrfs_inode
It doesn't use the vfs inode for anything, can just as easily take
btrfs_inode. Follow up patches will convert callers as well.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index cdd9872b66f8..690549dc4073 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -929,10 +929,10 @@ out_free: goto again; } -static u64 get_extent_allocation_hint(struct inode *inode, u64 start, +static u64 get_extent_allocation_hint(struct btrfs_inode *inode, u64 start, u64 num_bytes) { - struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; + struct extent_map_tree *em_tree = &inode->extent_tree; struct extent_map *em; u64 alloc_hint = 0; @@ -1032,7 +1032,8 @@ static noinline int cow_file_range(struct inode *inode, } } - alloc_hint = get_extent_allocation_hint(inode, start, num_bytes); + alloc_hint = get_extent_allocation_hint(BTRFS_I(inode), start, + num_bytes); btrfs_drop_extent_cache(BTRFS_I(inode), start, start + num_bytes - 1, 0); @@ -6893,7 +6894,7 @@ static struct extent_map *btrfs_new_extent_direct(struct inode *inode, u64 alloc_hint; int ret; - alloc_hint = get_extent_allocation_hint(inode, start, len); + alloc_hint = get_extent_allocation_hint(BTRFS_I(inode), start, len); ret = btrfs_reserve_extent(root, len, len, fs_info->sectorsize, 0, alloc_hint, &ins, 1, 1); if (ret) |