Commit 89f5c54b authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton
Browse files

memory-failure: remove calls to page_mapping()

This is mostly just inlining page_mapping() into the two callers.

Link: https://lkml.kernel.org/r/20240423225552.4113447-4-willy@infradead.org


Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarSidhartha Kumar <sidhartha.kumar@oracle.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Acked-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Cc: Eric Biggers <ebiggers@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 196ad49c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -216,6 +216,7 @@ EXPORT_SYMBOL_GPL(hwpoison_filter_flags_value);

static int hwpoison_filter_dev(struct page *p)
{
	struct folio *folio = page_folio(p);
	struct address_space *mapping;
	dev_t dev;

@@ -223,7 +224,7 @@ static int hwpoison_filter_dev(struct page *p)
	    hwpoison_filter_dev_minor == ~0U)
		return 0;

	mapping = page_mapping(p);
	mapping = folio_mapping(folio);
	if (mapping == NULL || mapping->host == NULL)
		return -EINVAL;

@@ -1090,7 +1091,8 @@ static int me_pagecache_clean(struct page_state *ps, struct page *p)
 */
static int me_pagecache_dirty(struct page_state *ps, struct page *p)
{
	struct address_space *mapping = page_mapping(p);
	struct folio *folio = page_folio(p);
	struct address_space *mapping = folio_mapping(folio);

	SetPageError(p);
	/* TBD: print more information about the file. */