OSDN Git Service

mm/memory-failure: convert hugetlb_set_page_hwpoison() to folios
authorSidhartha Kumar <sidhartha.kumar@oracle.com>
Thu, 12 Jan 2023 20:46:07 +0000 (14:46 -0600)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:33:03 +0000 (22:33 -0800)
Change hugetlb_set_page_hwpoison() to folio_set_hugetlb_hwpoison() and use
a folio internally.

Link: https://lkml.kernel.org/r/20230112204608.80136-8-sidhartha.kumar@oracle.com
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c

index 387fb9a..3821d64 100644 (file)
@@ -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,
@@ -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;
        }