Skip to content

Commit edad1bb

Browse files
jgunthorpeakpm00
authored andcommitted
mm/gup: remove pin_user_pages_fast_only()
Commit ed29c26 ("drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v7.") removed the only caller, remove this dead code too. Link: https://lkml.kernel.org/r/10-v2-987e91b59705+36b-gup_tidy_jgg@nvidia.com Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Acked-by: Mike Rapoport (IBM) <rppt@kernel.org> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: David Hildenbrand <david@redhat.com> Cc: Alistair Popple <apopple@nvidia.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Claudio Imbrenda <imbrenda@linux.ibm.com> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 9a863a6 commit edad1bb

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

include/linux/mm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,8 +2261,6 @@ extern int mprotect_fixup(struct vma_iterator *vmi, struct mmu_gather *tlb,
22612261
*/
22622262
int get_user_pages_fast_only(unsigned long start, int nr_pages,
22632263
unsigned int gup_flags, struct page **pages);
2264-
int pin_user_pages_fast_only(unsigned long start, int nr_pages,
2265-
unsigned int gup_flags, struct page **pages);
22662264

22672265
static inline bool get_user_page_fast_only(unsigned long addr,
22682266
unsigned int gup_flags, struct page **pagep)

mm/gup.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,39 +3102,6 @@ int pin_user_pages_fast(unsigned long start, int nr_pages,
31023102
}
31033103
EXPORT_SYMBOL_GPL(pin_user_pages_fast);
31043104

3105-
/*
3106-
* This is the FOLL_PIN equivalent of get_user_pages_fast_only(). Behavior
3107-
* is the same, except that this one sets FOLL_PIN instead of FOLL_GET.
3108-
*
3109-
* The API rules are the same, too: no negative values may be returned.
3110-
*/
3111-
int pin_user_pages_fast_only(unsigned long start, int nr_pages,
3112-
unsigned int gup_flags, struct page **pages)
3113-
{
3114-
int nr_pinned;
3115-
3116-
/*
3117-
* FOLL_FAST_ONLY is required in order to match the API description of
3118-
* this routine: no fall back to regular ("slow") GUP.
3119-
*/
3120-
if (!is_valid_gup_args(pages, NULL, NULL, &gup_flags,
3121-
FOLL_PIN | FOLL_FAST_ONLY))
3122-
return 0;
3123-
3124-
nr_pinned = internal_get_user_pages_fast(start, nr_pages, gup_flags,
3125-
pages);
3126-
/*
3127-
* This routine is not allowed to return negative values. However,
3128-
* internal_get_user_pages_fast() *can* return -errno. Therefore,
3129-
* correct for that here:
3130-
*/
3131-
if (nr_pinned < 0)
3132-
nr_pinned = 0;
3133-
3134-
return nr_pinned;
3135-
}
3136-
EXPORT_SYMBOL_GPL(pin_user_pages_fast_only);
3137-
31383105
/**
31393106
* pin_user_pages_remote() - pin pages of a remote process
31403107
*

0 commit comments

Comments
 (0)