[PATCH] dma: get_user_pages -> get_user_pages_fast

From: Michael S. Tsirkin
Date: Mon Oct 11 2010 - 12:59:40 EST


There doesn't seem to be any advantage to using
get_user_pages, so switch iovlock to get_user_pages_fast
instead.

Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
---

Lightly tested. This patch is on top of the bugfix patch I posted
previously.

drivers/dma/iovlock.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/iovlock.c b/drivers/dma/iovlock.c
index 21ed8f3..c6917e8 100644
--- a/drivers/dma/iovlock.c
+++ b/drivers/dma/iovlock.c
@@ -95,17 +95,11 @@ struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len)
pages += page_list->nr_pages;

/* pin pages down */
- down_read(&current->mm->mmap_sem);
- ret = get_user_pages(
- current,
- current->mm,
+ ret = get_user_pages_fast(
(unsigned long) iov[i].iov_base,
page_list->nr_pages,
1, /* write */
- 0, /* force */
- page_list->pages,
- NULL);
- up_read(&current->mm->mmap_sem);
+ page_list->pages);

if (unlikely(ret < 0))
goto unpin;
--
1.7.3-rc1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/