diff options
Diffstat (limited to 'mm/ksm.c')
-rw-r--r-- | mm/ksm.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -778,8 +778,6 @@ static int replace_page(struct vm_area_struct *vma, struct page *page, | |||
778 | struct page *kpage, pte_t orig_pte) | 778 | struct page *kpage, pte_t orig_pte) |
779 | { | 779 | { |
780 | struct mm_struct *mm = vma->vm_mm; | 780 | struct mm_struct *mm = vma->vm_mm; |
781 | pgd_t *pgd; | ||
782 | pud_t *pud; | ||
783 | pmd_t *pmd; | 781 | pmd_t *pmd; |
784 | pte_t *ptep; | 782 | pte_t *ptep; |
785 | spinlock_t *ptl; | 783 | spinlock_t *ptl; |
@@ -792,18 +790,10 @@ static int replace_page(struct vm_area_struct *vma, struct page *page, | |||
792 | if (addr == -EFAULT) | 790 | if (addr == -EFAULT) |
793 | goto out; | 791 | goto out; |
794 | 792 | ||
795 | pgd = pgd_offset(mm, addr); | 793 | pmd = mm_find_pmd(mm, addr); |
796 | if (!pgd_present(*pgd)) | 794 | if (!pmd) |
797 | goto out; | 795 | goto out; |
798 | |||
799 | pud = pud_offset(pgd, addr); | ||
800 | if (!pud_present(*pud)) | ||
801 | goto out; | ||
802 | |||
803 | pmd = pmd_offset(pud, addr); | ||
804 | BUG_ON(pmd_trans_huge(*pmd)); | 796 | BUG_ON(pmd_trans_huge(*pmd)); |
805 | if (!pmd_present(*pmd)) | ||
806 | goto out; | ||
807 | 797 | ||
808 | mmun_start = addr; | 798 | mmun_start = addr; |
809 | mmun_end = addr + PAGE_SIZE; | 799 | mmun_end = addr + PAGE_SIZE; |