diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2018-04-13 18:35:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-13 20:10:27 -0400 |
commit | d081107867b85cc7454b9d4f5aea47f65bcf06d1 (patch) | |
tree | 4cd38640b68f5b53262a2a1e354e3c6efc131103 /mm/util.c | |
parent | c61611f70958d86f659bca25c02ae69413747a8d (diff) |
mm/gup.c: document return value
__get_user_pages_fast handles errors differently from
get_user_pages_fast: the former always returns the number of pages
pinned, the later might return a negative error code.
Link: http://lkml.kernel.org/r/1522962072-182137-6-git-send-email-mst@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Thorsten Leemhuis <regressions@leemhuis.info>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -297,8 +297,10 @@ void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack) | |||
297 | /* | 297 | /* |
298 | * Like get_user_pages_fast() except its IRQ-safe in that it won't fall | 298 | * Like get_user_pages_fast() except its IRQ-safe in that it won't fall |
299 | * back to the regular GUP. | 299 | * back to the regular GUP. |
300 | * If the architecture not support this function, simply return with no | 300 | * Note a difference with get_user_pages_fast: this always returns the |
301 | * page pinned | 301 | * number of pages pinned, 0 if no pages were pinned. |
302 | * If the architecture does not support this function, simply return with no | ||
303 | * pages pinned. | ||
302 | */ | 304 | */ |
303 | int __weak __get_user_pages_fast(unsigned long start, | 305 | int __weak __get_user_pages_fast(unsigned long start, |
304 | int nr_pages, int write, struct page **pages) | 306 | int nr_pages, int write, struct page **pages) |