mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
btrfs: remove fs_info argument from btrfs_can_overcommit()
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>
This commit is contained in:
parent
302b4b69c4
commit
78a77f4da4
|
|
@ -1403,8 +1403,7 @@ static int inc_block_group_ro(struct btrfs_block_group *cache, bool force)
|
|||
* BTRFS_RESERVE_NO_FLUSH to give ourselves the most amount of
|
||||
* leeway to allow us to mark this block group as read only.
|
||||
*/
|
||||
if (btrfs_can_overcommit(cache->fs_info, sinfo, num_bytes,
|
||||
BTRFS_RESERVE_NO_FLUSH))
|
||||
if (btrfs_can_overcommit(sinfo, num_bytes, BTRFS_RESERVE_NO_FLUSH))
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -490,8 +490,7 @@ static u64 calc_available_free_space(const struct btrfs_space_info *space_info,
|
|||
return avail;
|
||||
}
|
||||
|
||||
int btrfs_can_overcommit(struct btrfs_fs_info *fs_info,
|
||||
const struct btrfs_space_info *space_info, u64 bytes,
|
||||
int btrfs_can_overcommit(const struct btrfs_space_info *space_info, u64 bytes,
|
||||
enum btrfs_reserve_flush_enum flush)
|
||||
{
|
||||
u64 avail;
|
||||
|
|
@ -525,7 +524,6 @@ static void remove_ticket(struct btrfs_space_info *space_info,
|
|||
*/
|
||||
void btrfs_try_granting_tickets(struct btrfs_space_info *space_info)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = space_info->fs_info;
|
||||
struct list_head *head;
|
||||
enum btrfs_reserve_flush_enum flush = BTRFS_RESERVE_NO_FLUSH;
|
||||
|
||||
|
|
@ -541,8 +539,7 @@ void btrfs_try_granting_tickets(struct btrfs_space_info *space_info)
|
|||
|
||||
/* Check and see if our ticket can be satisfied now. */
|
||||
if ((used + ticket->bytes <= space_info->total_bytes) ||
|
||||
btrfs_can_overcommit(fs_info, space_info, ticket->bytes,
|
||||
flush)) {
|
||||
btrfs_can_overcommit(space_info, ticket->bytes, flush)) {
|
||||
btrfs_space_info_update_bytes_may_use(space_info, ticket->bytes);
|
||||
remove_ticket(space_info, ticket);
|
||||
ticket->bytes = 0;
|
||||
|
|
@ -1775,7 +1772,7 @@ static int __reserve_bytes(struct btrfs_fs_info *fs_info,
|
|||
*/
|
||||
if (!pending_tickets &&
|
||||
((used + orig_bytes <= space_info->total_bytes) ||
|
||||
btrfs_can_overcommit(fs_info, space_info, orig_bytes, flush))) {
|
||||
btrfs_can_overcommit(space_info, orig_bytes, flush))) {
|
||||
btrfs_space_info_update_bytes_may_use(space_info, orig_bytes);
|
||||
ret = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -284,8 +284,7 @@ int btrfs_reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
|
|||
u64 orig_bytes,
|
||||
enum btrfs_reserve_flush_enum flush);
|
||||
void btrfs_try_granting_tickets(struct btrfs_space_info *space_info);
|
||||
int btrfs_can_overcommit(struct btrfs_fs_info *fs_info,
|
||||
const struct btrfs_space_info *space_info, u64 bytes,
|
||||
int btrfs_can_overcommit(const struct btrfs_space_info *space_info, u64 bytes,
|
||||
enum btrfs_reserve_flush_enum flush);
|
||||
|
||||
static inline void btrfs_space_info_free_bytes_may_use(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user