Skip to content

Commit ac0a111

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
xfs: Use folio_next_pos()
This is one instruction more efficient than open-coding folio_pos() + folio_size(). It's the equivalent of (x + y) << z rather than x << z + y << z. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Link: https://patch.msgid.link/20251024170822.1427218-10-willy@infradead.org Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Carlos Maiolino <cem@kernel.org> Cc: linux-xfs@vger.kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 2408900 commit ac0a111

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/xfs/scrub/xfarray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ xfarray_sort_scan(
834834
si->first_folio_idx = xfarray_idx(si->array,
835835
folio_pos(si->folio) + si->array->obj_size - 1);
836836

837-
next_pos = folio_pos(si->folio) + folio_size(si->folio);
837+
next_pos = folio_next_pos(si->folio);
838838
si->last_folio_idx = xfarray_idx(si->array, next_pos - 1);
839839
if (xfarray_pos(si->array, si->last_folio_idx + 1) > next_pos)
840840
si->last_folio_idx--;

fs/xfs/xfs_aops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ xfs_discard_folio(
271271
* folio itself and not the start offset that is passed in.
272272
*/
273273
xfs_bmap_punch_delalloc_range(ip, XFS_DATA_FORK, pos,
274-
folio_pos(folio) + folio_size(folio), NULL);
274+
folio_next_pos(folio), NULL);
275275
}
276276

277277
/*

0 commit comments

Comments
 (0)