Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3990096rwa; Tue, 23 Aug 2022 14:03:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR70PWFUO/aTwh6ufXEl1KGFlVnUjaCb7X2oJhaiNn1ExtkqITgPeYUO7RATUhEBHPRZFV9Y X-Received: by 2002:a17:907:e91:b0:73d:a99a:7944 with SMTP id ho17-20020a1709070e9100b0073da99a7944mr889019ejc.216.1661288607412; Tue, 23 Aug 2022 14:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661288607; cv=none; d=google.com; s=arc-20160816; b=cSFqpVMHiP27b8xcKRExhccnK1sLsL9kWnqPAbM3X6dpOjLY8HVZxfKp9lC34XE69X lRJfo2Pb2KhmcvfbkgQqxaiInVun2nlEXeR579C3oFcgEL3g5ziLfFQNLLoEc2Dv3zRJ 9UYr019OhYhCF8e5E0500mib/YOAUjTlw1Ol1j+DEBwb1SrF9ZtwdV1O2YxfNUwvpgkw DNGfMscfOA7ElpxqQ07gw0oR7Mv2uW3Afv7BU1PzOOC1WmXG6Id4AANIYdrIwjmBtmlv J4eRtqeFHPRatJcTt0GIALNzcU2LzpZC3Eh1R1ue/vBOZKEOA/keXTxmxz5HdXa4kxmU NFhg== 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=RtsFr5PrpLkz79oZF9b5Q7Rjq3z1/jWvHA1akvCfwKF9Q43sigQaCPEz+FREV4eMve xufn3vEHoVuTAPC1QeIZ7RagXjzZPE6Mq1WuMkaml4+sTek3sN3KWTB6CHMxKvoUhG6W zB9DKXkocz/FPfDGB9Umw2HqV9KRZ5CrEb1PQ3h/+Z1X04ZnRkZUrEHF9G4qVNseU4nK J0P0gYHTniSu832Ok98bTdoS0uNA4nc3xE4Cjt6aep7b/lSD++XM3dBVqVWzpz6vr2qE wCKpafu7XtnBW0HiqtDuy6hXK6qlucAEJHH1RXT+Gq71RWfYmnMj89GuH1RTZ+R6pQON Djng== 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 qq25-20020a17090720d900b0073d64fca704si448230ejb.36.2022.08.23.14.02.51; Tue, 23 Aug 2022 14:03:27 -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 S230270AbiHWVAn (ORCPT + 99 others); Tue, 23 Aug 2022 17:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbiHWVAh (ORCPT ); Tue, 23 Aug 2022 17:00:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5559579A75 for ; Tue, 23 Aug 2022 14:00:36 -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 70812B82185 for ; Tue, 23 Aug 2022 21:00:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A68CC433C1; Tue, 23 Aug 2022 21:00:33 +0000 (UTC) Subject: [PATCH v1 5/7] NFSD: Clean up WRITE arg decoders From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Tue, 23 Aug 2022 17:00:32 -0400 Message-ID: <166128843291.2788.7684141655548514185.stgit@manet.1015granger.net> In-Reply-To: <166128840714.2788.7887913547062461761.stgit@manet.1015granger.net> References: <166128840714.2788.7887913547062461761.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