OSDN Git Service

btrfs: change return type to bool in btrfs_extent_readonly
authorAnand Jain <anand.jain@oracle.com>
Thu, 11 Feb 2021 05:25:16 +0000 (21:25 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Apr 2021 15:25:14 +0000 (17:25 +0200)
btrfs_extent_readonly() checks if the block group is readonly, the bool
return type should be used.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.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>
fs/btrfs/inode.c

index 988b53f..b6caa35 100644 (file)
@@ -7262,14 +7262,14 @@ static struct extent_map *btrfs_new_extent_direct(struct btrfs_inode *inode,
        return em;
 }
 
-static int btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr)
+static bool btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr)
 {
        struct btrfs_block_group *block_group;
-       int readonly = 0;
+       bool readonly = false;
 
        block_group = btrfs_lookup_block_group(fs_info, bytenr);
        if (!block_group || block_group->ro)
-               readonly = 1;
+               readonly = true;
        if (block_group)
                btrfs_put_block_group(block_group);
        return readonly;