Commit d1085c9c authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: constify fs_info argument of the metadata size calculation helpers

The fs_info argument of the helpers btrfs_calc_insert_metadata_size() and
btrfs_calc_metadata_size() is not modified so it can be const. This will
also allow a new helper function in one of the next patches to have its
fs_info argument as const.
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 007145ff
...@@ -822,7 +822,7 @@ static inline u64 btrfs_csum_bytes_to_leaves( ...@@ -822,7 +822,7 @@ static inline u64 btrfs_csum_bytes_to_leaves(
* Use this if we would be adding new items, as we could split nodes as we cow * Use this if we would be adding new items, as we could split nodes as we cow
* down the tree. * down the tree.
*/ */
static inline u64 btrfs_calc_insert_metadata_size(struct btrfs_fs_info *fs_info, static inline u64 btrfs_calc_insert_metadata_size(const struct btrfs_fs_info *fs_info,
unsigned num_items) unsigned num_items)
{ {
return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * 2 * num_items; return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * 2 * num_items;
...@@ -832,7 +832,7 @@ static inline u64 btrfs_calc_insert_metadata_size(struct btrfs_fs_info *fs_info, ...@@ -832,7 +832,7 @@ static inline u64 btrfs_calc_insert_metadata_size(struct btrfs_fs_info *fs_info,
* Doing a truncate or a modification won't result in new nodes or leaves, just * Doing a truncate or a modification won't result in new nodes or leaves, just
* what we need for COW. * what we need for COW.
*/ */
static inline u64 btrfs_calc_metadata_size(struct btrfs_fs_info *fs_info, static inline u64 btrfs_calc_metadata_size(const struct btrfs_fs_info *fs_info,
unsigned num_items) unsigned num_items)
{ {
return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * num_items; return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * num_items;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment