Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5111168rwl; Sun, 8 Jan 2023 08:45:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXskNMp1VmzEIGjZvxmfLquRbKRI5Cfw7jlFN0CnDAHcoProMi83LWzU8cNBavUvuY+Yezwm X-Received: by 2002:a17:907:d08d:b0:7aa:76a:fb3 with SMTP id vc13-20020a170907d08d00b007aa076a0fb3mr59798993ejc.66.1673196335683; Sun, 08 Jan 2023 08:45:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673196335; cv=none; d=google.com; s=arc-20160816; b=kyZhp9CyIruQvPdzMDvjZgCmMThdvkIpfgE+SAjlxWQ6+slZA0QM2kiD4GxmMnZAi+ Zh6czfWd/9ijUoKyWClRYHsuOQrEbYH1IFyT0KB5UYh0q1e8AhFoBMkSSY7bHV/n5N3V 1BdBpUFaVMvgpe7DFT8R3M+097WQCTuZKJNw9yGMh0yQjysRf8Wys/2BdBU4v98rOV5E hYdi3G9rfbkz3BCROQGAKRb8RrZZ9g5koVXsCqGgGh6vE4DGaRLk3l94rFaCgcgZExSG +3QH3si3ytveoJUSVi2EQkX944ELkonmStq6SRyDj3WFfsnE9fncvu46FK8DB7kKA23O 7iRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject :dkim-signature; bh=8y4GwKLG5Yyt74Ajx2OCbvME1xB7PJT6hzKJngCkJew=; b=nWAL0Sn8D7GQuFKy6bU36OF8EDo3/eav4+21pBfHDQA/jco5SB68885oDmKcRXzOO6 DU3hauvtfN5zYT41FvV0EAdI6NjK6kre1vklQFZPi8EfvGFllVsz2B/K2ziBAX9QIXKW n0dtNvGT6nbEi4D1GSxgXj975hP5GJYXCNzAebACVaTLSG/FFYT7uL8sYLYXEmCy6Rvr xyGCVjJiiIrrHQ97Q1KWC7cneXb7iIHtX8NN9Uz8TrJ4sotGS9r1P3yP09XXNTQc1LFQ 1ZK5lmYZGVJffoMEiUp3JYEcUph5qJRQJs9/T6XzgufIE0DXzuQq7UNnmqTb43Dj5ofr MMxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g0edeSs0; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs10-20020a1709073e8a00b0084cf7670a53si7511874ejc.257.2023.01.08.08.45.12; Sun, 08 Jan 2023 08:45:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g0edeSs0; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233381AbjAHQbY (ORCPT + 99 others); Sun, 8 Jan 2023 11:31:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236238AbjAHQaz (ORCPT ); Sun, 8 Jan 2023 11:30:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFF33D125 for ; Sun, 8 Jan 2023 08:30:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 692FE60C8C for ; Sun, 8 Jan 2023 16:30:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB683C433F0 for ; Sun, 8 Jan 2023 16:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673195453; bh=4lC584jtj171PekqVOHcolTWrxY4SdAn+3yqCcCk0+g=; h=Subject:From:To:Date:In-Reply-To:References:From; b=g0edeSs0MTF5aU8hk0E+qpBs/6lL4yA0eQfrnLsF4pqqTVwTcHK8YRQnF9pTwCVfZ W6EDNL2l/2BgMHeFGHDnZEPogslgpVKPDseI4Zka1RGegjAvGHq0m+b/gMlnAepA62 caq6GWlkQ32awQZ5+ei+gHdUTLYiuZg1SgmuDzXYPRu5+JkzfOYwPMdI/7ysdIsmxK epd/u/vjq1hNgfhJfzR8qyfXy0JzJcZdp8AE+bIfhNdkxi0iyEWpcEQQiyv/mxWEyx R/N7r7Ax2hxOMJ24wtEzQPEMrHmZT2XaFGek6i2CHEI6EPFWBIBVO4gDw3+hd2lTaL s2JT+VajNP0LQ== Subject: [PATCH v1 24/27] SUNRPC: Remove no-longer-used helper functions From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Sun, 08 Jan 2023 11:30:52 -0500 Message-ID: <167319545290.7490.4776771429759719974.stgit@bazille.1015granger.net> In-Reply-To: <167319499150.7490.2294168831574653380.stgit@bazille.1015granger.net> References: <167319499150.7490.2294168831574653380.stgit@bazille.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Chuck Lever The svc_get/put helpers are no longer used. Signed-off-by: Chuck Lever --- include/linux/sunrpc/svc.h | 66 +------------------------------------------- 1 file changed, 1 insertion(+), 65 deletions(-) diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index dd9f68acd9f1..32eb98e621c3 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -193,40 +193,6 @@ extern u32 svc_max_payload(const struct svc_rqst *rqstp); #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE \ + 2 + 1) -static inline u32 svc_getnl(struct kvec *iov) -{ - __be32 val, *vp; - vp = iov->iov_base; - val = *vp++; - iov->iov_base = (void*)vp; - iov->iov_len -= sizeof(__be32); - return ntohl(val); -} - -static inline void svc_putnl(struct kvec *iov, u32 val) -{ - __be32 *vp = iov->iov_base + iov->iov_len; - *vp = htonl(val); - iov->iov_len += sizeof(__be32); -} - -static inline __be32 svc_getu32(struct kvec *iov) -{ - __be32 val, *vp; - vp = iov->iov_base; - val = *vp++; - iov->iov_base = (void*)vp; - iov->iov_len -= sizeof(__be32); - return val; -} - -static inline void svc_putu32(struct kvec *iov, __be32 val) -{ - __be32 *vp = iov->iov_base + iov->iov_len; - *vp = val; - iov->iov_len += sizeof(__be32); -} - /* * The context of a single thread, including the request currently being * processed. @@ -345,29 +311,6 @@ static inline struct sockaddr *svc_daddr(const struct svc_rqst *rqst) return (struct sockaddr *) &rqst->rq_daddr; } -/* - * Check buffer bounds after decoding arguments - */ -static inline int -xdr_argsize_check(struct svc_rqst *rqstp, __be32 *p) -{ - char *cp = (char *)p; - struct kvec *vec = &rqstp->rq_arg.head[0]; - return cp >= (char*)vec->iov_base - && cp <= (char*)vec->iov_base + vec->iov_len; -} - -static inline int -xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p) -{ - struct kvec *vec = &rqstp->rq_res.head[0]; - char *cp = (char*)p; - - vec->iov_len = cp - (char*)vec->iov_base; - - return vec->iov_len <= PAGE_SIZE; -} - static inline void svc_free_res_pages(struct svc_rqst *rqstp) { while (rqstp->rq_next_page != rqstp->rq_respages) { @@ -540,9 +483,6 @@ static inline void svc_reserve_auth(struct svc_rqst *rqstp, int space) * svcxdr_init_decode - Prepare an xdr_stream for Call decoding * @rqstp: controlling server RPC transaction context * - * This function currently assumes the RPC header in rq_arg has - * already been decoded. Upon return, xdr->p points to the - * location of the upper layer header. */ static inline void svcxdr_init_decode(struct svc_rqst *rqstp) { @@ -550,11 +490,7 @@ static inline void svcxdr_init_decode(struct svc_rqst *rqstp) struct xdr_buf *buf = &rqstp->rq_arg; struct kvec *argv = buf->head; - /* - * svc_getnl() and friends do not keep the xdr_buf's ::len - * field up to date. Refresh that field before initializing - * the argument decoding stream. - */ + WARN_ON(buf->len != buf->head->iov_len + buf->page_len + buf->tail->iov_len); buf->len = buf->head->iov_len + buf->page_len + buf->tail->iov_len; xdr_init_decode(xdr, buf, argv->iov_base, NULL);