Skip to content

Commit 19369d8

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
mm: use mapping_evict_folio() in truncate_error_page()
We already have the folio and the mapping, so replace the call to invalidate_inode_page() with mapping_evict_folio(). 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 01d1e0e commit 19369d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/memory-failure.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -930,10 +930,10 @@ static int delete_from_lru_cache(struct page *p)
930930
static int truncate_error_page(struct page *p, unsigned long pfn,
931931
struct address_space *mapping)
932932
{
933+
struct folio *folio = page_folio(p);
933934
int ret = MF_FAILED;
934935

935936
if (mapping->a_ops->error_remove_page) {
936-
struct folio *folio = page_folio(p);
937937
int err = mapping->a_ops->error_remove_page(mapping, p);
938938

939939
if (err != 0)
@@ -947,7 +947,7 @@ static int truncate_error_page(struct page *p, unsigned long pfn,
947947
* If the file system doesn't support it just invalidate
948948
* This fails on dirty or anything with private pages
949949
*/
950-
if (invalidate_inode_page(p))
950+
if (mapping_evict_folio(mapping, folio))
951951
ret = MF_RECOVERED;
952952
else
953953
pr_info("%#lx: Failed to invalidate\n", pfn);

0 commit comments

Comments
 (0)