diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-21 10:46:39 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-21 10:46:54 +0200 |
commit | 8ecee4620e76aae418bfa0e8cc830e92cb559bbb (patch) | |
tree | 49a36784c0a26c8494a37087e37502101013b35d /arch/x86/mm/gup.c | |
parent | 6424fb38667fffbbb1b90be0ffd9a0c540db6a4b (diff) | |
parent | a939b96cccdb65df80a52447ec8e4a6d79c56dbb (diff) |
Merge branch 'linus' into x86/mm
Merge reason: refresh the topic: there's been 290 non-merges commits upstream
to arch/x86 alone.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/gup.c')
-rw-r--r-- | arch/x86/mm/gup.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index be54176e9eb..6340cef6798 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c @@ -219,6 +219,22 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end, return 1; } +/** + * get_user_pages_fast() - pin user pages in memory + * @start: starting user address + * @nr_pages: number of pages from start to pin + * @write: whether pages will be written to + * @pages: array that receives pointers to the pages pinned. + * Should be at least nr_pages long. + * + * Attempt to pin user pages in memory without taking mm->mmap_sem. + * If not successful, it will fall back to taking the lock and + * calling get_user_pages(). + * + * Returns number of pages pinned. This may be fewer than the number + * requested. If nr_pages is 0 or negative, returns 0. If no pages + * were pinned, returns -errno. + */ int get_user_pages_fast(unsigned long start, int nr_pages, int write, struct page **pages) { |