2021-11-15 16:58:38

by Anna Schumaker

[permalink] [raw]
Subject: [PATCH 3/3] nfs: show dynamic nconnect

From: Anna Schumaker <[email protected]>

Through sysfs we can change the number of xprts attached to an
rpc_client. This lets us change the displayed nconnect= value to reflect
the actual number of connected xprts for the given mount.

Signed-off-by: Anna Schumaker <[email protected]>
---
fs/nfs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 3aced401735c..f6ede7bf18f9 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -478,7 +478,7 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
rpc_peeraddr2str(nfss->client, RPC_DISPLAY_NETID));
rcu_read_unlock();
if (clp->cl_nconnect > 0)
- seq_printf(m, ",nconnect=%u", clp->cl_nconnect);
+ seq_printf(m, ",nconnect=%u", rpc_clnt_xprt_switch_num_xprts(clp->cl_rpcclient));
if (version == 4) {
if (clp->cl_max_connect > 1)
seq_printf(m, ",max_connect=%u", clp->cl_max_connect);
--
2.33.1