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.
Showing the changes to include/linux (1 of 7 files). Show all
Unified · Split
| @@ -1824,10 +1824,16 @@ extern int mprotect_fixup(struct vm_area_struct *vma, · 1823 unmodified lines | ||
| 1824 | 1824 | /* |
| 1825 | 1825 | * doesn't attempt to fault and will return short. |
| 1826 | 1826 | */ |
| 1827 | −int __get_user_pages_fast(unsigned long start, int nr_pages, int write, | |
| 1828 | − struct page **pages); | |
| 1827 | +int get_user_pages_fast_only(unsigned long start, int nr_pages, | |
| 1828 | + unsigned int gup_flags, struct page **pages); | |
| 1829 | 1829 | int pin_user_pages_fast_only(unsigned long start, int nr_pages, |
| 1830 | 1830 | unsigned int gup_flags, struct page **pages); |
| 1831 | + | |
| 1832 | +static 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 | 1838 | * per-process(per-mm_struct) statistics. |
| 1833 | 1839 | */ |