]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove fs_info argument from __reserve_bytes()
authorFilipe Manana <fdmanana@suse.com>
Mon, 13 Oct 2025 17:23:27 +0000 (18:23 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 20:59:11 +0000 (21:59 +0100)
We don't need it since we can grab fs_info from the given space_info.
So remove the fs_info argument.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <asj@kernel.org>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c

index f01d083a444cdf8a5b603fee51422fac87b8b518..30f1c2d23fc6a3331e262b4dbb34ee580f78f16e 100644 (file)
@@ -1703,7 +1703,6 @@ static inline bool can_ticket(enum btrfs_reserve_flush_enum flush)
 /*
  * Try to reserve bytes from the block_rsv's space.
  *
- * @fs_info:    the filesystem
  * @space_info: space info we want to allocate from
  * @orig_bytes: number of bytes we want
  * @flush:      whether or not we can flush to make our reservation
@@ -1715,10 +1714,10 @@ static inline bool can_ticket(enum btrfs_reserve_flush_enum flush)
  * regain reservations will be made and this will fail if there is not enough
  * space already.
  */
-static int __reserve_bytes(struct btrfs_fs_info *fs_info,
-                          struct btrfs_space_info *space_info, u64 orig_bytes,
+static int __reserve_bytes(struct btrfs_space_info *space_info, u64 orig_bytes,
                           enum btrfs_reserve_flush_enum flush)
 {
+       struct btrfs_fs_info *fs_info = space_info->fs_info;
        struct work_struct *async_work;
        struct reserve_ticket ticket;
        u64 start_ns = 0;
@@ -1868,7 +1867,7 @@ int btrfs_reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
 {
        int ret;
 
-       ret = __reserve_bytes(fs_info, space_info, orig_bytes, flush);
+       ret = __reserve_bytes(space_info, orig_bytes, flush);
        if (ret == -ENOSPC) {
                trace_btrfs_space_reservation(fs_info, "space_info:enospc",
                                              space_info->flags, orig_bytes, 1);
@@ -1900,7 +1899,7 @@ int btrfs_reserve_data_bytes(struct btrfs_space_info *space_info, u64 bytes,
               flush == BTRFS_RESERVE_NO_FLUSH);
        ASSERT(!current->journal_info || flush != BTRFS_RESERVE_FLUSH_DATA);
 
-       ret = __reserve_bytes(fs_info, space_info, bytes, flush);
+       ret = __reserve_bytes(space_info, bytes, flush);
        if (ret == -ENOSPC) {
                trace_btrfs_space_reservation(fs_info, "space_info:enospc",
                                              space_info->flags, bytes, 1);