Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b111f59 authored by Michael Scott's avatar Michael Scott Committed by Amit Pundir
Browse files

ANDROID: proc: fix depreciated call to get_user_pages in task_mmu



"mm: add a field to store names for private anonymous memory"
(AOSP commit ee8c5f78f09a) uses a depreciated call to get_user_pages
which generates the following compile warning:

fs/proc/task_mmu.c: In function 'seq_print_vma_name':
fs/proc/task_mmu.c:154:3: warning: 'get_user_pages8' is deprecated
(declared at include/linux/mm.h:1295) [-Wdeprecated-declarations]
   pages_pinned = get_user_pages(current, mm, page_start_vaddr,
   ^

include/linux/mm.h explains get_user_pages function call using
struct task_struct *tsk and struct mm_struct *mm (not using
current task and current->mm) should now be:
get_user_pages_remote

Fixes: AOSP Change-ID: I9aa7b6b5ef536cd780599ba4e2fba8ceebe8b59f
       ("mm: add a field to store names for private anonymous memory")
Signed-off-by: default avatarMichael Scott <michael.scott@linaro.org>
[AmitP: Refactored get_user_pages_remote() call based on upstream
        commit 9beae1ea ("mm: replace get_user_pages_remote()
        write/force parameters with gup_flags") changes.
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 8405c746
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -150,9 +150,10 @@ static void seq_print_vma_name(struct seq_file *m, struct vm_area_struct *vma)
		const char *kaddr;
		long pages_pinned;
		struct page *page;
		unsigned int gup_flags = 0;

		pages_pinned = get_user_pages(current, mm, page_start_vaddr,
				1, 0, 0, &page, NULL);
		pages_pinned = get_user_pages_remote(current, mm, page_start_vaddr,
				1, gup_flags, &page, NULL);
		if (pages_pinned < 1) {
			seq_puts(m, "<fault>]");
			return;