mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
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>
This commit is contained in:
committed by
Christian Brauner
parent
4fcafa30b7
commit
5f0fc78532
@@ -81,8 +81,7 @@ static int gfs2_write_jdata_folio(struct folio *folio,
|
||||
* the page size, the remaining memory is zeroed when mapped, and
|
||||
* writes to that region are not written out to the file."
|
||||
*/
|
||||
if (folio_pos(folio) < i_size &&
|
||||
i_size < folio_pos(folio) + folio_size(folio))
|
||||
if (folio_pos(folio) < i_size && i_size < folio_next_pos(folio))
|
||||
folio_zero_segment(folio, offset_in_folio(folio, i_size),
|
||||
folio_size(folio));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user