Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2072288rdb; Mon, 9 Oct 2023 11:30:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzzw4VIKrL0ggdfSggpyAwa3MUMQ6Fbw4i2HBwoWPujiFhDKAkmdZstR+cgaxr7TuRUuC0 X-Received: by 2002:a17:90b:e18:b0:27c:e21b:7251 with SMTP id ge24-20020a17090b0e1800b0027ce21b7251mr205260pjb.46.1696876238464; Mon, 09 Oct 2023 11:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696876238; cv=none; d=google.com; s=arc-20160816; b=DekHEgv26mmbuUkigjWlmV3UpuAndC6E/tQFTCM7sTjI3imdGbPcCLQI4KPUwjC1fC BS++qFmzvMNVq8Q9hHP35Z627WVaQQF9pzLOTnWYR/QYQj75axJFLUo84eDhHUXNd+7O ZLoZt8grvxSkzzPAXfWz0OJgWtSK44Ale+CPtbAbvt7RcNJ5cUAbyyxdewzmWQECVHB0 KMqmIr8KhiKy8jI43GeHi3IyGRI80UWwcDFzAKx97m/t3vul5MYsO707We0/Oj7H9Uzh xkbRtOxejrc3d3OsKKRbAobUL58B3U/WqipQmsO+N8bCT36KgwigX3XJ1r/iQjyDZEGW d7lw== 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=BKWY/g7G/PZ/OOjcKAwiCogUjrB55rAC4Umg3viG30M=; fh=v8a13lpFSZWlL4AptTEJnmXnlqoWXhGCGCgvrcnCT9I=; b=yexURtafhYgMQCt19zEk4OAElDv1yQI5g7g+aGj7b5HN8iUCeqJsSy0ZsS73aGZPdE ezj/BF4fPvkGMSay+IgKwzmVM0G9W0f5T21QJi7N0MVTjJ6oBwojxHYdQ6gsWErgdvJa DF2qtJcQ7OuVPm5ghghsnmqlfaIP+IfE674/CFa+mipAxfK0H4lZA4BjGSyBU4dNFzPD puFX9C/g/jfU7w4IUNQXOsyuwz8fICmwEje30w7cwKbtufCZhPZDLfn3XKCpzWeSX1Wj OPtr85nkLWVPD0NJQe/b1hSx1H30sqNANxbnSPEKAYuqVp/WvtM6L7zcbobq0OaT9gI3 Hfww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MmymIRzr; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id gb17-20020a17090b061100b00273ede74018si9648946pjb.187.2023.10.09.11.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 11:30:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MmymIRzr; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id CF10E801B182; Mon, 9 Oct 2023 11:30:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377449AbjJISae (ORCPT + 99 others); Mon, 9 Oct 2023 14:30:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377548AbjJISad (ORCPT ); Mon, 9 Oct 2023 14:30:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3AF99D for ; Mon, 9 Oct 2023 11:30:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 051ECC433C8; Mon, 9 Oct 2023 18:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696876231; bh=JIlB3tyiflJzxYg5dXRDhQGfdHiKDSpiF0IskHBLqOI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=MmymIRzrgb/K/m+ytBKFmMRFTjdeClhy5OPHF4BdEuiptWm0klIqLlOOT9aiwFxjI RkxMUgtProdGs0CCMP7RGyw8hdXf7DANBTSbLSIiK2354p97RYyd57moK/eP/q124x B5elf49gzG7FTpMX/i1TrP/OR59fxCB26prU3qsW2c+Xh03sQv2JhmwxKMGiGBWMG1 GI4zn0DG3J2OjhdDVSHssp20G7IMioL64vxl+AgFVnrCvzvCBQgvOrvuqWJBtDKTIt ImkYEOLRGcLf4GYPMVxS6Bxa7uoywyd42x07Wb3UdbvnCmyeyuy6aVzVyzyF2pe1dV 3lqavWG/esesQ== Subject: [PATCH v1 8/8] NFSD: Clean up nfsd4_encode_seek() From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 09 Oct 2023 14:30:29 -0400 Message-ID: <169687622974.41382.2552596663702800716.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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 11:30:35 -0700 (PDT) X-Spam-Level: ** From: Chuck Lever Use modern XDR encoder utilities. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4xdr.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index c87e7c5de592..1961223d2642 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -5275,13 +5275,14 @@ nfsd4_encode_seek(struct nfsd4_compoundres *resp, __be32 nfserr, union nfsd4_op_u *u) { struct nfsd4_seek *seek = &u->seek; - __be32 *p; - - p = xdr_reserve_space(resp->xdr, 4 + 8); - *p++ = cpu_to_be32(seek->seek_eof); - p = xdr_encode_hyper(p, seek->seek_pos); + struct xdr_stream *xdr = resp->xdr; - return 0; + /* sr_eof */ + nfserr = nfsd4_encode_bool(xdr, seek->seek_eof); + if (nfserr != nfs_ok) + return nfserr; + /* sr_offset */ + return nfsd4_encode_offset4(xdr, seek->seek_pos); } static __be32