]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs: Turn page_offset() into a wrapper around folio_pos()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 21 Feb 2025 20:39:29 +0000 (20:39 +0000)
committerChristian Brauner <brauner@kernel.org>
Mon, 24 Feb 2025 10:41:43 +0000 (11:41 +0100)
commit12851bd921d429c60578b90916fc220b60757c34
tree26a17d55b57d8753d31f8e426e8b4a12db57efda
parentd1c735d44c12544cea9b04ca88d65c12892c0539
fs: Turn page_offset() into a wrapper around folio_pos()

This is far less efficient for the lagging filesystems which still
use page_offset(), but it removes an access to page->index.  It also
fixes a bug -- if any filesystem passed a tail page to page_offset(),
it would return garbage which might result in the filesystem choosing
to not writeback a dirty page.  There probably aren't any examples
of this, but I can't be certain.

Signed-off-by: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Link: https://lore.kernel.org/r/20250221203932.3588740-1-willy@infradead.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/pagemap.h