]> www.infradead.org Git - users/willy/pagecache.git/commit
mm: Make page_index() THP-safe next
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 29 Oct 2020 18:07:47 +0000 (14:07 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 25 Nov 2020 02:03:43 +0000 (21:03 -0500)
commitfedc7682a2400fe3acbdf2da7365ad5a0a195f73
tree630a2613f17ca082156d2a0eb44fce74d0c2f596
parent9a4f1853f210ddf7aaf800d8ca553a53450384a4
mm: Make page_index() THP-safe

You can't dereference page->index for tail pages, so use the head's
index to calculate the offset of this page in the file.  Also move
the function to pagemap.h since it's a pagecache function not used
by the rest of the kernel.  This also makes page_file_offset() work
when called for tail pages.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
include/linux/mm.h
include/linux/pagemap.h