Skip to content

Commit

Permalink
btrfs: return bool from check_tree_block_fsid instead of int
Browse files Browse the repository at this point in the history
Simplify the return type of check_tree_block_fsid() from int (1 or 0) to
bool. Its only user is interested in knowing the success or failure.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Anand Jain authored and David Sterba committed Jun 19, 2023
1 parent f62c302 commit 413fb1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ blk_status_t btree_csum_one_bio(struct btrfs_bio *bbio)
return errno_to_blk_status(ret);
}

static int check_tree_block_fsid(struct extent_buffer *eb)
static bool check_tree_block_fsid(struct extent_buffer *eb)
{
struct btrfs_fs_info *fs_info = eb->fs_info;
struct btrfs_fs_devices *fs_devices = fs_info->fs_devices, *seed_devs;
Expand All @@ -337,13 +337,13 @@ static int check_tree_block_fsid(struct extent_buffer *eb)
metadata_uuid = fs_devices->fsid;

if (!memcmp(fsid, metadata_uuid, BTRFS_FSID_SIZE))
return 0;
return false;

list_for_each_entry(seed_devs, &fs_devices->seed_list, seed_list)
if (!memcmp(fsid, seed_devs->fsid, BTRFS_FSID_SIZE))
return 0;
return false;

return 1;
return true;
}

/* Do basic extent buffer checks at read time */
Expand Down

0 comments on commit 413fb1b

Please sign in to comment.