Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] btrfs: use bool argument in free_root_pointers()
@ 2019-10-10  2:39 Anand Jain
  2019-10-10  2:42 ` Qu Wenruo
  2019-10-10 17:05 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Anand Jain @ 2019-10-10  2:39 UTC (permalink / raw)
  To: linux-btrfs

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(-)

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);
 
-- 
2.23.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: use bool argument in free_root_pointers()
  2019-10-10  2:39 [PATCH] btrfs: use bool argument in free_root_pointers() Anand Jain
@ 2019-10-10  2:42 ` Qu Wenruo
  2019-10-10 17:05 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2019-10-10  2:42 UTC (permalink / raw)
  To: Anand Jain, linux-btrfs

[-- Attachment #1.1: Type: text/plain, Size: 2325 bytes --]



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);
>  
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: use bool argument in free_root_pointers()
  2019-10-10  2:39 [PATCH] btrfs: use bool argument in free_root_pointers() Anand Jain
  2019-10-10  2:42 ` Qu Wenruo
@ 2019-10-10 17:05 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2019-10-10 17:05 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10  2:39 [PATCH] btrfs: use bool argument in free_root_pointers() Anand Jain
2019-10-10  2:42 ` Qu Wenruo
2019-10-10 17:05 ` David Sterba

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox