Commit d2dfbe47 authored by Liu Xiang's avatar Liu Xiang Committed by Linus Torvalds

mm/gup.c: fix comments of __get_user_pages() and get_user_pages_remote()

Fix comments of __get_user_pages() and get_user_pages_remote(), make
them more clear.

Link: http://lkml.kernel.org/r/1572443533-3118-1-git-send-email-liuxiang_1999@126.comSigned-off-by: default avatarLiu Xiang <liuxiang_1999@126.com>
Suggested-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b96cc655
...@@ -734,11 +734,17 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags) ...@@ -734,11 +734,17 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags)
* Or NULL if the caller does not require them. * Or NULL if the caller does not require them.
* @nonblocking: whether waiting for disk IO or mmap_sem contention * @nonblocking: whether waiting for disk IO or mmap_sem contention
* *
* Returns number of pages pinned. This may be fewer than the number * Returns either number of pages pinned (which may be less than the
* requested. If nr_pages is 0 or negative, returns 0. If no pages * number requested), or an error. Details about the return value:
* were pinned, returns -errno. Each page returned must be released *
* with a put_page() call when it is finished with. vmas will only * -- If nr_pages is 0, returns 0.
* remain valid while mmap_sem is held. * -- If nr_pages is >0, but no pages were pinned, returns -errno.
* -- If nr_pages is >0, and some pages were pinned, returns the number of
* pages pinned. Again, this may be less than nr_pages.
*
* The caller is responsible for releasing returned @pages, via put_page().
*
* @vmas are valid only as long as mmap_sem is held.
* *
* Must be called with mmap_sem held. It may be released. See below. * Must be called with mmap_sem held. It may be released. See below.
* *
...@@ -1107,11 +1113,17 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk, ...@@ -1107,11 +1113,17 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
* 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.
* *
* Returns number of pages pinned. This may be fewer than the number * Returns either number of pages pinned (which may be less than the
* requested. If nr_pages is 0 or negative, returns 0. If no pages * number requested), or an error. Details about the return value:
* were pinned, returns -errno. Each page returned must be released *
* with a put_page() call when it is finished with. vmas will only * -- If nr_pages is 0, returns 0.
* remain valid while mmap_sem is held. * -- If nr_pages is >0, but no pages were pinned, returns -errno.
* -- If nr_pages is >0, and some pages were pinned, returns the number of
* pages pinned. Again, this may be less than nr_pages.
*
* The caller is responsible for releasing returned @pages, via put_page().
*
* @vmas are valid only as long as mmap_sem is held.
* *
* Must be called with mmap_sem held for read or write. * Must be called with mmap_sem held for read or write.
* *
......
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