dio: use get_user_pages_fast

Use get_user_pages_fast in the common/generic block and fs direct IO paths.

Signed-off-by: Nick Piggin <[email protected]>
Cc: Dave Kleikamp <[email protected]>
Cc: Andy Whitcroft <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Dave Kleikamp <[email protected]>
Cc: Badari Pulavarty <[email protected]>
Cc: Zach Brown <[email protected]>
Cc: Jens Axboe <[email protected]>
Reviewed-by: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Nick Piggin 2008-07-25 19:45:25 -07:00 • committed by Linus Torvalds
commit f5dd33c494
2 changed files with 4 additions and 14 deletions

View file

@ -150,17 +150,11 @@ static int dio_refill_pages(struct dio *dio)
int nr_pages;
nr_pages = min(dio->total_pages - dio->curr_page, DIO_PAGES);
down_read(&current->mm->mmap_sem);
ret = get_user_pages(
current, /* Task for fault acounting */
current->mm, /* whose pages? */
ret = get_user_pages_fast(
dio->curr_user_address, /* Where from? */
nr_pages, /* How many pages? */
dio->rw == READ, /* Write to memory? */
0, /* force (?) */
&dio->pages[0],
NULL); /* vmas */
up_read(&current->mm->mmap_sem);
&dio->pages[0]); /* Put results here */
if (ret < 0 && dio->blocks_available && (dio->rw & WRITE)) {
struct page *page = ZERO_PAGE(0);