From: Qianfeng Rong Date: Thu, 19 Jun 2025 10:15:01 +0000 (+0800) Subject: btrfs: use folio_next_index() helper in check_range_has_page() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9da22428e09de83b1c301339a97cc14caf93b7a;p=thirdparty%2Flinux.git 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 Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 0826305628387..247676f34f2e6 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -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;