Skip to content

Commit 3cc4f7e

Browse files
qianfengrongkdave
authored andcommitted
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>
1 parent 8051840 commit 3cc4f7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@ static bool check_range_has_page(struct inode *inode, u64 start, u64 end)
21942194
if (folio->index < start_index)
21952195
continue;
21962196
/* A large folio extends beyond the end. Not a target. */
2197-
if (folio->index + folio_nr_pages(folio) > end_index)
2197+
if (folio_next_index(folio) > end_index)
21982198
continue;
21992199
/* A folio doesn't cover the head/tail index. Found a target. */
22002200
ret = true;

0 commit comments

Comments
 (0)