Skip to content

Commit 549a88a

Browse files
committed
btrfs: change return type to bool type of check_eb_alignment()
The check function pattern is supposed to return true/false, currently there's only one error code. Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent a43caf8 commit 549a88a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

fs/btrfs/extent_io.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,37 +2846,39 @@ static struct extent_buffer *grab_extent_buffer(struct btrfs_fs_info *fs_info,
28462846
return NULL;
28472847
}
28482848

2849-
static int check_eb_alignment(struct btrfs_fs_info *fs_info, u64 start)
2849+
/*
2850+
* Validate alignment constraints of eb at logical address @start.
2851+
*/
2852+
static bool check_eb_alignment(struct btrfs_fs_info *fs_info, u64 start)
28502853
{
28512854
if (!IS_ALIGNED(start, fs_info->sectorsize)) {
28522855
btrfs_err(fs_info, "bad tree block start %llu", start);
2853-
return -EINVAL;
2856+
return true;
28542857
}
28552858

28562859
if (fs_info->nodesize < PAGE_SIZE &&
28572860
offset_in_page(start) + fs_info->nodesize > PAGE_SIZE) {
28582861
btrfs_err(fs_info,
28592862
"tree block crosses page boundary, start %llu nodesize %u",
28602863
start, fs_info->nodesize);
2861-
return -EINVAL;
2864+
return true;
28622865
}
28632866
if (fs_info->nodesize >= PAGE_SIZE &&
28642867
!PAGE_ALIGNED(start)) {
28652868
btrfs_err(fs_info,
28662869
"tree block is not page aligned, start %llu nodesize %u",
28672870
start, fs_info->nodesize);
2868-
return -EINVAL;
2871+
return true;
28692872
}
28702873
if (!IS_ALIGNED(start, fs_info->nodesize) &&
28712874
!test_and_set_bit(BTRFS_FS_UNALIGNED_TREE_BLOCK, &fs_info->flags)) {
28722875
btrfs_warn(fs_info,
28732876
"tree block not nodesize aligned, start %llu nodesize %u, can be resolved by a full metadata balance",
28742877
start, fs_info->nodesize);
28752878
}
2876-
return 0;
2879+
return false;
28772880
}
28782881

2879-
28802882
/*
28812883
* Return 0 if eb->folios[i] is attached to btree inode successfully.
28822884
* Return >0 if there is already another extent buffer for the range,

0 commit comments

Comments
 (0)