summaryrefslogtreecommitdiff
path: root/fs/btrfs/space-info.h
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2023-09-08 20:20:20 +0300
committerDavid Sterba <dsterba@suse.com>2023-10-12 17:44:05 +0300
commit03551d651e9d8ff5b310f9038581b2b030daeb87 (patch)
treebffe565c1936e8c6a1c4837a07bb956fbf1484d9 /fs/btrfs/space-info.h
parent9fb2acc2fe07f15b6cfe94a4bf910d3dfcd6e127 (diff)
downloadlinux-03551d651e9d8ff5b310f9038581b2b030daeb87.tar.xz
btrfs: pass a space_info argument to btrfs_reserve_metadata_bytes()
We are passing a block reserve argument to btrfs_reserve_metadata_bytes() which is not really used, all we need is to pass the space_info associated to the block reserve, we don't change the block reserve at all. Not only it's pointless to pass the block reserve, it's also confusing as one might think that the reserved bytes will end up being added to the passed block reserve, when that's not the case. The pattern for reserving space and adding it to a block reserve is to first reserve space with btrfs_reserve_metadata_bytes() and if that succeeds, then add the space to a block reserve by calling btrfs_block_rsv_add_bytes(). Also the reverse of btrfs_reserve_metadata_bytes(), which is btrfs_space_info_free_bytes_may_use(), takes a space_info argument and not a block reserve, so one more reason to pass a space_info and not a block reserve to btrfs_reserve_metadata_bytes(). So change btrfs_reserve_metadata_bytes() and its callers to pass a space_info argument instead of a block reserve argument. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/space-info.h')
-rw-r--r--fs/btrfs/space-info.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/space-info.h b/fs/btrfs/space-info.h
index ac0ce83f1477..92c595fed1b0 100644
--- a/fs/btrfs/space-info.h
+++ b/fs/btrfs/space-info.h
@@ -213,7 +213,7 @@ void btrfs_dump_space_info(struct btrfs_fs_info *fs_info,
struct btrfs_space_info *info, u64 bytes,
int dump_block_groups);
int btrfs_reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
- struct btrfs_block_rsv *block_rsv,
+ struct btrfs_space_info *space_info,
u64 orig_bytes,
enum btrfs_reserve_flush_enum flush);
void btrfs_try_granting_tickets(struct btrfs_fs_info *fs_info,