Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5783932rwn; Mon, 12 Sep 2022 14:25:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR5i1Lyq/ddauuR+MPaT7ZfdorZYZ/Zu69JKc6hUk1+xpiMc/1unoAVEz5I06SKmobJpQu1v X-Received: by 2002:a17:902:e841:b0:177:82b6:e6f7 with SMTP id t1-20020a170902e84100b0017782b6e6f7mr27189938plg.66.1663017915730; Mon, 12 Sep 2022 14:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663017915; cv=none; d=google.com; s=arc-20160816; b=RflwUh0jCkb2VIZkC6f6j747ZPtzf7YZTtPUdKBfq1lj+NvyryB3Sbi4qmcI3czJR5 qYGypT7IFqNQjgZwDt570kj5kmDCRq29ylmwIoZzGNjv8bFDrNKoG01J33MTF8lbhtGI lmnrWajbg0jbuPOsjq7TX8z/EKng2H+5g1TLPINtgDYWVG6Bnr+cVrcJfzZss/Hk/CwH +asy4MIELglAAxI2G/O5vK03jkc6JD4VXKu/eAzMc2UIzq/5X7mYo8sWlbXnDXivFMV7 o/lUX4erfT4RBxO99AXxup0+dE/MGquqCBoqZ6n6m69W0XI46+gTSH5skje3LUOray6n 6HGQ== 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=5ukN2PdM2vyZjeKaHRsxsSlu4jzcMKpj/CRTJNXLQLw=; b=ceeUpj9IKJHREUx2z+KiN+3EYqkxEOy09IbgKsWIBm5FjPNw248WaMG3LEYo+33VHD +sv8sQ4XuKkU1TIPrSN1bT6gad59HHH5kLzzuundZIMYsEToLSo79l/bv69DHv46932I JgO7TG2b9jqUm+WU9wmj4ACY7/nidR1pxzFZcoeCx+JmZVNS3GZzTXhYR1f/DNy7egNc 7I4RWp/OwjVGG7FP02AbQVTbh3La72T8v/Q7CTDUZ5JvfD+cTHaCQOsYTl/UJw5gfHpY XHLFUSrdgXV8N9fvN75rIhYI8yUjRlI0X5M4G1FXPbyEx2SCFv3SjCzbO6prqUQOkRMB JsgA== 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 hk2-20020a17090b224200b00202c5a9bf44si6062966pjb.174.2022.09.12.14.25.02; Mon, 12 Sep 2022 14:25:15 -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 S229697AbiILVXN (ORCPT + 99 others); Mon, 12 Sep 2022 17:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbiILVXM (ORCPT ); Mon, 12 Sep 2022 17:23:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A5DA2AC65 for ; Mon, 12 Sep 2022 14:23:11 -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 E37C7B80D87 for ; Mon, 12 Sep 2022 21:23:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88A60C433D6 for ; Mon, 12 Sep 2022 21:23:08 +0000 (UTC) Subject: [PATCH v1 07/12] NFSD: Clean up WRITE arg decoders From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Mon, 12 Sep 2022 17:23:07 -0400 Message-ID: <166301778775.89884.9482171937924136523.stgit@oracle-102.nfsv4.dev> In-Reply-To: <166301759113.89884.7985359396842428444.stgit@oracle-102.nfsv4.dev> References: <166301759113.89884.7985359396842428444.stgit@oracle-102.nfsv4.dev> 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=-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. Reviewed-by: Jeff Layton 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