* [PATCH] btrfs: make btrfs_free_log() and btrfs_free_log_root_tree() return void
@ 2026-03-24 15:03 fdmanana
2026-03-24 21:04 ` Qu Wenruo
0 siblings, 1 reply; 2+ messages in thread
From: fdmanana @ 2026-03-24 15:03 UTC (permalink / raw)
To: linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
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.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
fs/btrfs/tree-log.c | 8 +++-----
fs/btrfs/tree-log.h | 4 ++--
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index de4707b1227e..f883d9d979d4 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3681,25 +3681,23 @@ 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,
diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h
index 41e47fda036d..ad4e82e86bf9 100644
--- a/fs/btrfs/tree-log.h
+++ b/fs/btrfs/tree-log.h
@@ -71,8 +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,
+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,
--
2.47.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] btrfs: make btrfs_free_log() and btrfs_free_log_root_tree() return void
2026-03-24 15:03 [PATCH] btrfs: make btrfs_free_log() and btrfs_free_log_root_tree() return void fdmanana
@ 2026-03-24 21:04 ` Qu Wenruo
0 siblings, 0 replies; 2+ messages in thread
From: Qu Wenruo @ 2026-03-24 21:04 UTC (permalink / raw)
To: fdmanana, linux-btrfs
在 2026/3/25 01:33, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
>
> 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.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> fs/btrfs/tree-log.c | 8 +++-----
> fs/btrfs/tree-log.h | 4 ++--
> 2 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index de4707b1227e..f883d9d979d4 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
> @@ -3681,25 +3681,23 @@ 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,
> diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h
> index 41e47fda036d..ad4e82e86bf9 100644
> --- a/fs/btrfs/tree-log.h
> +++ b/fs/btrfs/tree-log.h
> @@ -71,8 +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,
> +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,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-24 21:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 15:03 [PATCH] btrfs: make btrfs_free_log() and btrfs_free_log_root_tree() return void fdmanana
2026-03-24 21:04 ` Qu Wenruo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox