]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: use folio_next_index() helper in check_range_has_page()
authorQianfeng Rong <rongqianfeng@vivo.com>
Thu, 19 Jun 2025 10:15:01 +0000 (18:15 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:58:03 +0000 (23:58 +0200)
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>
fs/btrfs/file.c

index 0826305628387adbca8292b666419b29cd93fafa..247676f34f2e66d770fc2f1d1ef3e236d3190914 100644 (file)
@@ -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;