diff options
Diffstat (limited to 'mm/gup.c')
-rw-r--r-- | mm/gup.c | 22 |
1 files changed, 7 insertions, 15 deletions
@@ -915,9 +915,7 @@ EXPORT_SYMBOL(get_user_pages_unlocked); | |||
915 | * @mm: mm_struct of target mm | 915 | * @mm: mm_struct of target mm |
916 | * @start: starting user address | 916 | * @start: starting user address |
917 | * @nr_pages: number of pages from start to pin | 917 | * @nr_pages: number of pages from start to pin |
918 | * @write: whether pages will be written to by the caller | 918 | * @gup_flags: flags modifying lookup behaviour |
919 | * @force: whether to force access even when user mapping is currently | ||
920 | * protected (but never forces write access to shared mapping). | ||
921 | * @pages: array that receives pointers to the pages pinned. | 919 | * @pages: array that receives pointers to the pages pinned. |
922 | * Should be at least nr_pages long. Or NULL, if caller | 920 | * Should be at least nr_pages long. Or NULL, if caller |
923 | * only intends to ensure the pages are faulted in. | 921 | * only intends to ensure the pages are faulted in. |
@@ -946,9 +944,9 @@ EXPORT_SYMBOL(get_user_pages_unlocked); | |||
946 | * or similar operation cannot guarantee anything stronger anyway because | 944 | * or similar operation cannot guarantee anything stronger anyway because |
947 | * locks can't be held over the syscall boundary. | 945 | * locks can't be held over the syscall boundary. |
948 | * | 946 | * |
949 | * If write=0, the page must not be written to. If the page is written to, | 947 | * If gup_flags & FOLL_WRITE == 0, the page must not be written to. If the page |
950 | * set_page_dirty (or set_page_dirty_lock, as appropriate) must be called | 948 | * is written to, set_page_dirty (or set_page_dirty_lock, as appropriate) must |
951 | * after the page is finished with, and before put_page is called. | 949 | * be called after the page is finished with, and before put_page is called. |
952 | * | 950 | * |
953 | * get_user_pages is typically used for fewer-copy IO operations, to get a | 951 | * get_user_pages is typically used for fewer-copy IO operations, to get a |
954 | * handle on the memory by some means other than accesses via the user virtual | 952 | * handle on the memory by some means other than accesses via the user virtual |
@@ -965,18 +963,12 @@ EXPORT_SYMBOL(get_user_pages_unlocked); | |||
965 | */ | 963 | */ |
966 | long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, | 964 | long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, |
967 | unsigned long start, unsigned long nr_pages, | 965 | unsigned long start, unsigned long nr_pages, |
968 | int write, int force, struct page **pages, | 966 | unsigned int gup_flags, struct page **pages, |
969 | struct vm_area_struct **vmas) | 967 | struct vm_area_struct **vmas) |
970 | { | 968 | { |
971 | unsigned int flags = FOLL_TOUCH | FOLL_REMOTE; | ||
972 | |||
973 | if (write) | ||
974 | flags |= FOLL_WRITE; | ||
975 | if (force) | ||
976 | flags |= FOLL_FORCE; | ||
977 | |||
978 | return __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vmas, | 969 | return __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vmas, |
979 | NULL, false, flags); | 970 | NULL, false, |
971 | gup_flags | FOLL_TOUCH | FOLL_REMOTE); | ||
980 | } | 972 | } |
981 | EXPORT_SYMBOL(get_user_pages_remote); | 973 | EXPORT_SYMBOL(get_user_pages_remote); |
982 | 974 | ||