diff options
author | Josef Bacik <josef@toxicpanda.com> | 2019-08-22 21:14:33 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 14:59:13 +0200 |
commit | 2bd36e7b4fd60d4ff5f9ba6a0ad84557ae4803c4 (patch) | |
tree | 092a2fb134a8cb3387df0bde272d631aa8fd3e21 /fs/btrfs/inode.c | |
parent | btrfs: tree-checker: Add EXTENT_DATA_REF check (diff) | |
download | linux-2bd36e7b4fd60d4ff5f9ba6a0ad84557ae4803c4.tar.xz linux-2bd36e7b4fd60d4ff5f9ba6a0ad84557ae4803c4.zip |
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/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c4116bc58827..31eacbf51d4e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5337,7 +5337,7 @@ static struct btrfs_trans_handle *evict_refill_and_join(struct btrfs_root *root, struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_block_rsv *global_rsv = &fs_info->global_block_rsv; struct btrfs_trans_handle *trans; - u64 delayed_refs_extra = btrfs_calc_trans_metadata_size(fs_info, 1); + u64 delayed_refs_extra = btrfs_calc_insert_metadata_size(fs_info, 1); int ret; /* @@ -5426,7 +5426,7 @@ void btrfs_evict_inode(struct inode *inode) rsv = btrfs_alloc_block_rsv(fs_info, BTRFS_BLOCK_RSV_TEMP); if (!rsv) goto no_delete; - rsv->size = btrfs_calc_trunc_metadata_size(fs_info, 1); + rsv->size = btrfs_calc_metadata_size(fs_info, 1); rsv->failfast = 1; btrfs_i_size_write(BTRFS_I(inode), 0); @@ -9040,7 +9040,7 @@ static int btrfs_truncate(struct inode *inode, bool skip_writeback) int ret; struct btrfs_trans_handle *trans; u64 mask = fs_info->sectorsize - 1; - u64 min_size = btrfs_calc_trunc_metadata_size(fs_info, 1); + u64 min_size = btrfs_calc_metadata_size(fs_info, 1); if (!skip_writeback) { ret = btrfs_wait_ordered_range(inode, inode->i_size & (~mask), |