Skip to content

Commit 5f0fc78

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
gfs2: 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-7-willy@infradead.org Cc: Andreas Gruenbacher <agruenba@redhat.com> Cc: gfs2@lists.linux.dev Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 4fcafa3 commit 5f0fc78

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

fs/gfs2/aops.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ static int gfs2_write_jdata_folio(struct folio *folio,
8181
* the page size, the remaining memory is zeroed when mapped, and
8282
* writes to that region are not written out to the file."
8383
*/
84-
if (folio_pos(folio) < i_size &&
85-
i_size < folio_pos(folio) + folio_size(folio))
84+
if (folio_pos(folio) < i_size && i_size < folio_next_pos(folio))
8685
folio_zero_segment(folio, offset_in_folio(folio, i_size),
8786
folio_size(folio));
8887

0 commit comments

Comments
 (0)