Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings

Zefan Li
2020-07-20T02:02:20Z

> +static int vmap_pages_range_noflush(unsigned long start, unsigned long end,
> + pgprot_t prot, struct page **pages,
> + unsigned int page_shift)
> +{
> + if (page_shift == PAGE_SIZE) {

Is this a typo of PAGE_SHIFT?

> + return vmap_small_pages_range_noflush(start, end, prot, pages);
> + } else {
> + unsigned long addr = start;
> + unsigned int i, nr = (end - start) >> page_shift;
> +
> + for (i = 0; i < nr; i++) {
> + int err;
> +
> + err = vmap_range_noflush(addr,
> + addr + (1UL << page_shift),
> + __pa(page_address(pages[i])), prot,
> + page_shift);
> + if (err)
> + return err;
> +
> + addr += 1UL << page_shift;
> + }
> +
> + return 0;
> + }
> +}
> +