diff options
author | David Sterba <dsterba@suse.com> | 2025-06-10 14:17:55 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-07-21 23:58:01 +0200 |
commit | 55cd57faa5034674200aac4a91387c06c3f1170c (patch) | |
tree | e37adc448a3de29833d9cc7e9385f0b8b28992cc /fs/btrfs/subpage.c | |
parent | 89a3cc19e4e4158b3ffd746918227bc409f91e12 (diff) |
btrfs: use folio_end() where appropriate
Simplify folio_pos() + folio_size() and use the new helper.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/subpage.c')
-rw-r--r-- | fs/btrfs/subpage.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/subpage.c b/fs/btrfs/subpage.c index 9b63a4d1c989..2c5c9262b1a8 100644 --- a/fs/btrfs/subpage.c +++ b/fs/btrfs/subpage.c @@ -187,7 +187,7 @@ static void btrfs_subpage_assert(const struct btrfs_fs_info *fs_info, */ if (folio->mapping) ASSERT(folio_pos(folio) <= start && - start + len <= folio_pos(folio) + folio_size(folio)); + start + len <= folio_end(folio)); } #define subpage_calc_start_bit(fs_info, folio, name, start, len) \ @@ -216,8 +216,7 @@ static void btrfs_subpage_clamp_range(struct folio *folio, u64 *start, u32 *len) if (folio_pos(folio) >= orig_start + orig_len) *len = 0; else - *len = min_t(u64, folio_pos(folio) + folio_size(folio), - orig_start + orig_len) - *start; + *len = min_t(u64, folio_end(folio), orig_start + orig_len) - *start; } static bool btrfs_subpage_end_and_test_lock(const struct btrfs_fs_info *fs_info, |