mm: remove rest usage of VM_NONLINEAR and pte_file()
[deliverable/linux.git] / mm / madvise.c
index a271adc93289f7e84a9a5e56b3b5ffb6b914db63..d79fb5e8f80a0b4148e4e8bfb48bed81097d04b6 100644 (file)
@@ -155,7 +155,7 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start,
                pte = *(orig_pte + ((index - start) / PAGE_SIZE));
                pte_unmap_unlock(orig_pte, ptl);
 
-               if (pte_present(pte) || pte_none(pte) || pte_file(pte))
+               if (pte_present(pte) || pte_none(pte))
                        continue;
                entry = pte_to_swp_entry(pte);
                if (unlikely(non_swap_entry(entry)))
@@ -278,14 +278,7 @@ static long madvise_dontneed(struct vm_area_struct *vma,
        if (vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_PFNMAP))
                return -EINVAL;
 
-       if (unlikely(vma->vm_flags & VM_NONLINEAR)) {
-               struct zap_details details = {
-                       .nonlinear_vma = vma,
-                       .last_index = ULONG_MAX,
-               };
-               zap_page_range(vma, start, end - start, &details);
-       } else
-               zap_page_range(vma, start, end - start, NULL);
+       zap_page_range(vma, start, end - start, NULL);
        return 0;
 }
 
@@ -303,7 +296,7 @@ static long madvise_remove(struct vm_area_struct *vma,
 
        *prev = NULL;   /* tell sys_madvise we drop mmap_sem */
 
-       if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB))
+       if (vma->vm_flags & (VM_LOCKED | VM_HUGETLB))
                return -EINVAL;
 
        f = vma->vm_file;
This page took 0.030761 seconds and 5 git commands to generate.