Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2760823rdb; Mon, 4 Dec 2023 06:58:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOUxVmSSoNJNgXDINXqwEMAxyOgBHRLaPFLbpaT3up+bPOG6Ts2a2ZEY2Fx91fOddcY269 X-Received: by 2002:a05:6a00:2da7:b0:6ce:6448:4961 with SMTP id fb39-20020a056a002da700b006ce64484961mr449996pfb.12.1701701888257; Mon, 04 Dec 2023 06:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701701888; cv=none; d=google.com; s=arc-20160816; b=WNy3zAIfB11q0uYuqn1W5TJ1m/ECfNRyIsmp2D5vI5Gbo3cByRSb6xAGeNBnxU6wEK pye+9RWJ4dSRyvJQEUGFsNaIEgVbWoG2vLDLviFe8zjnmeiXxy0xqAOsFXWH++eOuZ/a NjA1BcDxHB5IWo8Xyc/62zjcVFZe63+h38ZY9CgUTIXldlFY6smLZvyJbRDhhTpXItCZ oK+3JjRwORsyNEtUMdUBlD1qEvvtxAFwY5MP2+XFW1RrCgfC2I1lj4/y5C2xNFWax0nY PkvVWL3McxR+hd7+kxjuAWWFmj5U0VI4zThO5UP9geKCet/k3BoBZEIReL9Bx4aYkuZu SUJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:cc:to:from:subject:dkim-signature; bh=4f3Bo/Y9vTYy6nhyjLTfwS8YbQyXgpG/RieDRQWYlzQ=; fh=WfGVbliYpqgzl5GprTVUBQR8rnRPHqjfX8LKlqDYYGk=; b=Nk0nJ9NqnIWPBPJTfcxcuNDiEejgpfbpDoXvKWJEV/l2baAbgk+WMUjSZiKjNDz92v KE5i9kwU4MTul77pqwv6O2fROUm1ubspHyeMdYB4ZVJ5WtXbaSkAmOKhhSxUpDf69b3n zs9B/WI/daFc0JX9fshw7HcO/ddL9oRwPs7FfHOhcS/noqWWrJEOcrUoutcXHoSpTq67 Fq8JzvRSkRNy81QmkqpSQHYwms7o9iZqehuOebMnevOh23yEzy9V/WS9jGYYxYXKE0bI IDcG8D9MVJSIwMp/PFucZwbYo17/HnVYfJSxIhqAtP8fZgYiPi9vi0uwxxpRSJRj+imT As5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S6Yz6U4F; spf=pass (google.com: domain of linux-nfs+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m16-20020a63fd50000000b00578aedd8e8bsi7596719pgj.716.2023.12.04.06.58.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 06:58:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S6Yz6U4F; spf=pass (google.com: domain of linux-nfs+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-291-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E946B2811B8 for ; Mon, 4 Dec 2023 14:58:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC1C228E1B; Mon, 4 Dec 2023 14:58:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S6Yz6U4F" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C901F28E07; Mon, 4 Dec 2023 14:58:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10CF4C433C7; Mon, 4 Dec 2023 14:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701701882; bh=Ifs1b4D+12H3+Xq1PAoVTzN+h3kpmD+g2y42gQChy20=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=S6Yz6U4FDnczDBvs+JWKwhddlLw3Ima2HA/1W5WGcX9+8m+Dck5FCUf2I8yd66zpg ardZGXYCRFgr1gvud7/rS/0OcjVLZsvdt0PXNdtGO3gk2MtnqCqkhRZjEpFjjzKPNU eBRVUT9k9PPfNR29jUgWPWGHqfOUvScx6lS6KwfQlxhU8T6wArMw/ZjWlrm3YlA++U PN4HUOHFmP8YfUJIis9dV874IihyUQkQt5tNuEwbRMj+W0xzFt7BK9bTc7Bo/1vmWF jo4HHqX+DSRTAoISw5d/kyb/guFqXuFEaAmCdEcFAxZoYId1AKV2vUW7JBcvxrWQXx uif43/kolt7Dg== Subject: [PATCH v1 16/21] svcrdma: Update synopsis of svc_rdma_copy_inline_range() From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Cc: tom@talpey.com Date: Mon, 04 Dec 2023 09:58:01 -0500 Message-ID: <170170188115.54779.13782774908081053344.stgit@bazille.1015granger.net> In-Reply-To: <170170144201.54779.9877683240030806819.stgit@bazille.1015granger.net> References: <170170144201.54779.9877683240030806819.stgit@bazille.1015granger.net> User-Agent: StGit/1.5 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit From: Chuck Lever Since the RDMA Read I/O state is now contained in the recv_ctxt, svc_rdma_copy_inline_range() can use that recv_ctxt to derive the read_info rather than the other way around. This removes another usage of the ri_readctxt field, enabling its removal in a subsequent patch. Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_rw.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_rw.c b/net/sunrpc/xprtrdma/svc_rdma_rw.c index 1953f3983695..ec546fe094e8 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_rw.c +++ b/net/sunrpc/xprtrdma/svc_rdma_rw.c @@ -778,7 +778,8 @@ static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp, /** * svc_rdma_copy_inline_range - Copy part of the inline content into pages - * @info: context for RDMA Reads + * @rqstp: RPC transaction context + * @head: context for ongoing I/O * @offset: offset into the Receive buffer of region to copy * @remaining: length of region to copy * @@ -791,13 +792,12 @@ static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp, * %0: Inline content was successfully copied * %-EINVAL: offset or length was incorrect */ -static int svc_rdma_copy_inline_range(struct svc_rdma_read_info *info, +static int svc_rdma_copy_inline_range(struct svc_rqst *rqstp, + struct svc_rdma_recv_ctxt *head, unsigned int offset, unsigned int remaining) { - struct svc_rdma_recv_ctxt *head = info->ri_readctxt; unsigned char *dst, *src = head->rc_recv_buf; - struct svc_rqst *rqstp = info->ri_rqst; unsigned int page_no, numpages; numpages = PAGE_ALIGN(head->rc_pageoff + remaining) >> PAGE_SHIFT; @@ -846,7 +846,8 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma, { struct svc_rdma_recv_ctxt *head = info->ri_readctxt; const struct svc_rdma_pcl *pcl = &head->rc_read_pcl; - struct xdr_buf *buf = &info->ri_rqst->rq_arg; + struct svc_rqst *rqstp = info->ri_rqst; + struct xdr_buf *buf = &rqstp->rq_arg; struct svc_rdma_chunk *chunk, *next; unsigned int start, length; int ret; @@ -854,7 +855,7 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma, start = 0; chunk = pcl_first_chunk(pcl); length = chunk->ch_position; - ret = svc_rdma_copy_inline_range(info, start, length); + ret = svc_rdma_copy_inline_range(rqstp, head, start, length); if (ret < 0) return ret; @@ -869,14 +870,14 @@ static noinline int svc_rdma_read_multiple_chunks(struct svcxprt_rdma *rdma, start += length; length = next->ch_position - head->rc_readbytes; - ret = svc_rdma_copy_inline_range(info, start, length); + ret = svc_rdma_copy_inline_range(rqstp, head, start, length); if (ret < 0) return ret; } start += length; length = head->rc_byte_len - start; - ret = svc_rdma_copy_inline_range(info, start, length); + ret = svc_rdma_copy_inline_range(rqstp, head, start, length); if (ret < 0) return ret;