diff options
author | Filipe Manana <fdmanana@suse.com> | 2023-03-21 11:13:53 +0000 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-04-17 18:01:19 +0200 |
commit | d1085c9c52855d307662f1a742e27787a732a6f1 (patch) | |
tree | 7d34b31f06e3084aa3e695c0421f21e55f8fbbd7 | |
parent | 007145ff644cc9a2b2b0c3c88ba68824274fcb12 (diff) | |
download | linux-stable-d1085c9c52855d307662f1a742e27787a732a6f1.tar.gz linux-stable-d1085c9c52855d307662f1a742e27787a732a6f1.tar.bz2 linux-stable-d1085c9c52855d307662f1a742e27787a732a6f1.zip |
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: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/fs.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h index 492436e1a59e..0ce43318ac0e 100644 --- a/fs/btrfs/fs.h +++ b/fs/btrfs/fs.h @@ -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 * 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) { 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, * Doing a truncate or a modification won't result in new nodes or leaves, just * 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) { return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * num_items; |