Skip to content

Commit

Permalink
memory-failure: remove calls to page_mapping()
Browse files Browse the repository at this point in the history
This is mostly just inlining page_mapping() into the two callers.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Reviewed-by: Sidhartha Kumar <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Acked-by: Miaohe Lin <[email protected]>
Cc: Eric Biggers <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
(cherry picked from commit 89f5c54)
Signed-off-by: Matthew R. Ochs <[email protected]>
Acked-by: Kai-Heng Feng <[email protected]>
Acked-by: Koba Ko <[email protected]>
Signed-off-by: Matthew R. Ochs <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and nvmochs committed Oct 18, 2024
1 parent 4fb0282 commit c2dc6d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,15 @@ 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;

if (hwpoison_filter_dev_major == ~0U &&
hwpoison_filter_dev_minor == ~0U)
return 0;

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

Expand Down Expand Up @@ -1094,7 +1095,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. */
Expand Down

0 comments on commit c2dc6d1

Please sign in to comment.