9 #include <linux/sched.h>
15 #include <asm/pgtable.h>
17 #ifdef __HAVE_ARCH_PTE_SPECIAL
40 if ((
pte_val(pte) & mask) != result)
44 if (!page_cache_get_speculative(page))
53 }
while (ptep++, addr +=
PAGE_SIZE, addr != end);
58 static int gup_pmd_range(
pud_t pud,
unsigned long addr,
unsigned long end,
59 int write,
struct page **pages,
int *nr)
73 addr, next, write, pages, nr))
75 }
else if (!gup_pte_range(pmd, addr, next, write, pages, nr))
77 }
while (pmdp++, addr = next, addr != end);
82 static int gup_pud_range(
pgd_t pgd,
unsigned long addr,
unsigned long end,
83 int write,
struct page **pages,
int *nr)
97 addr, next, write, pages, nr))
99 }
else if (!gup_pmd_range(pud, addr, next, write, pages, nr))
101 }
while (pudp++, addr = next, addr != end);
115 pr_devel(
"%s(%lx,%x,%s)\n", __func__, start, nr_pages, write ?
"write" :
"read");
126 pr_devel(
" aligned: %lx .. %lx\n", start, end);
151 pr_devel(
" %016lx: normal pgd %p\n", addr,
153 next = pgd_addr_end(addr, end);
158 addr, next, write, pages, &nr))
160 }
else if (!gup_pud_range(pgd, addr, next, write, pages, &nr))
162 }
while (pgdp++, addr = next, addr != end);
175 pr_devel(
" slow path ! nr = %d\n", nr);
183 (end - start) >> PAGE_SHIFT, write, 0, pages,
NULL);