summaryrefslogtreecommitdiffstats
path: root/include/crypto/if_alg.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-06-06 15:08:52 +0200
committerPaolo Abeni <pabeni@redhat.com>2023-06-08 13:42:34 +0200
commitc1abe6f570aff4b6d396dc551e60570d2f50bd79 (patch)
tree6ebe19d7b367fc188a31ed82de08b0a430d8402e /include/crypto/if_alg.h
parentcrypto: af_alg: Pin pages rather than ref'ing if appropriate (diff)
downloadlinux-c1abe6f570aff4b6d396dc551e60570d2f50bd79.tar.xz
linux-c1abe6f570aff4b6d396dc551e60570d2f50bd79.zip
crypto: af_alg: Use extract_iter_to_sg() to create scatterlists
Use extract_iter_to_sg() to decant the destination iterator into a scatterlist in af_alg_get_rsgl(). af_alg_make_sg() can then be removed. 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>
Diffstat (limited to 'include/crypto/if_alg.h')
-rw-r--r--include/crypto/if_alg.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index 46494b33f5bc..34224e77f5a2 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -56,9 +56,8 @@ struct af_alg_type {
};
struct af_alg_sgl {
- struct scatterlist sg[ALG_MAX_PAGES + 1];
- struct page *pages[ALG_MAX_PAGES];
- unsigned int npages;
+ struct sg_table sgt;
+ struct scatterlist sgl[ALG_MAX_PAGES + 1];
bool need_unpin;
};
@@ -164,7 +163,6 @@ int af_alg_release(struct socket *sock);
void af_alg_release_parent(struct sock *sk);
int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern);
-int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len);
void af_alg_free_sg(struct af_alg_sgl *sgl);
static inline struct alg_sock *alg_sk(struct sock *sk)