From patchwork Thu Mar 16 15:26:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13177822 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08401C6FD19 for ; Thu, 16 Mar 2023 15:27:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E22F294000D; Thu, 16 Mar 2023 11:27:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D83B694000A; Thu, 16 Mar 2023 11:27:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C4D1B94000D; Thu, 16 Mar 2023 11:27:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A719C94000A for ; Thu, 16 Mar 2023 11:27:30 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6E431ABC40 for ; Thu, 16 Mar 2023 15:27:30 +0000 (UTC) X-FDA: 80575140660.15.9375740 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 39111140018 for ; Thu, 16 Mar 2023 15:27:28 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NMQu4bpN; spf=pass (imf26.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678980448; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zb6mFnKCVLQu6xBmdV/ljtXgUzSvLJ/bZitog7Xho38=; b=jdFjJ4elY0hdquzogrtYm3nboAzMVTdNLopBJ8O5iuEhnKyb3VZwA50cs65e7f2tT4OzbO NVKoi0LFETq3kLpaJ1vrEtHB356RIkrvjnQ5b6PN8rSmWw84mVv5iOXq8MnU1ukJYgq6JX 3GbL0Ihrmk8wUOfa4hPNU5xkbt3a/gc= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NMQu4bpN; spf=pass (imf26.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678980448; a=rsa-sha256; cv=none; b=MgZ+IYFIhoPSeIQmmw/v1zrvD7DVRLgUY3Ijiweksa4lSUUusvQfEE4znGgnRJU75h26ri z1XJkPa0zUcj6nPcNf15qcqTXFs7Ed5P7f1Fgf0DgLz0ZXGwQy9/XAxLdU7bIZ4JJ9XPr2 LVeMP+vWxXFwtVJHrkoY8JcJPeHbRYU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678980447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zb6mFnKCVLQu6xBmdV/ljtXgUzSvLJ/bZitog7Xho38=; b=NMQu4bpNobpBTUVnGaqnv7jVeB+Qb0O4YSoquuxZLzWZnnOVWRtQANRHH9iyN5pyQbmcB4 4KPnFgFMXQ6Y3qFEHMQc4/V1U3w4gjlClDZPbHUlBCJgy78DyPJeECzswaI9pgbYx+lYA1 qCYCYZVbc0yCm3/+WqWvofZdzjbgj14= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-Wn_Xf5sGMh2vYcAXsHUQRQ-1; Thu, 16 Mar 2023 11:27:24 -0400 X-MC-Unique: Wn_Xf5sGMh2vYcAXsHUQRQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4CD3857FB3; Thu, 16 Mar 2023 15:27:23 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8B7C140EBF4; Thu, 16 Mar 2023 15:27:21 +0000 (UTC) From: David Howells To: Matthew Wilcox , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: David Howells , Al Viro , Christoph Hellwig , Jens Axboe , Jeff Layton , Christian Brauner , Linus Torvalds , netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Herbert Xu , linux-crypto@vger.kernel.org Subject: [RFC PATCH 23/28] algif: Remove hash_sendpage*() Date: Thu, 16 Mar 2023 15:26:13 +0000 Message-Id: <20230316152618.711970-24-dhowells@redhat.com> In-Reply-To: <20230316152618.711970-1-dhowells@redhat.com> References: <20230316152618.711970-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: pmzprgcf8rtqwe8iz7xsoh4ud8rhr36h X-Rspamd-Queue-Id: 39111140018 X-HE-Tag: 1678980448-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ERzOkffarnpsEGf7MSZJ8suuahIM/7Q1ND5IbKhvGNiRaTRO7uswoU8lPc11XHKC3DX1YvTCaKTOlqvRLtETVvr1QXQqc2ooiF1FAAkG0io0DQv/hy3j+ic2vVOUV6nU+LAS4TDQlZMX3FUOJSQYakcFTuLDFICCHXoh90qkBa3NAJkI3Z0EcY3gg2W6WDz5NAjdQEIfLlwVdd5ZE+hw5pO5B02NFtVG/Ilhd4UE5sbCbaxzzK0Vq8tGfOAe28UOc6xegBcIQuGpo0vSo4YwFWqeZ0aj4dgK6TqDYI+x86ZmeXX++GnFu45wsms3by+KWee1JHy+1E7rprcllUQ0mr4JzhtkBejycM/zvNTWH/ztTRzFy7H+RBZa6qb+e03yXAO1eCLPvWmmvdeP4M92n/bDKysM5AEwr1UUSgSVb91TS3f/3b1jwmyA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Remove hash_sendpage*() and use hash_sendmsg() as the latter seems to just use the source pages directly anyway. Signed-off-by: David Howells cc: Herbert Xu cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org --- crypto/algif_hash.c | 66 --------------------------------------------- 1 file changed, 66 deletions(-) diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index 1d017ec5c63c..52f5828a054a 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c @@ -129,58 +129,6 @@ static int hash_sendmsg(struct socket *sock, struct msghdr *msg, return err ?: copied; } -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.sg, 1); - sg_set_page(ctx->sgl.sg, 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.sg, 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, int flags) { @@ -285,7 +233,6 @@ static struct proto_ops algif_hash_ops = { .release = af_alg_release, .sendmsg = hash_sendmsg, - .sendpage = hash_sendpage, .recvmsg = hash_recvmsg, .accept = hash_accept, }; @@ -337,18 +284,6 @@ static int hash_sendmsg_nokey(struct socket *sock, struct msghdr *msg, 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, size_t ignored, int flags) { @@ -387,7 +322,6 @@ static struct proto_ops algif_hash_ops_nokey = { .release = af_alg_release, .sendmsg = hash_sendmsg_nokey, - .sendpage = hash_sendpage_nokey, .recvmsg = hash_recvmsg_nokey, .accept = hash_accept_nokey, };