History

mm/gup.c: convert to use get_user_{page|pages}_fast_only()

API __get_user_pages_fast() renamed to get_user_pages_fast_only() to align with pin_user_pages_fast_only(). As part of this we will get rid of write parameter. Instead caller will pass FOLL_WRITE to get_user_pages_fast_only(). This will not change any existing functionality of the API. All the callers are changed to pass FOLL_WRITE. Also introduce get_user_page_fast_only(), and use it in a few places that hard-code nr_pages to 1. Updated the documentation of the API.

Souptick Joarder committed 6 years ago

Commit dadbb611 parent e77132e7 files · +32 −27Browse files

Showing the changes to include/linux (1 of 7 files). Show all

Unified · Split

include/linux/mm.h+8−2
@@ -1824,10 +1824,16 @@ extern int mprotect_fixup(struct vm_area_struct *vma, · 1823 unmodified lines
1824/*1824/*
1825 * doesn't attempt to fault and will return short.1825 * doesn't attempt to fault and will return short.
1826 */1826 */
1827int __get_user_pages_fast(unsigned long start, int nr_pages, int write,1827int get_user_pages_fast_only(unsigned long start, int nr_pages,
1828 struct page **pages);1828 unsigned int gup_flags, struct page **pages);
1829int pin_user_pages_fast_only(unsigned long start, int nr_pages,1829int pin_user_pages_fast_only(unsigned long start, int nr_pages,
1830 unsigned int gup_flags, struct page **pages);1830 unsigned int gup_flags, struct page **pages);
1831
1832static inline bool get_user_page_fast_only(unsigned long addr,
1833 unsigned int gup_flags, struct page **pagep)
1834{
1835 return get_user_pages_fast_only(addr, 1, gup_flags, pagep) == 1;
1836}
1831/*1837/*
1832 * per-process(per-mm_struct) statistics.1838 * per-process(per-mm_struct) statistics.
1833 */1839 */