aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2011-01-29 22:15:49 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2011-03-17 12:08:27 -0400
commitf58c9df78c0360f0eb3852b9cc3a61e689bc2dd1 (patch)
tree378a97ad8e857d73ae6762312c7bcb1cf5efd4bc /mm/memory-failure.c
parentfafc3dbaac6447ab8f78d2f7f32a521b24fc6b36 (diff)
mm: remove is_hwpoison_address
Unused. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 0207c2f6f8bd..99ccb4472623 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1487,35 +1487,3 @@ done:
1487 /* keep elevated page count for bad page */ 1487 /* keep elevated page count for bad page */
1488 return ret; 1488 return ret;
1489} 1489}
1490
1491/*
1492 * The caller must hold current->mm->mmap_sem in read mode.
1493 */
1494int is_hwpoison_address(unsigned long addr)
1495{
1496 pgd_t *pgdp;
1497 pud_t pud, *pudp;
1498 pmd_t pmd, *pmdp;
1499 pte_t pte, *ptep;
1500 swp_entry_t entry;
1501
1502 pgdp = pgd_offset(current->mm, addr);
1503 if (!pgd_present(*pgdp))
1504 return 0;
1505 pudp = pud_offset(pgdp, addr);
1506 pud = *pudp;
1507 if (!pud_present(pud) || pud_large(pud))
1508 return 0;
1509 pmdp = pmd_offset(pudp, addr);
1510 pmd = *pmdp;
1511 if (!pmd_present(pmd) || pmd_large(pmd))
1512 return 0;
1513 ptep = pte_offset_map(pmdp, addr);
1514 pte = *ptep;
1515 pte_unmap(ptep);
1516 if (!is_swap_pte(pte))
1517 return 0;
1518 entry = pte_to_swp_entry(pte);
1519 return is_hwpoison_entry(entry);
1520}
1521EXPORT_SYMBOL_GPL(is_hwpoison_address);