All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/1] Add callback address and state to nfsd4 client info
@ 2021-06-02 17:51 Dave Wysochanski
  2021-06-02 17:51 ` [PATCH v3 1/1] nfsd4: Expose the callback address and state of each NFS4 client Dave Wysochanski
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Wysochanski @ 2021-06-02 17:51 UTC (permalink / raw)
  To: Bruce Fields, Chuck Lever III; +Cc: linux-nfs

Changes since v2
- start with v1 patch
- fix case statement indents, run checkpatch (Chuck Lever)
- rename cb_state_str to cb_state2str

Dave Wysochanski (1):
  nfsd4: Expose the callback address and state of each NFS4 client

 fs/nfsd/nfs4state.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v3 1/1] nfsd4: Expose the callback address and state of each NFS4 client
  2021-06-02 17:51 [PATCH v3 0/1] Add callback address and state to nfsd4 client info Dave Wysochanski
@ 2021-06-02 17:51 ` Dave Wysochanski
  2021-06-02 19:33   ` Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Wysochanski @ 2021-06-02 17:51 UTC (permalink / raw)
  To: Bruce Fields, Chuck Lever III; +Cc: linux-nfs

In addition to the client's address, display the callback channel
state and address in the 'info' file.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfsd/nfs4state.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index c404c6ec52af..967912b4a7dd 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2358,6 +2358,21 @@ static void seq_quote_mem(struct seq_file *m, char *data, int len)
 	seq_printf(m, "\"");
 }
 
+static const char *cb_state2str(int state)
+{
+	switch (state) {
+	case NFSD4_CB_UP:
+		return "UP";
+	case NFSD4_CB_UNKNOWN:
+		return "UNKNOWN";
+	case NFSD4_CB_DOWN:
+		return "DOWN";
+	case NFSD4_CB_FAULT:
+		return "FAULT";
+	}
+	return "UNDEFINED";
+}
+
 static int client_info_show(struct seq_file *m, void *v)
 {
 	struct inode *inode = m->private;
@@ -2386,6 +2401,8 @@ static int client_info_show(struct seq_file *m, void *v)
 		seq_printf(m, "\nImplementation time: [%lld, %ld]\n",
 			clp->cl_nii_time.tv_sec, clp->cl_nii_time.tv_nsec);
 	}
+	seq_printf(m, "callback state: %s\n", cb_state2str(clp->cl_cb_state));
+	seq_printf(m, "callback address: %pISpc\n", &clp->cl_cb_conn.cb_addr);
 	drop_client(clp);
 
 	return 0;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 1/1] nfsd4: Expose the callback address and state of each NFS4 client
  2021-06-02 17:51 ` [PATCH v3 1/1] nfsd4: Expose the callback address and state of each NFS4 client Dave Wysochanski
@ 2021-06-02 19:33   ` Bruce Fields
  0 siblings, 0 replies; 3+ messages in thread
From: Bruce Fields @ 2021-06-02 19:33 UTC (permalink / raw)
  To: Dave Wysochanski; +Cc: Chuck Lever III, linux-nfs

Thanks, applied.--b.

On Wed, Jun 02, 2021 at 01:51:39PM -0400, Dave Wysochanski wrote:
> In addition to the client's address, display the callback channel
> state and address in the 'info' file.
> 
> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> ---
>  fs/nfsd/nfs4state.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index c404c6ec52af..967912b4a7dd 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -2358,6 +2358,21 @@ static void seq_quote_mem(struct seq_file *m, char *data, int len)
>  	seq_printf(m, "\"");
>  }
>  
> +static const char *cb_state2str(int state)
> +{
> +	switch (state) {
> +	case NFSD4_CB_UP:
> +		return "UP";
> +	case NFSD4_CB_UNKNOWN:
> +		return "UNKNOWN";
> +	case NFSD4_CB_DOWN:
> +		return "DOWN";
> +	case NFSD4_CB_FAULT:
> +		return "FAULT";
> +	}
> +	return "UNDEFINED";
> +}
> +
>  static int client_info_show(struct seq_file *m, void *v)
>  {
>  	struct inode *inode = m->private;
> @@ -2386,6 +2401,8 @@ static int client_info_show(struct seq_file *m, void *v)
>  		seq_printf(m, "\nImplementation time: [%lld, %ld]\n",
>  			clp->cl_nii_time.tv_sec, clp->cl_nii_time.tv_nsec);
>  	}
> +	seq_printf(m, "callback state: %s\n", cb_state2str(clp->cl_cb_state));
> +	seq_printf(m, "callback address: %pISpc\n", &clp->cl_cb_conn.cb_addr);
>  	drop_client(clp);
>  
>  	return 0;
> -- 
> 2.31.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-02 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 17:51 [PATCH v3 0/1] Add callback address and state to nfsd4 client info Dave Wysochanski
2021-06-02 17:51 ` [PATCH v3 1/1] nfsd4: Expose the callback address and state of each NFS4 client Dave Wysochanski
2021-06-02 19:33   ` Bruce Fields

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.