From patchwork Mon May 3 15:25:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 12236279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34941C433B4 for ; Mon, 3 May 2021 15:25:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED009611CE for ; Mon, 3 May 2021 15:25:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbhECP0f (ORCPT ); Mon, 3 May 2021 11:26:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:43074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230382AbhECP0e (ORCPT ); Mon, 3 May 2021 11:26:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DD4AE61176 for ; Mon, 3 May 2021 15:25:40 +0000 (UTC) Subject: [PATCH v1 28/29] lockd: Update the NLMv4 nlm_res results encoder to use struct xdr_stream From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Mon, 03 May 2021 11:25:40 -0400 Message-ID: <162005554002.23028.11148499715257938138.stgit@klimt.1015granger.net> In-Reply-To: <162005520101.23028.15766816408658851498.stgit@klimt.1015granger.net> References: <162005520101.23028.15766816408658851498.stgit@klimt.1015granger.net> User-Agent: StGit/1.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Signed-off-by: Chuck Lever --- fs/lockd/xdr4.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c index 9b8a7afb935c..efdede71b951 100644 --- a/fs/lockd/xdr4.c +++ b/fs/lockd/xdr4.c @@ -344,24 +344,23 @@ nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p) } int -nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p) +nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p) { + struct xdr_stream *xdr = &rqstp->rq_res_stream; struct nlm_res *resp = rqstp->rq_resp; - if (!(p = nlm4_encode_cookie(p, &resp->cookie))) - return 0; - *p++ = resp->status; - *p++ = xdr_zero; /* sequence argument */ - return xdr_ressize_check(rqstp, p); + return svcxdr_encode_cookie(xdr, &resp->cookie) && + svcxdr_encode_stats(xdr, resp->status); } int -nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p) +nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p) { struct nlm_res *resp = rqstp->rq_resp; if (!(p = nlm4_encode_cookie(p, &resp->cookie))) return 0; *p++ = resp->status; + *p++ = xdr_zero; /* sequence argument */ return xdr_ressize_check(rqstp, p); }