btrfs-progs: update btrfs_leaf_free_space to match the kernel

In the kernel we have const struct extent_buffer instead of struct
extent_buffer, update this to make it more straightforward to sync
ctree.c.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2023-08-23 10:32:59 -04:00 committed by David Sterba
parent fbaff3b121
commit 909bde13f4
2 changed files with 3 additions and 3 deletions

View File

@ -1857,7 +1857,7 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
* and nr indicate which items in the leaf to check. This totals up the
* space used both by the item structs and the item data
*/
static int leaf_space_used(struct extent_buffer *l, int start, int nr)
static int leaf_space_used(const struct extent_buffer *l, int start, int nr)
{
int data_len;
int nritems = btrfs_header_nritems(l);
@ -1877,7 +1877,7 @@ static int leaf_space_used(struct extent_buffer *l, int start, int nr)
* the start of the leaf data. IOW, how much room
* the leaf has left for both items and data
*/
int btrfs_leaf_free_space(struct extent_buffer *leaf)
int btrfs_leaf_free_space(const struct extent_buffer *leaf)
{
int nritems = btrfs_header_nritems(leaf);
u32 leaf_data_size;

View File

@ -1089,7 +1089,7 @@ static inline int btrfs_next_item(struct btrfs_root *root,
}
int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path);
int btrfs_leaf_free_space(struct extent_buffer *leaf);
int btrfs_leaf_free_space(const struct extent_buffer *leaf);
void btrfs_set_item_key_safe(struct btrfs_fs_info *fs_info,
struct btrfs_path *path,
const struct btrfs_key *new_key);