diff options
Diffstat (limited to 'arch/sparc/mm/gup.c')
-rw-r--r-- | arch/sparc/mm/gup.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/sparc/mm/gup.c b/arch/sparc/mm/gup.c index 1aed0432c64b..ae6ce383d4df 100644 --- a/arch/sparc/mm/gup.c +++ b/arch/sparc/mm/gup.c | |||
@@ -160,6 +160,36 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end, | |||
160 | return 1; | 160 | return 1; |
161 | } | 161 | } |
162 | 162 | ||
163 | int __get_user_pages_fast(unsigned long start, int nr_pages, int write, | ||
164 | struct page **pages) | ||
165 | { | ||
166 | struct mm_struct *mm = current->mm; | ||
167 | unsigned long addr, len, end; | ||
168 | unsigned long next, flags; | ||
169 | pgd_t *pgdp; | ||
170 | int nr = 0; | ||
171 | |||
172 | start &= PAGE_MASK; | ||
173 | addr = start; | ||
174 | len = (unsigned long) nr_pages << PAGE_SHIFT; | ||
175 | end = start + len; | ||
176 | |||
177 | local_irq_save(flags); | ||
178 | pgdp = pgd_offset(mm, addr); | ||
179 | do { | ||
180 | pgd_t pgd = *pgdp; | ||
181 | |||
182 | next = pgd_addr_end(addr, end); | ||
183 | if (pgd_none(pgd)) | ||
184 | break; | ||
185 | if (!gup_pud_range(pgd, addr, next, write, pages, &nr)) | ||
186 | break; | ||
187 | } while (pgdp++, addr = next, addr != end); | ||
188 | local_irq_restore(flags); | ||
189 | |||
190 | return nr; | ||
191 | } | ||
192 | |||
163 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 193 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
164 | struct page **pages) | 194 | struct page **pages) |
165 | { | 195 | { |