btrfs: use bool argument in free_root_pointers()
diff mbox series

Message ID 20191010023925.4844-1-anand.jain@oracle.com
State New
Headers show
Series
  • btrfs: use bool argument in free_root_pointers()
Related show

Commit Message

Anand Jain Oct. 10, 2019, 2:39 a.m. UTC
We don't need int argument bool shall do in free_root_pointers().
And rename the argument as it confused two people.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/disk-io.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Qu Wenruo Oct. 10, 2019, 2:42 a.m. UTC | #1
On 2019/10/10 上午10:39, Anand Jain wrote:
> We don't need int argument bool shall do in free_root_pointers().
> And rename the argument as it confused two people.

Victim here. :)
Although it's mostly caused by my stupidness. :(
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>  fs/btrfs/disk-io.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index f314fa9fc06e..5a0033b6cf2e 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -2024,7 +2024,7 @@ static void free_root_extent_buffers(struct btrfs_root *root)
>  }
>  
>  /* helper to cleanup tree roots */
> -static void free_root_pointers(struct btrfs_fs_info *info, int chunk_root)
> +static void free_root_pointers(struct btrfs_fs_info *info, bool free_chunk_root)
>  {
>  	free_root_extent_buffers(info->tree_root);
>  
> @@ -2033,7 +2033,7 @@ static void free_root_pointers(struct btrfs_fs_info *info, int chunk_root)
>  	free_root_extent_buffers(info->csum_root);
>  	free_root_extent_buffers(info->quota_root);
>  	free_root_extent_buffers(info->uuid_root);
> -	if (chunk_root)
> +	if (free_chunk_root)
>  		free_root_extent_buffers(info->chunk_root);
>  	free_root_extent_buffers(info->free_space_root);
>  }
> @@ -3327,7 +3327,7 @@ int __cold open_ctree(struct super_block *sb,
>  	btrfs_put_block_group_cache(fs_info);
>  
>  fail_tree_roots:
> -	free_root_pointers(fs_info, 1);
> +	free_root_pointers(fs_info, true);
>  	invalidate_inode_pages2(fs_info->btree_inode->i_mapping);
>  
>  fail_sb_buffer:
> @@ -3359,7 +3359,7 @@ int __cold open_ctree(struct super_block *sb,
>  	if (!btrfs_test_opt(fs_info, USEBACKUPROOT))
>  		goto fail_tree_roots;
>  
> -	free_root_pointers(fs_info, 0);
> +	free_root_pointers(fs_info, false);
>  
>  	/* don't use the log in recovery mode, it won't be valid */
>  	btrfs_set_super_log_root(disk_super, 0);
> @@ -4053,7 +4053,7 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info)
>  	btrfs_free_block_groups(fs_info);
>  
>  	clear_bit(BTRFS_FS_OPEN, &fs_info->flags);
> -	free_root_pointers(fs_info, 1);
> +	free_root_pointers(fs_info, true);
>  
>  	iput(fs_info->btree_inode);
>  
>
David Sterba Oct. 10, 2019, 5:05 p.m. UTC | #2
On Thu, Oct 10, 2019 at 10:39:25AM +0800, Anand Jain wrote:
> We don't need int argument bool shall do in free_root_pointers().
> And rename the argument as it confused two people.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Added to misc-next, thanks.

Patch
diff mbox series

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index f314fa9fc06e..5a0033b6cf2e 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2024,7 +2024,7 @@  static void free_root_extent_buffers(struct btrfs_root *root)
 }
 
 /* helper to cleanup tree roots */
-static void free_root_pointers(struct btrfs_fs_info *info, int chunk_root)
+static void free_root_pointers(struct btrfs_fs_info *info, bool free_chunk_root)
 {
 	free_root_extent_buffers(info->tree_root);
 
@@ -2033,7 +2033,7 @@  static void free_root_pointers(struct btrfs_fs_info *info, int chunk_root)
 	free_root_extent_buffers(info->csum_root);
 	free_root_extent_buffers(info->quota_root);
 	free_root_extent_buffers(info->uuid_root);
-	if (chunk_root)
+	if (free_chunk_root)
 		free_root_extent_buffers(info->chunk_root);
 	free_root_extent_buffers(info->free_space_root);
 }
@@ -3327,7 +3327,7 @@  int __cold open_ctree(struct super_block *sb,
 	btrfs_put_block_group_cache(fs_info);
 
 fail_tree_roots:
-	free_root_pointers(fs_info, 1);
+	free_root_pointers(fs_info, true);
 	invalidate_inode_pages2(fs_info->btree_inode->i_mapping);
 
 fail_sb_buffer:
@@ -3359,7 +3359,7 @@  int __cold open_ctree(struct super_block *sb,
 	if (!btrfs_test_opt(fs_info, USEBACKUPROOT))
 		goto fail_tree_roots;
 
-	free_root_pointers(fs_info, 0);
+	free_root_pointers(fs_info, false);
 
 	/* don't use the log in recovery mode, it won't be valid */
 	btrfs_set_super_log_root(disk_super, 0);
@@ -4053,7 +4053,7 @@  void __cold close_ctree(struct btrfs_fs_info *fs_info)
 	btrfs_free_block_groups(fs_info);
 
 	clear_bit(BTRFS_FS_OPEN, &fs_info->flags);
-	free_root_pointers(fs_info, 1);
+	free_root_pointers(fs_info, true);
 
 	iput(fs_info->btree_inode);