Commit 0b295316 authored by Lorenzo Stoakes's avatar Lorenzo Stoakes Committed by Andrew Morton

mm/gup: remove unused vmas parameter from pin_user_pages_remote()

No invocation of pin_user_pages_remote() uses the vmas parameter, so
remove it.  This forms part of a larger patch set eliminating the use of
the vmas parameters altogether.

Link: https://lkml.kernel.org/r/28f000beb81e45bf538a2aaa77c90f5482b67a32.1684350871.git.lstoakes@gmail.comSigned-off-by: default avatarLorenzo Stoakes <lstoakes@gmail.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Sean Christopherson <seanjc@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 54d02069
...@@ -786,7 +786,7 @@ static int pfn_reader_user_pin(struct pfn_reader_user *user, ...@@ -786,7 +786,7 @@ static int pfn_reader_user_pin(struct pfn_reader_user *user,
user->locked = 1; user->locked = 1;
} }
rc = pin_user_pages_remote(pages->source_mm, uptr, npages, rc = pin_user_pages_remote(pages->source_mm, uptr, npages,
user->gup_flags, user->upages, NULL, user->gup_flags, user->upages,
&user->locked); &user->locked);
} }
if (rc <= 0) { if (rc <= 0) {
...@@ -1799,7 +1799,7 @@ static int iopt_pages_rw_page(struct iopt_pages *pages, unsigned long index, ...@@ -1799,7 +1799,7 @@ static int iopt_pages_rw_page(struct iopt_pages *pages, unsigned long index,
rc = pin_user_pages_remote( rc = pin_user_pages_remote(
pages->source_mm, (uintptr_t)(pages->uptr + index * PAGE_SIZE), pages->source_mm, (uintptr_t)(pages->uptr + index * PAGE_SIZE),
1, (flags & IOMMUFD_ACCESS_RW_WRITE) ? FOLL_WRITE : 0, &page, 1, (flags & IOMMUFD_ACCESS_RW_WRITE) ? FOLL_WRITE : 0, &page,
NULL, NULL); NULL);
mmap_read_unlock(pages->source_mm); mmap_read_unlock(pages->source_mm);
if (rc != 1) { if (rc != 1) {
if (WARN_ON(rc >= 0)) if (WARN_ON(rc >= 0))
......
...@@ -562,7 +562,7 @@ static int vaddr_get_pfns(struct mm_struct *mm, unsigned long vaddr, ...@@ -562,7 +562,7 @@ static int vaddr_get_pfns(struct mm_struct *mm, unsigned long vaddr,
mmap_read_lock(mm); mmap_read_lock(mm);
ret = pin_user_pages_remote(mm, vaddr, npages, flags | FOLL_LONGTERM, ret = pin_user_pages_remote(mm, vaddr, npages, flags | FOLL_LONGTERM,
pages, NULL, NULL); pages, NULL);
if (ret > 0) { if (ret > 0) {
int i; int i;
......
...@@ -2367,7 +2367,7 @@ long get_user_pages_remote(struct mm_struct *mm, ...@@ -2367,7 +2367,7 @@ long get_user_pages_remote(struct mm_struct *mm,
long pin_user_pages_remote(struct mm_struct *mm, long pin_user_pages_remote(struct mm_struct *mm,
unsigned long start, unsigned long nr_pages, unsigned long start, unsigned long nr_pages,
unsigned int gup_flags, struct page **pages, unsigned int gup_flags, struct page **pages,
struct vm_area_struct **vmas, int *locked); int *locked);
long get_user_pages(unsigned long start, unsigned long nr_pages, long get_user_pages(unsigned long start, unsigned long nr_pages,
unsigned int gup_flags, struct page **pages); unsigned int gup_flags, struct page **pages);
long pin_user_pages(unsigned long start, unsigned long nr_pages, long pin_user_pages(unsigned long start, unsigned long nr_pages,
......
...@@ -406,7 +406,7 @@ static int user_event_enabler_write(struct user_event_mm *mm, ...@@ -406,7 +406,7 @@ static int user_event_enabler_write(struct user_event_mm *mm,
return -EBUSY; return -EBUSY;
ret = pin_user_pages_remote(mm->mm, uaddr, 1, FOLL_WRITE | FOLL_NOFAULT, ret = pin_user_pages_remote(mm->mm, uaddr, 1, FOLL_WRITE | FOLL_NOFAULT,
&page, NULL, NULL); &page, NULL);
if (unlikely(ret <= 0)) { if (unlikely(ret <= 0)) {
if (!fixup_fault) if (!fixup_fault)
......
...@@ -3100,8 +3100,6 @@ EXPORT_SYMBOL_GPL(pin_user_pages_fast); ...@@ -3100,8 +3100,6 @@ EXPORT_SYMBOL_GPL(pin_user_pages_fast);
* @gup_flags: flags modifying lookup behaviour * @gup_flags: flags modifying lookup behaviour
* @pages: array that receives pointers to the pages pinned. * @pages: array that receives pointers to the pages pinned.
* Should be at least nr_pages long. * Should be at least nr_pages long.
* @vmas: array of pointers to vmas corresponding to each page.
* Or NULL if the caller does not require them.
* @locked: pointer to lock flag indicating whether lock is held and * @locked: pointer to lock flag indicating whether lock is held and
* subsequently whether VM_FAULT_RETRY functionality can be * subsequently whether VM_FAULT_RETRY functionality can be
* utilised. Lock must initially be held. * utilised. Lock must initially be held.
...@@ -3116,14 +3114,14 @@ EXPORT_SYMBOL_GPL(pin_user_pages_fast); ...@@ -3116,14 +3114,14 @@ EXPORT_SYMBOL_GPL(pin_user_pages_fast);
long pin_user_pages_remote(struct mm_struct *mm, long pin_user_pages_remote(struct mm_struct *mm,
unsigned long start, unsigned long nr_pages, unsigned long start, unsigned long nr_pages,
unsigned int gup_flags, struct page **pages, unsigned int gup_flags, struct page **pages,
struct vm_area_struct **vmas, int *locked) int *locked)
{ {
int local_locked = 1; int local_locked = 1;
if (!is_valid_gup_args(pages, vmas, locked, &gup_flags, if (!is_valid_gup_args(pages, NULL, locked, &gup_flags,
FOLL_PIN | FOLL_TOUCH | FOLL_REMOTE)) FOLL_PIN | FOLL_TOUCH | FOLL_REMOTE))
return 0; return 0;
return __gup_longterm_locked(mm, start, nr_pages, pages, vmas, return __gup_longterm_locked(mm, start, nr_pages, pages, NULL,
locked ? locked : &local_locked, locked ? locked : &local_locked,
gup_flags); gup_flags);
} }
......
...@@ -104,7 +104,7 @@ static int process_vm_rw_single_vec(unsigned long addr, ...@@ -104,7 +104,7 @@ static int process_vm_rw_single_vec(unsigned long addr,
mmap_read_lock(mm); mmap_read_lock(mm);
pinned_pages = pin_user_pages_remote(mm, pa, pinned_pages, pinned_pages = pin_user_pages_remote(mm, pa, pinned_pages,
flags, process_pages, flags, process_pages,
NULL, &locked); &locked);
if (locked) if (locked)
mmap_read_unlock(mm); mmap_read_unlock(mm);
if (pinned_pages <= 0) if (pinned_pages <= 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment