All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olga Kornievskaia <olga.kornievskaia@gmail.com>
To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v2 1/3] SUNRPC query xprt switch for number of active transports
Date: Wed,  9 Jun 2021 17:53:17 -0400	[thread overview]
Message-ID: <20210609215319.5518-2-olga.kornievskaia@gmail.com> (raw)
In-Reply-To: <20210609215319.5518-1-olga.kornievskaia@gmail.com>

From: Olga Kornievskaia <kolga@netapp.com>

To keep track of how many transports have already been added, add
ability to query the number.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 include/linux/sunrpc/clnt.h |  2 ++
 net/sunrpc/clnt.c           | 13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 02e7a5863d28..27042f1e581f 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -234,6 +234,8 @@ void rpc_clnt_xprt_switch_put(struct rpc_clnt *);
 void rpc_clnt_xprt_switch_add_xprt(struct rpc_clnt *, struct rpc_xprt *);
 bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt,
 			const struct sockaddr *sap);
+size_t rpc_clnt_xprt_switch_nactive(struct rpc_clnt *);
+
 void rpc_cleanup_clids(void);
 
 static inline int rpc_reply_expected(struct rpc_task *task)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 42623d6b8f0e..b46262ffcf72 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2959,6 +2959,19 @@ bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt,
 }
 EXPORT_SYMBOL_GPL(rpc_clnt_xprt_switch_has_addr);
 
+size_t rpc_clnt_xprt_switch_nactive(struct rpc_clnt *clnt)
+{
+	struct rpc_xprt_switch *xps;
+	size_t num;
+
+	rcu_read_lock();
+	xps = rcu_dereference(clnt->cl_xpi.xpi_xpswitch);
+	num = xps->xps_nactive;
+	rcu_read_unlock();
+	return num;
+}
+EXPORT_SYMBOL_GPL(rpc_clnt_xprt_switch_nactive);
+
 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
 static void rpc_show_header(void)
 {
-- 
2.27.0


  reply	other threads:[~2021-06-09 21:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 21:53 [PATCH v2 0/3] don't collapse transports for the trunkable Olga Kornievskaia
2021-06-09 21:53 ` Olga Kornievskaia [this message]
2021-06-10 13:34   ` [PATCH v2 1/3] SUNRPC query xprt switch for number of active transports Chuck Lever III
2021-06-10 14:50     ` Olga Kornievskaia
2021-06-10 14:55       ` Chuck Lever III
2021-06-09 21:53 ` [PATCH v2 2/3] NFSv4 introduce max_connect mount options Olga Kornievskaia
2021-06-10  1:49   ` Wang Yugui
2021-06-10  2:22     ` Wang Yugui
2021-06-10 13:30   ` Chuck Lever III
2021-06-10 13:34     ` Trond Myklebust
2021-06-10 13:56       ` Chuck Lever III
2021-06-10 14:13         ` Trond Myklebust
2021-06-10 14:31           ` Olga Kornievskaia
2021-06-10 14:55             ` Trond Myklebust
2021-06-10 16:14               ` Olga Kornievskaia
2021-06-10 16:36                 ` Trond Myklebust
2021-06-10 17:30                   ` Olga Kornievskaia
2021-06-10 22:17                     ` Olga Kornievskaia
2021-06-10 14:38           ` Chuck Lever III
2021-06-10 14:29         ` Olga Kornievskaia
2021-06-10 14:51           ` Chuck Lever III
2021-06-10 15:01             ` Olga Kornievskaia
2021-06-10 15:30               ` Trond Myklebust
2021-06-09 21:53 ` [PATCH v2 3/3] NFSv4.1+ add trunking when server trunking detected Olga Kornievskaia
2021-06-09 22:27 ` [PATCH v2 0/3] don't collapse transports for the trunkable Olga Kornievskaia
2021-06-10 13:32 ` Steve Dickson
2021-06-10 17:33   ` Olga Kornievskaia
2021-06-10 17:39     ` Olga Kornievskaia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210609215319.5518-2-olga.kornievskaia@gmail.com \
    --to=olga.kornievskaia@gmail.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.