Re: [PATCH 1/3] mm: add apply_to_existing_pages helper

From: Daniel Axtens
Date: Fri Dec 06 2019 - 21:16:19 EST


>
> Wouldn't apply_to_existing_page_range() be a better name?

I agree with both of those fixups, thanks!

Regards,
Daniel

>
> --- a/include/linux/mm.h~mm-add-apply_to_existing_pages-helper-fix-fix
> +++ a/include/linux/mm.h
> @@ -2621,9 +2621,9 @@ static inline int vm_fault_to_errno(vm_f
> typedef int (*pte_fn_t)(pte_t *pte, unsigned long addr, void *data);
> extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
> unsigned long size, pte_fn_t fn, void *data);
> -extern int apply_to_existing_pages(struct mm_struct *mm, unsigned long address,
> - unsigned long size, pte_fn_t fn,
> - void *data);
> +extern int apply_to_existing_page_range(struct mm_struct *mm,
> + unsigned long address, unsigned long size,
> + pte_fn_t fn, void *data);
>
> #ifdef CONFIG_PAGE_POISONING
> extern bool page_poisoning_enabled(void);
> --- a/mm/memory.c~mm-add-apply_to_existing_pages-helper-fix-fix
> +++ a/mm/memory.c
> @@ -2184,12 +2184,12 @@ EXPORT_SYMBOL_GPL(apply_to_page_range);
> * Unlike apply_to_page_range, this does _not_ fill in page tables
> * where they are absent.
> */
> -int apply_to_existing_pages(struct mm_struct *mm, unsigned long addr,
> - unsigned long size, pte_fn_t fn, void *data)
> +int apply_to_existing_page_range(struct mm_struct *mm, unsigned long addr,
> + unsigned long size, pte_fn_t fn, void *data)
> {
> return __apply_to_page_range(mm, addr, size, fn, data, false);
> }
> -EXPORT_SYMBOL_GPL(apply_to_existing_pages);
> +EXPORT_SYMBOL_GPL(apply_to_existing_page_range);
>
> /*
> * handle_pte_fault chooses page fault handler according to an entry which was
> _