@@ -2470,7 +2470,8 @@ static int client_info_show(struct seq_file *m, void *v)
{
struct inode *inode = m->private;
struct nfs4_client *clp;
- u64 clid;
+ u64 clid, hrs;
+ u32 mins, secs;
clp = get_nfsdfs_clp(inode);
if (!clp)
@@ -2478,10 +2479,17 @@ static int client_info_show(struct seq_file *m, void *v)
memcpy(&clid, &clp->cl_clientid, sizeof(clid));
seq_printf(m, "clientid: 0x%llx\n", clid);
seq_printf(m, "address: \"%pISpc\"\n", (struct sockaddr *)&clp->cl_addr);
- if (test_bit(NFSD4_CLIENT_CONFIRMED, &clp->cl_flags))
+
+ if (clp->cl_cs_client_state == NFSD4_CLIENT_COURTESY)
+ seq_puts(m, "status: courtesy\n");
+ else if (clp->cl_cs_client_state == NFSD4_CLIENT_CONFIRMED)
seq_puts(m, "status: confirmed\n");
else
seq_puts(m, "status: unconfirmed\n");
+ hrs = div_u64_rem(ktime_get_boottime_seconds() - clp->cl_time,
+ 3600, &secs);
+ mins = div_u64_rem((u64)secs, 60, &secs);
+ seq_printf(m, "time since last renew: %llu:%02u:%02u\n", hrs, mins, secs);
seq_printf(m, "name: ");
seq_quote_mem(m, clp->cl_name.data, clp->cl_name.len);
seq_printf(m, "\nminor version: %d\n", clp->cl_minorversion);
Update client_info_show to show state of courtesy client and time since last renew. Signed-off-by: Dai Ngo <dai.ngo@oracle.com> --- fs/nfsd/nfs4state.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)