Skip to content

Commit

Permalink
nfsd: add session slot count to /proc/fs/nfsd/clients/*/info
Browse files Browse the repository at this point in the history
Each client now reports the number of slots allocated in each session.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
NeilBrown authored and Chuck Lever committed Jan 6, 2025
1 parent b5fba96 commit 601c8cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,7 @@ static const char *cb_state2str(int state)
static int client_info_show(struct seq_file *m, void *v)
{
struct inode *inode = file_inode(m->file);
struct nfsd4_session *ses;
struct nfs4_client *clp;
u64 clid;

Expand Down Expand Up @@ -2679,6 +2680,13 @@ static int client_info_show(struct seq_file *m, void *v)
seq_printf(m, "callback address: \"%pISpc\"\n", &clp->cl_cb_conn.cb_addr);
seq_printf(m, "admin-revoked states: %d\n",
atomic_read(&clp->cl_admin_revoked));
spin_lock(&clp->cl_lock);
seq_printf(m, "session slots:");
list_for_each_entry(ses, &clp->cl_sessions, se_perclnt)
seq_printf(m, " %u", ses->se_fchannel.maxreqs);
spin_unlock(&clp->cl_lock);
seq_puts(m, "\n");

drop_client(clp);

return 0;
Expand Down

0 comments on commit 601c8cb

Please sign in to comment.