mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
crypto: af_alg/hash: Support MSG_SPLICE_PAGES
Make AF_ALG sendmsg() support MSG_SPLICE_PAGES in the hashing code. This causes pages to be spliced from the source iterator if possible. This allows ->sendpage() to be replaced by something that can handle multiple multipage folios in a single transaction. Signed-off-by: David Howells <dhowells@redhat.com> cc: Herbert Xu <herbert@gondor.apana.org.au> cc: "David S. Miller" <davem@davemloft.net> cc: Eric Dumazet <edumazet@google.com> cc: Jakub Kicinski <kuba@kernel.org> cc: Paolo Abeni <pabeni@redhat.com> cc: Jens Axboe <axboe@kernel.dk> cc: Matthew Wilcox <willy@infradead.org> cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
fb800fa4c1
commit
c662b043cd
@@ -542,9 +542,14 @@ void af_alg_free_sg(struct af_alg_sgl *sgl)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (sgl->need_unpin)
|
||||
for (i = 0; i < sgl->sgt.nents; i++)
|
||||
unpin_user_page(sg_page(&sgl->sgt.sgl[i]));
|
||||
if (sgl->sgt.sgl) {
|
||||
if (sgl->need_unpin)
|
||||
for (i = 0; i < sgl->sgt.nents; i++)
|
||||
unpin_user_page(sg_page(&sgl->sgt.sgl[i]));
|
||||
if (sgl->sgt.sgl != sgl->sgl)
|
||||
kvfree(sgl->sgt.sgl);
|
||||
sgl->sgt.sgl = NULL;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(af_alg_free_sg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user