mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 23:46:14 +01: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:
parent
ac97520804
commit
2408900d40
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue