Skip to content

Commit

Permalink
mm/memory-failure: convert hugetlb_set_page_hwpoison() to folios
Browse files Browse the repository at this point in the history
Change hugetlb_set_page_hwpoison() to folio_set_hugetlb_hwpoison() and use
a folio internally.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Sidhartha Kumar <[email protected]>
Acked-by: Naoya Horiguchi <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Miaohe Lin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
sidkumar99 authored and akpm00 committed Feb 3, 2023
1 parent 0858b5e commit 595dd81
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,13 +1721,12 @@ static unsigned long __folio_free_raw_hwp(struct folio *folio, bool move_flag)
return count;
}

static int hugetlb_set_page_hwpoison(struct page *hpage, struct page *page)
static int folio_set_hugetlb_hwpoison(struct folio *folio, struct page *page)
{
struct llist_head *head;
struct raw_hwp_page *raw_hwp;
struct llist_node *t, *tnode;
int ret = TestSetPageHWPoison(hpage) ? -EHWPOISON : 0;
struct folio *folio = page_folio(hpage);
int ret = folio_test_set_hwpoison(folio) ? -EHWPOISON : 0;

/*
* Once the hwpoison hugepage has lost reliable raw error info,
Expand Down Expand Up @@ -1830,7 +1829,7 @@ int __get_huge_page_for_hwpoison(unsigned long pfn, int flags,
goto out;
}

if (hugetlb_set_page_hwpoison(&folio->page, page)) {
if (folio_set_hugetlb_hwpoison(folio, page)) {
ret = -EHWPOISON;
goto out;
}
Expand Down

0 comments on commit 595dd81

Please sign in to comment.