mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 05:22:19 -04:00
btrfs: use folio_next_index() helper in check_range_has_page()
Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using the existing helper folio_next_index(). Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
23a6abdada
commit
c9da22428e
@@ -2194,7 +2194,7 @@ static bool check_range_has_page(struct inode *inode, u64 start, u64 end)
|
||||
if (folio->index < start_index)
|
||||
continue;
|
||||
/* A large folio extends beyond the end. Not a target. */
|
||||
if (folio->index + folio_nr_pages(folio) > end_index)
|
||||
if (folio_next_index(folio) > end_index)
|
||||
continue;
|
||||
/* A folio doesn't cover the head/tail index. Found a target. */
|
||||
ret = true;
|
||||
|
||||
Reference in New Issue
Block a user