btrfs: use bool argument in free_root_pointers()
authorAnand Jain <anand.jain@oracle.com>
Thu, 10 Oct 2019 02:39:25 +0000 (10:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2020 21:32:19 +0000 (16:32 -0500)
[ Upstream commit 4273eaff9b8d5e141113a5bdf9628c02acf3afe5 ]

We don't need int argument bool shall do in free_root_pointers().  And
rename the argument as it confused two people.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/disk-io.c

index a8ea56218d6b6a5d89a06b3c656fcf9fee9708e7..e5b0a027c213cfbb0e8e592ea498d0671f4f677c 100644 (file)
@@ -2051,7 +2051,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);
 
@@ -2060,7 +2060,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);
 }
@@ -3069,7 +3069,7 @@ fail_block_groups:
        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:
@@ -3097,7 +3097,7 @@ recovery_tree_root:
        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);
@@ -3764,7 +3764,7 @@ void 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);