diff options
author | Nick Piggin <npiggin@suse.de> | 2008-07-25 22:45:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 15:00:06 -0400 |
commit | f5dd33c494a427b1d1a3b574de5c9e511c888864 (patch) | |
tree | fc6f61ffe488fe044f9e167b31b1c4ecd5f3f54c | |
parent | 8174c430e445a93016ef18f717fe570214fa38bf (diff) |
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 <npiggin@suse.de>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Zach Brown <zach.brown@oracle.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Reviewed-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/bio.c | 8 | ||||
-rw-r--r-- | fs/direct-io.c | 10 |
2 files changed, 4 insertions, 14 deletions
@@ -721,12 +721,8 @@ static struct bio *__bio_map_user_iov(struct request_queue *q, | |||
721 | const int local_nr_pages = end - start; | 721 | const int local_nr_pages = end - start; |
722 | const int page_limit = cur_page + local_nr_pages; | 722 | const int page_limit = cur_page + local_nr_pages; |
723 | 723 | ||
724 | down_read(¤t->mm->mmap_sem); | 724 | ret = get_user_pages_fast(uaddr, local_nr_pages, |
725 | ret = get_user_pages(current, current->mm, uaddr, | 725 | write_to_vm, &pages[cur_page]); |
726 | local_nr_pages, | ||
727 | write_to_vm, 0, &pages[cur_page], NULL); | ||
728 | up_read(¤t->mm->mmap_sem); | ||
729 | |||
730 | if (ret < local_nr_pages) { | 726 | if (ret < local_nr_pages) { |
731 | ret = -EFAULT; | 727 | ret = -EFAULT; |
732 | goto out_unmap; | 728 | goto out_unmap; |
diff --git a/fs/direct-io.c b/fs/direct-io.c index 9e81addbd6ea..9606ee848fd8 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c | |||
@@ -150,17 +150,11 @@ static int dio_refill_pages(struct dio *dio) | |||
150 | int nr_pages; | 150 | int nr_pages; |
151 | 151 | ||
152 | nr_pages = min(dio->total_pages - dio->curr_page, DIO_PAGES); | 152 | nr_pages = min(dio->total_pages - dio->curr_page, DIO_PAGES); |
153 | down_read(¤t->mm->mmap_sem); | 153 | ret = get_user_pages_fast( |
154 | ret = get_user_pages( | ||
155 | current, /* Task for fault acounting */ | ||
156 | current->mm, /* whose pages? */ | ||
157 | dio->curr_user_address, /* Where from? */ | 154 | dio->curr_user_address, /* Where from? */ |
158 | nr_pages, /* How many pages? */ | 155 | nr_pages, /* How many pages? */ |
159 | dio->rw == READ, /* Write to memory? */ | 156 | dio->rw == READ, /* Write to memory? */ |
160 | 0, /* force (?) */ | 157 | &dio->pages[0]); /* Put results here */ |
161 | &dio->pages[0], | ||
162 | NULL); /* vmas */ | ||
163 | up_read(¤t->mm->mmap_sem); | ||
164 | 158 | ||
165 | if (ret < 0 && dio->blocks_available && (dio->rw & WRITE)) { | 159 | if (ret < 0 && dio->blocks_available && (dio->rw & WRITE)) { |
166 | struct page *page = ZERO_PAGE(0); | 160 | struct page *page = ZERO_PAGE(0); |