[PATCH 01/26] cris: Convert cryptocop to use get_user_pages_fast()

From: Jan Kara
Date: Wed Oct 02 2013 - 10:31:13 EST


CC: linux-cris-kernel@xxxxxxxx
CC: Mikael Starvik <starvik@xxxxxxxx>
CC: Jesper Nilsson <jesper.nilsson@xxxxxxxx>
Signed-off-by: Jan Kara <jack@xxxxxxx>
---
arch/cris/arch-v32/drivers/cryptocop.c | 35 ++++++++++------------------------
1 file changed, 10 insertions(+), 25 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index 877da1908234..df7ceeff1086 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -2716,43 +2716,28 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
}
}

- /* Acquire the mm page semaphore. */
- down_read(&current->mm->mmap_sem);
-
- err = get_user_pages(current,
- current->mm,
- (unsigned long int)(oper.indata + prev_ix),
- noinpages,
- 0, /* read access only for in data */
- 0, /* no force */
- inpages,
- NULL);
+ err = get_user_pages_fast((unsigned long)(oper.indata + prev_ix),
+ noinpages,
+ 0, /* read access only for in data */
+ inpages);

if (err < 0) {
- up_read(&current->mm->mmap_sem);
nooutpages = noinpages = 0;
- DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages indata\n"));
+ DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages_fast indata\n"));
goto error_cleanup;
}
noinpages = err;
if (oper.do_cipher){
- err = get_user_pages(current,
- current->mm,
- (unsigned long int)oper.cipher_outdata,
- nooutpages,
- 1, /* write access for out data */
- 0, /* no force */
- outpages,
- NULL);
- up_read(&current->mm->mmap_sem);
+ err = get_user_pages_fast((unsigned long)oper.cipher_outdata,
+ nooutpages,
+ 1, /* write access for out data */
+ outpages);
if (err < 0) {
nooutpages = 0;
- DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages outdata\n"));
+ DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages_fast outdata\n"));
goto error_cleanup;
}
nooutpages = err;
- } else {
- up_read(&current->mm->mmap_sem);
}

/* Add 6 to nooutpages to make room for possibly inserted buffers for storing digest and
--
1.8.1.4

--
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/