Commit ee299e98 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

mm/memory-failure: add some folio conversions to unpoison_memory

Some of these folio APIs didn't exist when the unpoison_memory()
conversion was done originally.

Link: https://lkml.kernel.org/r/20240412193510.2356957-10-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: default avatarJane Chu <jane.chu@oracle.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Oscar Salvador <osalvador@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 03468a0f
......@@ -2556,8 +2556,8 @@ int unpoison_memory(unsigned long pfn)
goto unlock_mutex;
}
if (folio_test_slab(folio) || PageTable(&folio->page) ||
folio_test_reserved(folio) || PageOffline(&folio->page))
if (folio_test_slab(folio) || folio_test_pgtable(folio) ||
folio_test_reserved(folio) || folio_test_offline(folio))
goto unlock_mutex;
/*
......@@ -2578,7 +2578,7 @@ int unpoison_memory(unsigned long pfn)
ghp = get_hwpoison_page(p, MF_UNPOISON);
if (!ghp) {
if (PageHuge(p)) {
if (folio_test_hugetlb(folio)) {
huge = true;
count = folio_free_raw_hwp(folio, false);
if (count == 0)
......@@ -2594,7 +2594,7 @@ int unpoison_memory(unsigned long pfn)
pfn, &unpoison_rs);
}
} else {
if (PageHuge(p)) {
if (folio_test_hugetlb(folio)) {
huge = true;
count = folio_free_raw_hwp(folio, false);
if (count == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment