Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2072070rdb; Mon, 9 Oct 2023 11:30:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvHGIOpWXr/TRrFfmlNaoRLXa/09/eZbmTFMX60sSYBESX2L2ax9rjMXLgrVbzyyUNciuT X-Received: by 2002:a17:90a:1549:b0:278:fe0e:4ffa with SMTP id y9-20020a17090a154900b00278fe0e4ffamr13437949pja.43.1696876213431; Mon, 09 Oct 2023 11:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696876213; cv=none; d=google.com; s=arc-20160816; b=0LnJhsRoOoeLnxPAMWHD3cN1bOPPOf4N1MvxZlomNIz4kKL0rMwCvCck0QUont2K2w ylPhaekoM8VtrcBNX6MtKJFnfUdgdjkSxTrNkYntPvVqstUsr8W/qJicN1as1psrD5Tg k+pd4g9hwwIyuj8nlDrVoWhrz6EQDs0qqsHsUmPmep4C4R36amFx8wOtgC/c8ecEzUEf JlB4A2TR0sAJFspIKDAJjB3/lUzItNVclfTX+FKhyqpr+xNhOadpTRd5k6mu+pO65OPO xZfWIBwiBFZgAK4fJdnfK7Ra1PdFfHVSIW2/lMS1R3wpnevNEQdBLvZulsJ4fZrW3YK9 JoBw== 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:cc:to:from :subject:dkim-signature; bh=gTdtvfxJm75e22qzPnWk9KT81CQ/H6+n/+DdMGtlO0I=; fh=v8a13lpFSZWlL4AptTEJnmXnlqoWXhGCGCgvrcnCT9I=; b=rP1zakZS27l4w2l4gqkdKo/8peCehlXNF0FsdPJ4bwFO0PlE++lldZHxowXSekkvqP S7KwfVMbuS4H++2tOfrVot0Tq1UgaTtLIYW/EW+EUm1xsybMA9BiKHNULQlsccbecWl3 P+GwZ8gd5re7mtkNwX1xrobMle8Jv9lIOzW3Ksh6mKQWht+XKCzB137mPxYCy6oWjffh Fp9Uhd0JyNnpl7ARLjM4qKaaR3M2rPVUUDyA0QBQQPsOytH6NETWld/sqoxfDbFqcVRb rnFkWsX5yyLixK0tW17CYAkepRZX0ihhxcPJd2b7RJrufg4/uCxiMXjgWMGdCxP1DVnU 7Sgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LsMwdsD3; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bk10-20020a17090b080a00b00277374d74afsi12010265pjb.12.2023.10.09.11.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 11:30:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LsMwdsD3; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DDCDE80BD3AF; Mon, 9 Oct 2023 11:29:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377192AbjJIS3r (ORCPT + 99 others); Mon, 9 Oct 2023 14:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376869AbjJIS3q (ORCPT ); Mon, 9 Oct 2023 14:29:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27536B4 for ; Mon, 9 Oct 2023 11:29:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A62FC433C8; Mon, 9 Oct 2023 18:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696876184; bh=6nTLJHx2/14yKGDUldzyFSRiFJm32DyRgvE2BstkfHQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=LsMwdsD3HfSH3riuWeNtpvT7qSPE7IoJhMjA/zvq+r7JYbam+IOlbXTnVNnObMsDp wwfNBneuZuSfYvPJ81/w7eLh30QHaWVA869mhZ62p+/SOw5wLUbMaGIh3vU9P+XOIX BpK6kjSFQt3VY/1U5zaFs85veMpcOhx4Km8RnJydkMJn+rUinjzYBKQNuc4KSFCb/Q RSGBYi2wfCjY7OSiScqT+cCaxDlASaM/44X/9zdd4NiTOj9c+B+OKXur+O4ein+1hi oFQRUZRRkWbqi2SPySHO07V60cvar7efksUuImsz7Z6RVcObi+bDvybyTUl0Mdi3ah 9jU8snIawvVbw== Subject: [PATCH v1 1/8] NFSD: Clean up nfsd4_encode_access() From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 09 Oct 2023 14:29:43 -0400 Message-ID: <169687618325.41382.10496558152702883607.stgit@oracle-102.nfsv4bat.org> In-Reply-To: <169687606447.41382.568611605570999245.stgit@oracle-102.nfsv4bat.org> References: <169687606447.41382.568611605570999245.stgit@oracle-102.nfsv4bat.org> 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=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 11:29:48 -0700 (PDT) X-Spam-Level: ** From: Chuck Lever Convert nfsd4_encode_access() to use modern XDR utility functions. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4xdr.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 5efcd9691e5d..12a1254c5f54 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -3904,14 +3904,14 @@ nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr, { struct nfsd4_access *access = &u->access; struct xdr_stream *xdr = resp->xdr; - __be32 *p; + __be32 status; - p = xdr_reserve_space(xdr, 8); - if (!p) - return nfserr_resource; - *p++ = cpu_to_be32(access->ac_supported); - *p++ = cpu_to_be32(access->ac_resp_access); - return 0; + /* supported */ + status = nfsd4_encode_uint32_t(xdr, access->ac_supported); + if (status != nfs_ok) + return status; + /* access */ + return nfsd4_encode_uint32_t(xdr, access->ac_resp_access); } static __be32 nfsd4_encode_bind_conn_to_session(struct nfsd4_compoundres *resp, __be32 nfserr,