Skip to content

Commit 253e8ea

Browse files
Matthew Wilcox (Oracle)opsiff
authored andcommitted
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/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Acked-by: Miaohe Lin <[email protected]> Reviewed-by: Jane Chu <[email protected]> Cc: Dan Williams <[email protected]> Cc: Oscar Salvador <[email protected]> Signed-off-by: Andrew Morton <[email protected]> (cherry picked from commit ee299e9)
1 parent 205e68b commit 253e8ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mm/memory-failure.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2575,8 +2575,8 @@ int unpoison_memory(unsigned long pfn)
25752575
goto unlock_mutex;
25762576
}
25772577

2578-
if (folio_test_slab(folio) || PageTable(&folio->page) ||
2579-
folio_test_reserved(folio) || PageOffline(&folio->page))
2578+
if (folio_test_slab(folio) || folio_test_pgtable(folio) ||
2579+
folio_test_reserved(folio) || folio_test_offline(folio))
25802580
goto unlock_mutex;
25812581

25822582
/*
@@ -2597,7 +2597,7 @@ int unpoison_memory(unsigned long pfn)
25972597

25982598
ghp = get_hwpoison_page(p, MF_UNPOISON);
25992599
if (!ghp) {
2600-
if (PageHuge(p)) {
2600+
if (folio_test_hugetlb(folio)) {
26012601
huge = true;
26022602
count = folio_free_raw_hwp(folio, false);
26032603
if (count == 0)
@@ -2613,7 +2613,7 @@ int unpoison_memory(unsigned long pfn)
26132613
pfn, &unpoison_rs);
26142614
}
26152615
} else {
2616-
if (PageHuge(p)) {
2616+
if (folio_test_hugetlb(folio)) {
26172617
huge = true;
26182618
count = folio_free_raw_hwp(folio, false);
26192619
if (count == 0) {

0 commit comments

Comments
 (0)