Skip to content

Commit e130b65

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
memory-failure: convert truncate_error_page to truncate_error_folio
Both callers now have a folio, so pass it in. Nothing downstream was expecting a tail page; that's asserted in generic_error_remove_page(), for example. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Naoya Horiguchi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent b6fd410 commit e130b65

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

mm/memory-failure.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -927,14 +927,13 @@ static int delete_from_lru_cache(struct folio *folio)
927927
return -EIO;
928928
}
929929

930-
static int truncate_error_page(struct page *p, unsigned long pfn,
930+
static int truncate_error_page(struct folio *folio, unsigned long pfn,
931931
struct address_space *mapping)
932932
{
933-
struct folio *folio = page_folio(p);
934933
int ret = MF_FAILED;
935934

936935
if (mapping->a_ops->error_remove_page) {
937-
int err = mapping->a_ops->error_remove_page(mapping, p);
936+
int err = mapping->a_ops->error_remove_page(mapping, &folio->page);
938937

939938
if (err != 0)
940939
pr_info("%#lx: Failed to punch page: %d\n", pfn, err);
@@ -1055,7 +1054,7 @@ static int me_pagecache_clean(struct page_state *ps, struct page *p)
10551054
*
10561055
* Open: to take i_rwsem or not for this? Right now we don't.
10571056
*/
1058-
ret = truncate_error_page(p, page_to_pfn(p), mapping);
1057+
ret = truncate_error_page(folio, page_to_pfn(p), mapping);
10591058
if (has_extra_refcount(ps, p, extra_pins))
10601059
ret = MF_FAILED;
10611060

@@ -1189,7 +1188,7 @@ static int me_huge_page(struct page_state *ps, struct page *p)
11891188

11901189
mapping = folio_mapping(folio);
11911190
if (mapping) {
1192-
res = truncate_error_page(&folio->page, page_to_pfn(p), mapping);
1191+
res = truncate_error_page(folio, page_to_pfn(p), mapping);
11931192
/* The page is kept in page cache. */
11941193
extra_pins = true;
11951194
folio_unlock(folio);

0 commit comments

Comments
 (0)