Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3749602pxv; Mon, 19 Jul 2021 07:54:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNO5HHjHNRA6S/WTfsLcspZ41Gr9ZPaKtgzl5aFyTqw1PzgMdbfsksZGTRklLrWIMvhhv1 X-Received: by 2002:a17:906:2a8e:: with SMTP id l14mr27559280eje.321.1626706494101; Mon, 19 Jul 2021 07:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626706494; cv=none; d=google.com; s=arc-20160816; b=dfeVAtdKo6iKOTQI8ePcrvlTChnhfcqPGNEZ/KD+jyZGmwYLTgApWdtf1V0F+01lZl TZ3R/PpDg7U81eJhI1MDhX98I1K6X8v75B13Ty6hWlNtVW/+K6yUTI1F7AvzxC8kiGuQ 4NtPwQagUqeygrGzIK8vROLA2fkmCaBER13aGDS8N8MEYJqaLg50mUV2zx+AmZ132WKw 3jYBpEKIcg8/sIcd6CmwIt/KAQVAlxhvPCPcU6OKA8AqXhNVLKzjPnWam6BAf/ARcY6q JNpJOy5EXU3q3WVXsDjvFKMPzOISgP87IXd18OgOJ4WUZIrTCbACopxKXT0QrLi8YA6K HFrQ== 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; bh=bC0x0QkH5xyB0H3qAjoK54WQ2QcTjMjFR+NyxNxns0w=; b=0/grAcxco6Rq91bl75HbfUvt5ZdPj/C7w1Zm5MLNN6M+1/FP8BwKx8tC17afc5bhOl 7NSpTq0dVjgs2WCFn1NH5epOjzSx3UgxKBhrc+E0YCmSL3ZXLYXymFTYmomMvqle/Ex5 U0SI582acmz9kxj+AiVn1+4G2zgRpt1KX9YLioQqFFXVmbzlM6FDndOjlep5/DLrARoj 96MFi9hVvJ5Wa2RREiBpgfzY74VVZxV4Cp5exVS6nsQotye+2gRjY60cLL283w2Ouj8Z u1MSmAgGylI5mV6xxR5mvVrFUtTXJd13KQGN9SDwkLft2Yj+pSViH/kkgjBvcBhGBCkC 336w== 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 y6si6261617edd.522.2021.07.19.07.54.31; Mon, 19 Jul 2021 07:54:54 -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 S232597AbhGSONp (ORCPT + 99 others); Mon, 19 Jul 2021 10:13:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:45462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232059AbhGSONp (ORCPT ); Mon, 19 Jul 2021 10:13:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B3688610D2; Mon, 19 Jul 2021 14:48:04 +0000 (UTC) Subject: [PATCH v2 1/6] SUNRPC: Refactor rpc_ping() From: Chuck Lever To: trondmy@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Date: Mon, 19 Jul 2021 10:48:04 -0400 Message-ID: <162670608397.468132.13660340202537302059.stgit@manet.1015granger.net> In-Reply-To: <162670594361.468132.16222376053830760696.stgit@manet.1015granger.net> References: <162670594361.468132.16222376053830760696.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;