lkml.org 
[lkml]   [2013]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 01/26] cris: Convert cryptocop to use get_user_pages_fast()
Date
CC: linux-cris-kernel@axis.com
CC: Mikael Starvik <starvik@axis.com>
CC: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
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


\
 
 \ /
  Last update: 2013-10-02 16:41    [W:0.026 / U:5.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site