mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-04 04:37:39 -04:00
netfs: 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-9-willy@infradead.org Acked-by: David Howells <dhowells@redhat.com> Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org> Cc: David Howells <dhowells@redhat.com> Cc: Paulo Alcantara <pc@manguebit.org> Cc: netfs@lists.linux.dev Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner
parent
ac97520804
commit
2408900d40
@@ -535,7 +535,7 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr
|
||||
folio_unlock(folio);
|
||||
err = filemap_fdatawrite_range(mapping,
|
||||
folio_pos(folio),
|
||||
folio_pos(folio) + folio_size(folio));
|
||||
folio_next_pos(folio));
|
||||
switch (err) {
|
||||
case 0:
|
||||
ret = VM_FAULT_RETRY;
|
||||
|
||||
@@ -298,7 +298,7 @@ bool netfs_release_folio(struct folio *folio, gfp_t gfp)
|
||||
if (folio_test_dirty(folio))
|
||||
return false;
|
||||
|
||||
end = umin(folio_pos(folio) + folio_size(folio), i_size_read(&ctx->inode));
|
||||
end = umin(folio_next_pos(folio), i_size_read(&ctx->inode));
|
||||
if (end > ctx->zero_point)
|
||||
ctx->zero_point = end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user