Skip to content

Commit 9a949e8

Browse files
author
Al Viro
committed
cris: switch to get_user_pages_fast()
no point holding ->mmap_sem over both calls. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent c803c9c commit 9a949e8

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

arch/cris/arch-v32/drivers/cryptocop.c

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,37 +2717,28 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
27172717
}
27182718
}
27192719

2720-
/* Acquire the mm page semaphore. */
2721-
down_read(&current->mm->mmap_sem);
2722-
2723-
err = get_user_pages((unsigned long int)(oper.indata + prev_ix),
2720+
err = get_user_pages_fast((unsigned long)(oper.indata + prev_ix),
27242721
noinpages,
2725-
0, /* read access only for in data */
2726-
inpages,
2727-
NULL);
2722+
false, /* read access only for in data */
2723+
inpages);
27282724

27292725
if (err < 0) {
2730-
up_read(&current->mm->mmap_sem);
27312726
nooutpages = noinpages = 0;
27322727
DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages indata\n"));
27332728
goto error_cleanup;
27342729
}
27352730
noinpages = err;
2736-
if (oper.do_cipher){
2737-
err = get_user_pages((unsigned long int)oper.cipher_outdata,
2731+
if (oper.do_cipher) {
2732+
err = get_user_pages_fast((unsigned long)oper.cipher_outdata,
27382733
nooutpages,
2739-
FOLL_WRITE, /* write access for out data */
2740-
outpages,
2741-
NULL);
2742-
up_read(&current->mm->mmap_sem);
2734+
true, /* write access for out data */
2735+
outpages);
27432736
if (err < 0) {
27442737
nooutpages = 0;
27452738
DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages outdata\n"));
27462739
goto error_cleanup;
27472740
}
27482741
nooutpages = err;
2749-
} else {
2750-
up_read(&current->mm->mmap_sem);
27512742
}
27522743

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

0 commit comments

Comments
 (0)