mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-14 09:09:56 +00:00
crypto: scatterwalk - Add no-copy support to copychunks
The function ablkcipher_done_slow is pretty much identical to scatterwalk_copychunks except that it doesn't actually copy as the processing hasn't been completed yet. This patch allows scatterwalk_copychunks to be used in this case by specifying out == 2. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
5506f53c7c
commit
85eccddee4
@ -87,9 +87,11 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
|
|||||||
if (len_this_page > nbytes)
|
if (len_this_page > nbytes)
|
||||||
len_this_page = nbytes;
|
len_this_page = nbytes;
|
||||||
|
|
||||||
vaddr = scatterwalk_map(walk);
|
if (out != 2) {
|
||||||
memcpy_dir(buf, vaddr, len_this_page, out);
|
vaddr = scatterwalk_map(walk);
|
||||||
scatterwalk_unmap(vaddr);
|
memcpy_dir(buf, vaddr, len_this_page, out);
|
||||||
|
scatterwalk_unmap(vaddr);
|
||||||
|
}
|
||||||
|
|
||||||
scatterwalk_advance(walk, len_this_page);
|
scatterwalk_advance(walk, len_this_page);
|
||||||
|
|
||||||
@ -99,7 +101,7 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
|
|||||||
buf += len_this_page;
|
buf += len_this_page;
|
||||||
nbytes -= len_this_page;
|
nbytes -= len_this_page;
|
||||||
|
|
||||||
scatterwalk_pagedone(walk, out, 1);
|
scatterwalk_pagedone(walk, out & 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(scatterwalk_copychunks);
|
EXPORT_SYMBOL_GPL(scatterwalk_copychunks);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user