Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/ipath: Change get_user_pages() usage to always NULL vmas

The static helper routine, __ipath_get_user_pages(), accepts a vma
arg, but current use always passes NULL.

This has caused some confusion associated with the correct use of this
argument, but since the current use case doesn't require the
flexiblity, the best thing to do is to simplfy the code to always pass
NULL to get_user_pages().

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>

authored by

Mike Marciniszyn and committed by
Roland Dreier
3033771f 52addcf9

+3 -3
+3 -3
drivers/infiniband/hw/ipath/ipath_user_pages.c
··· 54 54 55 55 /* call with current->mm->mmap_sem held */ 56 56 static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages, 57 - struct page **p, struct vm_area_struct **vma) 57 + struct page **p) 58 58 { 59 59 unsigned long lock_limit; 60 60 size_t got; ··· 74 74 ret = get_user_pages(current, current->mm, 75 75 start_page + got * PAGE_SIZE, 76 76 num_pages - got, 1, 1, 77 - p + got, vma); 77 + p + got, NULL); 78 78 if (ret < 0) 79 79 goto bail_release; 80 80 } ··· 165 165 166 166 down_write(&current->mm->mmap_sem); 167 167 168 - ret = __ipath_get_user_pages(start_page, num_pages, p, NULL); 168 + ret = __ipath_get_user_pages(start_page, num_pages, p); 169 169 170 170 up_write(&current->mm->mmap_sem); 171 171