diff options
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 2 | ||||
-rw-r--r-- | fs/proc/task_mmu.c | 27 |
2 files changed, 8 insertions, 21 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 7621db800a74..8418fcc0a6ab 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2909,7 +2909,7 @@ out_no_task: | |||
2909 | */ | 2909 | */ |
2910 | static const struct pid_entry tid_base_stuff[] = { | 2910 | static const struct pid_entry tid_base_stuff[] = { |
2911 | DIR("fd", S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations), | 2911 | DIR("fd", S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations), |
2912 | DIR("fdinfo", S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations), | 2912 | DIR("fdinfo", S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations), |
2913 | REG("environ", S_IRUSR, proc_environ_operations), | 2913 | REG("environ", S_IRUSR, proc_environ_operations), |
2914 | INF("auxv", S_IRUSR, proc_pid_auxv), | 2914 | INF("auxv", S_IRUSR, proc_pid_auxv), |
2915 | ONE("status", S_IRUGO, proc_pid_status), | 2915 | ONE("status", S_IRUGO, proc_pid_status), |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index a05a669510a4..070553427dd5 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -662,31 +662,18 @@ static u64 huge_pte_to_pagemap_entry(pte_t pte, int offset) | |||
662 | return pme; | 662 | return pme; |
663 | } | 663 | } |
664 | 664 | ||
665 | static int pagemap_hugetlb_range(pte_t *pte, unsigned long addr, | 665 | /* This function walks within one hugetlb entry in the single call */ |
666 | unsigned long end, struct mm_walk *walk) | 666 | static int pagemap_hugetlb_range(pte_t *pte, unsigned long hmask, |
667 | unsigned long addr, unsigned long end, | ||
668 | struct mm_walk *walk) | ||
667 | { | 669 | { |
668 | struct vm_area_struct *vma; | ||
669 | struct pagemapread *pm = walk->private; | 670 | struct pagemapread *pm = walk->private; |
670 | struct hstate *hs = NULL; | ||
671 | int err = 0; | 671 | int err = 0; |
672 | u64 pfn; | ||
672 | 673 | ||
673 | vma = find_vma(walk->mm, addr); | ||
674 | if (vma) | ||
675 | hs = hstate_vma(vma); | ||
676 | for (; addr != end; addr += PAGE_SIZE) { | 674 | for (; addr != end; addr += PAGE_SIZE) { |
677 | u64 pfn = PM_NOT_PRESENT; | 675 | int offset = (addr & ~hmask) >> PAGE_SHIFT; |
678 | 676 | pfn = huge_pte_to_pagemap_entry(*pte, offset); | |
679 | if (vma && (addr >= vma->vm_end)) { | ||
680 | vma = find_vma(walk->mm, addr); | ||
681 | if (vma) | ||
682 | hs = hstate_vma(vma); | ||
683 | } | ||
684 | |||
685 | if (vma && (vma->vm_start <= addr) && is_vm_hugetlb_page(vma)) { | ||
686 | /* calculate pfn of the "raw" page in the hugepage. */ | ||
687 | int offset = (addr & ~huge_page_mask(hs)) >> PAGE_SHIFT; | ||
688 | pfn = huge_pte_to_pagemap_entry(*pte, offset); | ||
689 | } | ||
690 | err = add_to_pagemap(addr, pfn, pm); | 677 | err = add_to_pagemap(addr, pfn, pm); |
691 | if (err) | 678 | if (err) |
692 | return err; | 679 | return err; |