Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3039539pxv; Mon, 12 Jul 2021 07:55:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6GId8+wHkML10KYSmdtjdwmQQMra8b5w6EUl0FWrybTOCPqRTp6O2EAqWXUNME5VFx4fQ X-Received: by 2002:a17:907:7256:: with SMTP id ds22mr6973834ejc.363.1626101753341; Mon, 12 Jul 2021 07:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626101753; cv=none; d=google.com; s=arc-20160816; b=vthJyPIehHihdo80s8l/C2u1l9Ykp5reKVi8E9Hs6YpGXaci9E3/hnqQTYa9xSgY3q 9t/7hAk6KFZB3khhUxxm1gb+rK0op2aIIxx1bNaA9M2mN/BZIKz6KbxDQI6aoVapr9ag 7Zi7/82rM0yCFa7vMQc1aB7OZo2zcO9Ss9/axofUx0ZJ95SlB9Ngru2z6Qsq9ZyaYQMq 4qroIB86rJa3hpPQbioEFgqCItiTGlcVg8XM4zzklxmxgR4aGMsOl/SOcalNPMAMZfTZ cQJa/Ya9sSwIbUUZsR1nsHus84s784R/HfKPyeLoJlpPCJEtv+N0ZNUf/kCEVC10JTk+ b/xQ== 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=zP8Wa8rAucOCdh9s0DXy+16pgVAIy6xJJJU65rSv3S0=; b=kkc3SRsT7WRl8EZqzmDfFog0PaU6j+8CIzklJFMFbJkbpote5dV0O8CVE7COa4bOox YXuv4rFREIuMIMvBMZEPGZ8JC+C4ZLPVvM6SeLCi1ipAega70QnVvTGDrQ/Jffp6w41g VYWXuxuahfMz2xhu+hkL/j4wSqsiBHDXnIvYfh3pFEOs0Q4q6hnVNqZZfbGa1D0Ajgja rUt1Z5ZhwNnmWdwFJLU8luQyW0K2Aw7WBgBgqMqjwfZ1fNBCxViI470/+4rhkE/i9CuL /iVTmcSrfRGjVi/jdyeXQJDfNtFJmzR+kE8Vw4ZpuDL8+jPPPrWXZYEPCzfG/2fekdMj 5FQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 7si17027162ejh.506.2021.07.12.07.55.29; Mon, 12 Jul 2021 07:55:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 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 S235301AbhGLOzu (ORCPT + 99 others); Mon, 12 Jul 2021 10:55:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:38784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235268AbhGLOzr (ORCPT ); Mon, 12 Jul 2021 10:55:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB11E6120A for ; Mon, 12 Jul 2021 14:52:58 +0000 (UTC) Subject: [PATCH RFC 7/7] NFS: Clean up the synopsis of callback process_op() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Mon, 12 Jul 2021 10:52:58 -0400 Message-ID: <162610157805.2466.12384910841009517253.stgit@klimt.1015granger.net> In-Reply-To: <162610122257.2466.7452891285800059767.stgit@klimt.1015granger.net> References: <162610122257.2466.7452891285800059767.stgit@klimt.1015granger.net> User-Agent: StGit/1.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org The xdr_stream and rq_arg and rq_res are already accessible via the @rqstp parameter. Signed-off-by: Chuck Lever --- fs/nfs/callback_xdr.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 19bbe8fc6cc2..6958ff1c2c29 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -854,17 +854,16 @@ preprocess_nfs4_op(unsigned int op_nr, struct callback_op **op) } static __be32 process_op(int nop, struct svc_rqst *rqstp, - struct xdr_stream *xdr_in, void *argp, - struct xdr_stream *xdr_out, void *resp, - struct cb_process_state *cps) + struct cb_process_state *cps) { + struct xdr_stream *xdr_out = &rqstp->rq_res_stream; struct callback_op *op = &callback_ops[0]; unsigned int op_nr; __be32 status; long maxlen; __be32 res; - status = decode_op_hdr(xdr_in, &op_nr); + status = decode_op_hdr(&rqstp->rq_arg_stream, &op_nr); if (unlikely(status)) return status; @@ -894,9 +893,11 @@ static __be32 process_op(int nop, struct svc_rqst *rqstp, maxlen = xdr_out->end - xdr_out->p; if (maxlen > 0 && maxlen < PAGE_SIZE) { - status = op->decode_args(rqstp, xdr_in, argp); + status = op->decode_args(rqstp, &rqstp->rq_arg_stream, + rqstp->rq_argp); if (likely(status == 0)) - status = op->process_op(argp, resp, cps); + status = op->process_op(rqstp->rq_argp, rqstp->rq_resp, + cps); } else status = htonl(NFS4ERR_RESOURCE); @@ -905,7 +906,7 @@ static __be32 process_op(int nop, struct svc_rqst *rqstp, if (unlikely(res)) return res; if (op->encode_res != NULL && status == 0) - status = op->encode_res(rqstp, xdr_out, resp); + status = op->encode_res(rqstp, xdr_out, rqstp->rq_resp); return status; } @@ -950,9 +951,7 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp) return rpc_system_err; } while (status == 0 && nops != hdr_arg.nops) { - status = process_op(nops, rqstp, &rqstp->rq_arg_stream, - rqstp->rq_argp,&rqstp->rq_res_stream, - rqstp->rq_resp, &cps); + status = process_op(nops, rqstp, &cps); nops++; }