]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: make btrfs_free_log() and btrfs_free_log_root_tree() return void
authorFilipe Manana <fdmanana@suse.com>
Tue, 24 Mar 2026 15:01:34 +0000 (15:01 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:56:06 +0000 (18:56 +0200)
These functions never fail, always return success (0) and none of the
callers care about their return values. Change their return type from int
to void.

Reviewed-by: Qu Wenruo <wqu@suse.com>
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/tree-log.c
fs/btrfs/tree-log.h

index de4707b1227efd81e1014e0dc416ad1b081abf7e..aa84649f63c29ab8aa51429efbe11acf3e21d196 100644 (file)
@@ -3681,25 +3681,22 @@ static void free_log_tree(struct btrfs_trans_handle *trans,
  * free all the extents used by the tree log.  This should be called
  * at commit time of the full transaction
  */
-int btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root)
+void btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root)
 {
        if (root->log_root) {
                free_log_tree(trans, root->log_root);
                root->log_root = NULL;
                clear_bit(BTRFS_ROOT_HAS_LOG_TREE, &root->state);
        }
-       return 0;
 }
 
-int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans,
-                            struct btrfs_fs_info *fs_info)
+void btrfs_free_log_root_tree(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info)
 {
        if (fs_info->log_root_tree) {
                free_log_tree(trans, fs_info->log_root_tree);
                fs_info->log_root_tree = NULL;
                clear_bit(BTRFS_ROOT_HAS_LOG_TREE, &fs_info->tree_root->state);
        }
-       return 0;
 }
 
 static bool mark_inode_as_not_logged(const struct btrfs_trans_handle *trans,
index 41e47fda036dedcbbeb9bde4f7d59016d6b52f3f..4a626dc6a58b959fd6f9d7c97aa3d564c4fa1203 100644 (file)
@@ -71,9 +71,8 @@ static inline int btrfs_need_log_full_commit(struct btrfs_trans_handle *trans)
 
 int btrfs_sync_log(struct btrfs_trans_handle *trans,
                   struct btrfs_root *root, struct btrfs_log_ctx *ctx);
-int btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root);
-int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans,
-                            struct btrfs_fs_info *fs_info);
+void btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root);
+void btrfs_free_log_root_tree(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info);
 int btrfs_recover_log_trees(struct btrfs_root *tree_root);
 int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans,
                          struct dentry *dentry,