aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/subpage.c
diff options
context:
space:
mode:
authorDavid Sterba <[email protected]>2025-06-10 12:17:55 +0000
committerDavid Sterba <[email protected]>2025-07-21 21:58:01 +0000
commit55cd57faa5034674200aac4a91387c06c3f1170c (patch)
treee37adc448a3de29833d9cc7e9385f0b8b28992cc /fs/btrfs/subpage.c
parentbtrfs: add helper folio_end() (diff)
downloadkernel-55cd57faa5034674200aac4a91387c06c3f1170c.tar.gz
kernel-55cd57faa5034674200aac4a91387c06c3f1170c.zip
btrfs: use folio_end() where appropriate
Simplify folio_pos() + folio_size() and use the new helper. Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/subpage.c')
-rw-r--r--fs/btrfs/subpage.c5
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,