Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2460998rwe; Sun, 28 Aug 2022 12:08:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR44x6N61GwKGHij0bSwepWnV8q1qEAK0dHvxOtwhDS7ZC0W7p6qJzMU/cf5rv/O/2umAdat X-Received: by 2002:a17:906:505:b0:73d:b188:17d9 with SMTP id j5-20020a170906050500b0073db18817d9mr10875598eja.97.1661713733098; Sun, 28 Aug 2022 12:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661713733; cv=none; d=google.com; s=arc-20160816; b=GGtD9CxtRl8xW46tG+QUNDv3hmbi1BoyPxyDIkMmQcw/NKY3jwGna6A3tczd5OXJaB FZsF9ir7/iFQ39XQJ3b5ZS7U4d4SOn+L9SMtT1MTgPB9Q+VsyeP78dYCjDZ/7u2bSGGh ZbailNN9Y3snFn4hkCidnAFvA9JpWxKlmJ7n4pBW1Ysl3BfnuuqQWW7j83KccoIAM5hJ w03Y9JRvdDdYTjTyFCSMRnbFDE/TCz7BF82MwE5pzFejpRow6wfRp6+HY7qqEL78+YQS 0f+otsZ5F4KNs8T78N6OsXwIewRJwaz98hfTjiLuDT2zxMoKdkT2rqoQwwsaUVqOXH5k aBkA== 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; bh=+YKhgSGAmYoiid5CglWLrztt+nELhPnicQ/C/1JKfoU=; b=Cey/ocFUcoUYyZavELNPzld1KWVPsUVvKneeMnG5dQooKw6IEumI62v5ZHa9+NZxV+ FNm1e7RGDc0HeFamYZ46IXwlJe9gib54ejal3hj0Aen04dr/mMiVneMIw24PUVjzbhqI bxqHs/oZ5JAqSFHsmVUejTl6xzcx7YeYL5RZ/w2b8Bcz1sjUliZNeJZvFiodjjZEMm2/ w5mEgH/8V6QvjjI6OaCCAKs0Xz3+xadfoHNHVA3gAgnEa5BVJ9GvQwzcw+HUgYTejTWE 6CPc4XYAIHFoUAgjVrx0ItcyvrFpfLdwHI50aXHqHV3pJ6XykdxBlTO5W20712SU4xg9 aoHw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a056402254800b0043a9bb390d3si6315380edb.278.2022.08.28.12.08.13; Sun, 28 Aug 2022 12:08:53 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230041AbiH1Sux (ORCPT + 99 others); Sun, 28 Aug 2022 14:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230028AbiH1Suw (ORCPT ); Sun, 28 Aug 2022 14:50:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 520DEDF7A for ; Sun, 28 Aug 2022 11:50:51 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id F266BB8076E for ; Sun, 28 Aug 2022 18:50:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96DE9C433C1; Sun, 28 Aug 2022 18:50:48 +0000 (UTC) Subject: [PATCH v2 5/7] NFSD: Clean up WRITE arg decoders From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Sun, 28 Aug 2022 14:50:47 -0400 Message-ID: <166171264742.21449.12798598095676580927.stgit@manet.1015granger.net> In-Reply-To: <166171174172.21449.5036120183381273656.stgit@manet.1015granger.net> References: <166171174172.21449.5036120183381273656.stgit@manet.1015granger.net> User-Agent: StGit/1.5.dev2+g9ce680a5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 xdr_stream_subsegment() already returns a boolean value. Signed-off-by: Chuck Lever --- fs/nfsd/nfs3xdr.c | 4 +--- fs/nfsd/nfsxdr.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 71e32cf28885..3308dd671ef0 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c @@ -571,10 +571,8 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) args->count = max_blocksize; args->len = max_blocksize; } - if (!xdr_stream_subsegment(xdr, &args->payload, args->count)) - return false; - return true; + return xdr_stream_subsegment(xdr, &args->payload, args->count); } bool diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index aba8520b4b8b..caf6355b18fa 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c @@ -338,10 +338,8 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) return false; if (args->len > NFSSVC_MAXBLKSIZE_V2) return false; - if (!xdr_stream_subsegment(xdr, &args->payload, args->len)) - return false; - return true; + return xdr_stream_subsegment(xdr, &args->payload, args->len); } bool