aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-10 18:17:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-10 18:17:24 -0400
commit7c283324da366a3e6ffaad4352a51a3c71fcae17 (patch)
treeb4d02c340a17ac5134889c4eec7dcd06d407e3ca /fs
parent9e5869f8d70d94850cf86163c57ba8d4daa29924 (diff)
parent17ff3c1fa4c7bd0c38d751715033023ebf32fc96 (diff)
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc fixes from Andrew Morton. * emailed from Andrew Morton <akpm@linux-foundation.org>: (8 patches) MAINTAINERS: add maintainer for LED subsystem mm: nobootmem: fix sign extend problem in __free_pages_memory() drivers/leds: correct __devexit annotations memcg: free spare array to avoid memory leak namespaces, pid_ns: fix leakage on fork() failure hugetlb: prevent BUG_ON in hugetlb_fault() -> hugetlb_cow() mm: fix division by 0 in percpu_pagelist_fraction() proc/pid/pagemap: correctly report non-present ptes and holes between vmas
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/task_mmu.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 2d60492d6df..1030a716d15 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -747,6 +747,8 @@ static void pte_to_pagemap_entry(pagemap_entry_t *pme, pte_t pte)
747 else if (pte_present(pte)) 747 else if (pte_present(pte))
748 *pme = make_pme(PM_PFRAME(pte_pfn(pte)) 748 *pme = make_pme(PM_PFRAME(pte_pfn(pte))
749 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 749 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);
750 else
751 *pme = make_pme(PM_NOT_PRESENT);
750} 752}
751 753
752#ifdef CONFIG_TRANSPARENT_HUGEPAGE 754#ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -761,6 +763,8 @@ static void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme,
761 if (pmd_present(pmd)) 763 if (pmd_present(pmd))
762 *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset) 764 *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset)
763 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 765 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);
766 else
767 *pme = make_pme(PM_NOT_PRESENT);
764} 768}
765#else 769#else
766static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme, 770static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme,
@@ -801,8 +805,10 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
801 805
802 /* check to see if we've left 'vma' behind 806 /* check to see if we've left 'vma' behind
803 * and need a new, higher one */ 807 * and need a new, higher one */
804 if (vma && (addr >= vma->vm_end)) 808 if (vma && (addr >= vma->vm_end)) {
805 vma = find_vma(walk->mm, addr); 809 vma = find_vma(walk->mm, addr);
810 pme = make_pme(PM_NOT_PRESENT);
811 }
806 812
807 /* check that 'vma' actually covers this address, 813 /* check that 'vma' actually covers this address,
808 * and that it isn't a huge page vma */ 814 * and that it isn't a huge page vma */
@@ -830,6 +836,8 @@ static void huge_pte_to_pagemap_entry(pagemap_entry_t *pme,
830 if (pte_present(pte)) 836 if (pte_present(pte))
831 *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset) 837 *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset)
832 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 838 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);
839 else
840 *pme = make_pme(PM_NOT_PRESENT);
833} 841}
834 842
835/* This function walks within one hugetlb entry in the single call */ 843/* This function walks within one hugetlb entry in the single call */
@@ -839,7 +847,7 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long hmask,
839{ 847{
840 struct pagemapread *pm = walk->private; 848 struct pagemapread *pm = walk->private;
841 int err = 0; 849 int err = 0;
842 pagemap_entry_t pme = make_pme(PM_NOT_PRESENT); 850 pagemap_entry_t pme;
843 851
844 for (; addr != end; addr += PAGE_SIZE) { 852 for (; addr != end; addr += PAGE_SIZE) {
845 int offset = (addr & ~hmask) >> PAGE_SHIFT; 853 int offset = (addr & ~hmask) >> PAGE_SHIFT;