diff options
author | Josef Bacik <josef@toxicpanda.com> | 2019-08-22 22:14:33 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 15:59:13 +0300 |
commit | 2bd36e7b4fd60d4ff5f9ba6a0ad84557ae4803c4 (patch) | |
tree | 092a2fb134a8cb3387df0bde272d631aa8fd3e21 /fs/btrfs/delalloc-space.c | |
parent | 0785a9aacf9de9cd6a89a628b3b5d6b7e9ce5316 (diff) | |
download | linux-2bd36e7b4fd60d4ff5f9ba6a0ad84557ae4803c4.tar.xz |
btrfs: rename the btrfs_calc_*_metadata_size helpers
btrfs_calc_trunc_metadata_size differs from trans_metadata_size in that
it doesn't take into account any splitting at the levels, because
truncate will never split nodes. However truncate _and_ changing will
never split nodes, so rename btrfs_calc_trunc_metadata_size to
btrfs_calc_metadata_size. Also btrfs_calc_trans_metadata_size is purely
for inserting items, so rename this to btrfs_calc_insert_metadata_size.
Making these clearer will help when I start using them differently in
upcoming patches.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/delalloc-space.c')
-rw-r--r-- | fs/btrfs/delalloc-space.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/delalloc-space.c b/fs/btrfs/delalloc-space.c index d2dfc201b2e1..62aa18b38a08 100644 --- a/fs/btrfs/delalloc-space.c +++ b/fs/btrfs/delalloc-space.c @@ -256,12 +256,12 @@ static void btrfs_calculate_inode_block_rsv_size(struct btrfs_fs_info *fs_info, lockdep_assert_held(&inode->lock); outstanding_extents = inode->outstanding_extents; if (outstanding_extents) - reserve_size = btrfs_calc_trans_metadata_size(fs_info, + reserve_size = btrfs_calc_insert_metadata_size(fs_info, outstanding_extents + 1); csum_leaves = btrfs_csum_bytes_to_leaves(fs_info, inode->csum_bytes); - reserve_size += btrfs_calc_trans_metadata_size(fs_info, - csum_leaves); + reserve_size += btrfs_calc_insert_metadata_size(fs_info, + csum_leaves); /* * For qgroup rsv, the calculation is very simple: * account one nodesize for each outstanding extent @@ -284,7 +284,7 @@ static void calc_inode_reservations(struct btrfs_fs_info *fs_info, u64 csum_leaves = btrfs_csum_bytes_to_leaves(fs_info, num_bytes); /* We add one for the inode update at finish ordered time */ - *meta_reserve = btrfs_calc_trans_metadata_size(fs_info, + *meta_reserve = btrfs_calc_insert_metadata_size(fs_info, nr_extents + csum_leaves + 1); *qgroup_reserve = nr_extents * fs_info->nodesize; } |