From patchwork Wed Jul 27 18:43:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 9250309 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 24C3060757 for ; Wed, 27 Jul 2016 18:45:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14E51237A5 for ; Wed, 27 Jul 2016 18:45:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09BD925D91; Wed, 27 Jul 2016 18:45:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2A03237A5 for ; Wed, 27 Jul 2016 18:45:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757929AbcG0SpN (ORCPT ); Wed, 27 Jul 2016 14:45:13 -0400 Received: from mx142.netapp.com ([216.240.21.19]:55629 "EHLO mx142.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757963AbcG0SpI (ORCPT ); Wed, 27 Jul 2016 14:45:08 -0400 X-IronPort-AV: E=Sophos;i="5.28,430,1464678000"; d="scan'208";a="126545942" Received: from vmwexchts04-prd.hq.netapp.com ([10.122.105.32]) by mx142-out.netapp.com with ESMTP; 27 Jul 2016 11:45:08 -0700 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCHTS04-PRD.hq.netapp.com (10.122.105.32) with Microsoft SMTP Server id 15.0.1210.3; Wed, 27 Jul 2016 11:45:06 -0700 Received: from rhel7-2-ga-2.androsad.fake (andros-new.vpn.netapp.com [10.55.74.172]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id u6RIj2pK010724; Wed, 27 Jul 2016 11:45:07 -0700 (PDT) From: To: CC: , , Andy Adamson Subject: [PATCH Version 7 6/8] SUNRPC add an RPC null call to test session trunking connection Date: Wed, 27 Jul 2016 14:43:18 -0400 Message-ID: <1469645000-19791-7-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1469645000-19791-1-git-send-email-andros@netapp.com> References: <1469645000-19791-1-git-send-email-andros@netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andy Adamson Signed-off-by: Andy Adamson --- include/linux/sunrpc/clnt.h | 2 ++ net/sunrpc/clnt.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 99410bb..ebc83df 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -189,6 +189,8 @@ int rpc_clnt_test_and_add_xprt(struct rpc_clnt *clnt, struct rpc_xprt_switch *xps, struct rpc_xprt *xprt, void *dummy); +int rpc_clnt_test_xprt(struct rpc_clnt *clnt, + struct rpc_xprt *xprt); int rpc_clnt_add_xprt(struct rpc_clnt *, struct xprt_create *, int (*setup)(struct rpc_clnt *, struct rpc_xprt_switch *, diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 459f9b1..822060f 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -2614,6 +2614,24 @@ int rpc_clnt_test_and_add_xprt(struct rpc_clnt *clnt, } EXPORT_SYMBOL_GPL(rpc_clnt_test_and_add_xprt); +int rpc_clnt_test_xprt(struct rpc_clnt *clnt, struct rpc_xprt *xprt) +{ + struct rpc_cred *cred; + struct rpc_task *task; + int status; + + cred = authnull_ops.lookup_cred(NULL, NULL, 0); + task = rpc_call_null_helper(clnt, xprt, cred, + RPC_TASK_SOFT | RPC_TASK_SOFTCONN, NULL, NULL); + put_rpccred(cred); + if (IS_ERR(task)) + return PTR_ERR(task); + status = task->tk_status; + rpc_put_task(task); + return status; +} +EXPORT_SYMBOL_GPL(rpc_clnt_test_xprt); + /** * rpc_clnt_add_xprt - Add a new transport to a rpc_clnt * @clnt: pointer to struct rpc_clnt