mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
mm/gup: Switch all callers of get_user_pages() to not pass tsk/mm
We will soon modify the vanilla get_user_pages() so it can no longer be used on mm/tasks other than 'current/current->mm', which is by far the most common way it is called. For now, we allow the old-style calls, but warn when they are used. (implemented in previous patch) This patch switches all callers of: get_user_pages() get_user_pages_unlocked() get_user_pages_locked() to stop passing tsk/mm so they will no longer see the warnings. Signed-off-by: Dave Hansen <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Srikar Dronamraju <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
cde70140fe
commit
d4edcf0d56
29 changed files with 44 additions and 64 deletions
|
|
@ -844,12 +844,12 @@ static void get_policy_nodemask(struct mempolicy *p, nodemask_t *nodes)
|
|||
}
|
||||
}
|
||||
|
||||
static int lookup_node(struct mm_struct *mm, unsigned long addr)
|
||||
static int lookup_node(unsigned long addr)
|
||||
{
|
||||
struct page *p;
|
||||
int err;
|
||||
|
||||
err = get_user_pages(current, mm, addr & PAGE_MASK, 1, 0, 0, &p, NULL);
|
||||
err = get_user_pages(addr & PAGE_MASK, 1, 0, 0, &p, NULL);
|
||||
if (err >= 0) {
|
||||
err = page_to_nid(p);
|
||||
put_page(p);
|
||||
|
|
@ -904,7 +904,7 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask,
|
|||
|
||||
if (flags & MPOL_F_NODE) {
|
||||
if (flags & MPOL_F_ADDR) {
|
||||
err = lookup_node(mm, addr);
|
||||
err = lookup_node(addr);
|
||||
if (err < 0)
|
||||
goto out;
|
||||
*policy = err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue