summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>2026-02-10 16:19:46 +0300
committerDavid Sterba <dsterba@suse.com>2026-04-07 19:55:56 +0300
commit74e505fc89e2e6383b4f10f23318dfc3b62f70dc (patch)
treead0979347dbf95d02ddb1fb2375dfb6280f2e362
parent0eb6c12491ca44140a5facdaee3c8cb6f41202d2 (diff)
downloadlinux-74e505fc89e2e6383b4f10f23318dfc3b62f70dc.tar.xz
btrfs: change return type of cache_save_setup to void
None of the callers of `cache_save_setup` care about the return type as the space cache is purely and optimization. Also the free space cache is a deprecated feature that is being phased out. Change the return type of `cache_save_setup` to void to reflect this. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/block-group.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index d0d7051d4417..9f4db25f7b86 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -3323,9 +3323,9 @@ fail:
}
-static int cache_save_setup(struct btrfs_block_group *block_group,
- struct btrfs_trans_handle *trans,
- struct btrfs_path *path)
+static void cache_save_setup(struct btrfs_block_group *block_group,
+ struct btrfs_trans_handle *trans,
+ struct btrfs_path *path)
{
struct btrfs_fs_info *fs_info = block_group->fs_info;
struct inode *inode = NULL;
@@ -3337,7 +3337,7 @@ static int cache_save_setup(struct btrfs_block_group *block_group,
int ret = 0;
if (!btrfs_test_opt(fs_info, SPACE_CACHE))
- return 0;
+ return;
/*
* If this block group is smaller than 100 megs don't bother caching the
@@ -3347,11 +3347,11 @@ static int cache_save_setup(struct btrfs_block_group *block_group,
spin_lock(&block_group->lock);
block_group->disk_cache_state = BTRFS_DC_WRITTEN;
spin_unlock(&block_group->lock);
- return 0;
+ return;
}
if (TRANS_ABORTED(trans))
- return 0;
+ return;
again:
inode = lookup_free_space_inode(block_group, path);
if (IS_ERR(inode) && PTR_ERR(inode) != -ENOENT) {
@@ -3432,10 +3432,8 @@ again:
* We hit an ENOSPC when setting up the cache in this transaction, just
* skip doing the setup, we've already cleared the cache so we're safe.
*/
- if (test_bit(BTRFS_TRANS_CACHE_ENOSPC, &trans->transaction->flags)) {
- ret = -ENOSPC;
+ if (test_bit(BTRFS_TRANS_CACHE_ENOSPC, &trans->transaction->flags))
goto out_put;
- }
/*
* Try to preallocate enough space based on how big the block group is.
@@ -3483,7 +3481,6 @@ out:
spin_unlock(&block_group->lock);
extent_changeset_free(data_reserved);
- return ret;
}
int btrfs_setup_space_cache(struct btrfs_trans_handle *trans)