Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp503521pxv; Wed, 14 Jul 2021 08:51:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVrM3I560gReS/tW0jOwueZ/+xRRkPYtEptRxFBuPUnp30341L5SdXrnlQ4mJ6XaNyLGUj X-Received: by 2002:a05:6e02:1c2d:: with SMTP id m13mr6892020ilh.137.1626277861001; Wed, 14 Jul 2021 08:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626277860; cv=none; d=google.com; s=arc-20160816; b=uuKSVDS5B3uV2Ot25jFbh5eXCUV6i8+aHcGuD/RsZxSfHi0I1GLrFloWNP5Ekd6hSG va1xFVq9YLkm+qke6ZqJsFVGIKMMB84czpDas5u649C0ujh68h9X34Pj1zzdfVrKhN21 9ECSYza3b/pUd2sjS/fNNGEtmUfVF7V78k7IIRzOuFEGMzWVgIDaKfuNH1Tq8dV6XkAU po/YTRh9f8B3O4hp3AP5hkFylZ7ZD5AVdkSozwjiv0s01LLV8m1y5x1NLEN6z18gPDIe JjerWspdRdy2njHiQFJ3z59ZLrslnY5q9hAhPm6nUh+fJn4sDYORvoyI7K5VkG3b+D67 3kwQ== 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=bC0x0QkH5xyB0H3qAjoK54WQ2QcTjMjFR+NyxNxns0w=; b=bw350HHeJtucPrUmi5aSfEb5grVdtf9XwaBqa1/07wIEfGcYfqC5Bg8C+keQ9LhIhD 8U3Caorf3TGzyjVv8HxCTZGa6Kmmr/Pr6L6m15FUjuShM/SHpJ7eFRskpW8qxA42xTjU r9dllfiprJKzevZcAtLVIixkJ5yjhhb85ywDuoZnLhET0eV7CGrrhlSp+BhVDsgINm78 YU7qs/GQxMxbIF7Ms0jfvwAjJDSx6+9DVmIeHM6XYNPmjfg5wwMhYu8UfD4JDFDrxY+E GAHp5LW+Y3MNHND+BtmtvxrCJfpZhXgJYcZr7P4P3Wxh9ASAZSarcyD4yveawhT8W6nz zx0Q== 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 t3si2943506iof.33.2021.07.14.08.50.48; Wed, 14 Jul 2021 08:51:00 -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 S239625AbhGNPxW (ORCPT + 99 others); Wed, 14 Jul 2021 11:53:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:41174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239755AbhGNPxW (ORCPT ); Wed, 14 Jul 2021 11:53:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4BF596128D for ; Wed, 14 Jul 2021 15:50:30 +0000 (UTC) Subject: [PATCH RFC 3/4] SUNRPC: Refactor rpc_ping() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Wed, 14 Jul 2021 11:50:29 -0400 Message-ID: <162627782960.1294.3463877806680579818.stgit@manet.1015granger.net> In-Reply-To: <162627611661.1294.9189768423517916152.stgit@manet.1015granger.net> References: <162627611661.1294.9189768423517916152.stgit@manet.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 Make it use the rpc_null_call_helper() so that it can share the new rpc_call_ops structure to be introduced in the next patch. Signed-off-by: Chuck Lever --- net/sunrpc/clnt.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 8b4de70e8ead..ca2000d8cf64 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -2694,17 +2694,6 @@ static const struct rpc_procinfo rpcproc_null = { .p_decode = rpcproc_decode_null, }; -static int rpc_ping(struct rpc_clnt *clnt) -{ - struct rpc_message msg = { - .rpc_proc = &rpcproc_null, - }; - int err; - err = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT | RPC_TASK_SOFTCONN | - RPC_TASK_NULLCREDS); - return err; -} - static struct rpc_task *rpc_call_null_helper(struct rpc_clnt *clnt, struct rpc_xprt *xprt, struct rpc_cred *cred, int flags, @@ -2733,6 +2722,19 @@ struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, int } EXPORT_SYMBOL_GPL(rpc_call_null); +static int rpc_ping(struct rpc_clnt *clnt) +{ + struct rpc_task *task; + int status; + + task = rpc_call_null_helper(clnt, NULL, NULL, 0, NULL, NULL); + if (IS_ERR(task)) + return PTR_ERR(task); + status = task->tk_status; + rpc_put_task(task); + return status; +} + struct rpc_cb_add_xprt_calldata { struct rpc_xprt_switch *xps; struct rpc_xprt *xprt;