Commit 345ee3e8 authored by David Howells's avatar David Howells Committed by Jakub Kicinski

algif: Remove hash_sendpage*()

Remove hash_sendpage*() as nothing should now call it since the rewrite of
splice_to_socket()[1].
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
cc: Herbert Xu <herbert@gondor.apana.org.au>
cc: Jens Axboe <axboe@kernel.dk>
cc: Matthew Wilcox <willy@infradead.org>
Link: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=2dc334f1a63a8839b88483a3e73c0f27c9c1791c [1]
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a3bbdc52
...@@ -161,58 +161,6 @@ static int hash_sendmsg(struct socket *sock, struct msghdr *msg, ...@@ -161,58 +161,6 @@ static int hash_sendmsg(struct socket *sock, struct msghdr *msg,
goto unlock; goto unlock;
} }
static ssize_t hash_sendpage(struct socket *sock, struct page *page,
int offset, size_t size, int flags)
{
struct sock *sk = sock->sk;
struct alg_sock *ask = alg_sk(sk);
struct hash_ctx *ctx = ask->private;
int err;
if (flags & MSG_SENDPAGE_NOTLAST)
flags |= MSG_MORE;
lock_sock(sk);
sg_init_table(ctx->sgl.sgl, 1);
sg_set_page(ctx->sgl.sgl, page, size, offset);
if (!(flags & MSG_MORE)) {
err = hash_alloc_result(sk, ctx);
if (err)
goto unlock;
} else if (!ctx->more)
hash_free_result(sk, ctx);
ahash_request_set_crypt(&ctx->req, ctx->sgl.sgl, ctx->result, size);
if (!(flags & MSG_MORE)) {
if (ctx->more)
err = crypto_ahash_finup(&ctx->req);
else
err = crypto_ahash_digest(&ctx->req);
} else {
if (!ctx->more) {
err = crypto_ahash_init(&ctx->req);
err = crypto_wait_req(err, &ctx->wait);
if (err)
goto unlock;
}
err = crypto_ahash_update(&ctx->req);
}
err = crypto_wait_req(err, &ctx->wait);
if (err)
goto unlock;
ctx->more = flags & MSG_MORE;
unlock:
release_sock(sk);
return err ?: size;
}
static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
int flags) int flags)
{ {
...@@ -328,7 +276,6 @@ static struct proto_ops algif_hash_ops = { ...@@ -328,7 +276,6 @@ static struct proto_ops algif_hash_ops = {
.release = af_alg_release, .release = af_alg_release,
.sendmsg = hash_sendmsg, .sendmsg = hash_sendmsg,
.sendpage = hash_sendpage,
.recvmsg = hash_recvmsg, .recvmsg = hash_recvmsg,
.accept = hash_accept, .accept = hash_accept,
}; };
...@@ -380,18 +327,6 @@ static int hash_sendmsg_nokey(struct socket *sock, struct msghdr *msg, ...@@ -380,18 +327,6 @@ static int hash_sendmsg_nokey(struct socket *sock, struct msghdr *msg,
return hash_sendmsg(sock, msg, size); return hash_sendmsg(sock, msg, size);
} }
static ssize_t hash_sendpage_nokey(struct socket *sock, struct page *page,
int offset, size_t size, int flags)
{
int err;
err = hash_check_key(sock);
if (err)
return err;
return hash_sendpage(sock, page, offset, size, flags);
}
static int hash_recvmsg_nokey(struct socket *sock, struct msghdr *msg, static int hash_recvmsg_nokey(struct socket *sock, struct msghdr *msg,
size_t ignored, int flags) size_t ignored, int flags)
{ {
...@@ -430,7 +365,6 @@ static struct proto_ops algif_hash_ops_nokey = { ...@@ -430,7 +365,6 @@ static struct proto_ops algif_hash_ops_nokey = {
.release = af_alg_release, .release = af_alg_release,
.sendmsg = hash_sendmsg_nokey, .sendmsg = hash_sendmsg_nokey,
.sendpage = hash_sendpage_nokey,
.recvmsg = hash_recvmsg_nokey, .recvmsg = hash_recvmsg_nokey,
.accept = hash_accept_nokey, .accept = hash_accept_nokey,
}; };
......
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