diff options
author | Josef Bacik <josef@toxicpanda.com> | 2019-08-22 15:14:33 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 14:59:13 +0200 |
commit | 2bd36e7b4fd60d4ff5f9ba6a0ad84557ae4803c4 (patch) | |
tree | 092a2fb134a8cb3387df0bde272d631aa8fd3e21 /fs/btrfs/file.c | |
parent | 0785a9aacf9de9cd6a89a628b3b5d6b7e9ce5316 (diff) |
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/file.c')
-rw-r--r-- | fs/btrfs/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index b31991f0f440..1cb694c96500 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2511,7 +2511,7 @@ int btrfs_punch_hole_range(struct inode *inode, struct btrfs_path *path, struct btrfs_trans_handle **trans_out) { struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); - u64 min_size = btrfs_calc_trans_metadata_size(fs_info, 1); + u64 min_size = btrfs_calc_insert_metadata_size(fs_info, 1); u64 ino_size = round_up(inode->i_size, fs_info->sectorsize); struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_trans_handle *trans = NULL; @@ -2530,7 +2530,7 @@ int btrfs_punch_hole_range(struct inode *inode, struct btrfs_path *path, ret = -ENOMEM; goto out; } - rsv->size = btrfs_calc_trans_metadata_size(fs_info, 1); + rsv->size = btrfs_calc_insert_metadata_size(fs_info, 1); rsv->failfast = 1; /* |