From patchwork Mon Oct 9 18:29:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13414249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7B39CD611D for ; Mon, 9 Oct 2023 18:29:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377192AbjJIS3r (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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,