Commit 9a949e8f authored by Al Viro's avatar Al Viro

cris: switch to get_user_pages_fast()

no point holding ->mmap_sem over both calls.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c803c9c6
...@@ -2717,37 +2717,28 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig ...@@ -2717,37 +2717,28 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
} }
} }
/* Acquire the mm page semaphore. */ err = get_user_pages_fast((unsigned long)(oper.indata + prev_ix),
down_read(&current->mm->mmap_sem);
err = get_user_pages((unsigned long int)(oper.indata + prev_ix),
noinpages, noinpages,
0, /* read access only for in data */ false, /* read access only for in data */
inpages, inpages);
NULL);
if (err < 0) { if (err < 0) {
up_read(&current->mm->mmap_sem);
nooutpages = noinpages = 0; nooutpages = noinpages = 0;
DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages indata\n")); DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages indata\n"));
goto error_cleanup; goto error_cleanup;
} }
noinpages = err; noinpages = err;
if (oper.do_cipher){ if (oper.do_cipher) {
err = get_user_pages((unsigned long int)oper.cipher_outdata, err = get_user_pages_fast((unsigned long)oper.cipher_outdata,
nooutpages, nooutpages,
FOLL_WRITE, /* write access for out data */ true, /* write access for out data */
outpages, outpages);
NULL);
up_read(&current->mm->mmap_sem);
if (err < 0) { if (err < 0) {
nooutpages = 0; nooutpages = 0;
DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages outdata\n")); DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages outdata\n"));
goto error_cleanup; goto error_cleanup;
} }
nooutpages = err; nooutpages = err;
} else {
up_read(&current->mm->mmap_sem);
} }
/* Add 6 to nooutpages to make room for possibly inserted buffers for storing digest and /* Add 6 to nooutpages to make room for possibly inserted buffers for storing digest and
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment