[PATCH 4/5] nfsd: add a cl_daddr field and a generic flags field to nfs4_client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The new clstate daemon tracks client name strings on a per-server
address basis. In order to support this model, we need to pass the
address where a call came in to the upcall.

We'll also need a way to flag the nfs4_client as already being recorded
on stable storage so that we don't continually upcall.

Once we're able to deprecate the old state tracking code, we can get rid
of cl_recdir to recoup some of the space we're using here.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
 fs/nfsd/nfs4state.c |    3 ++-
 fs/nfsd/state.h     |    3 +++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index e32ef02..7f0a124 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1194,7 +1194,8 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir,
 	clear_bit(0, &clp->cl_cb_slot_busy);
 	rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table");
 	copy_verf(clp, verf);
-	rpc_copy_addr((struct sockaddr *) &clp->cl_addr, sa);
+	rpc_copy_addr((struct sockaddr *)&clp->cl_addr, sa);
+	rpc_copy_addr((struct sockaddr *)&clp->cl_daddr, svc_daddr(rqstp));
 	clp->cl_flavor = rqstp->rq_flavor;
 	copy_cred(&clp->cl_cred, &rqstp->rq_cred);
 	gen_confirm(clp);
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index b07f5ea..7879db5 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -240,6 +240,9 @@ struct nfs4_client {
 	nfs4_verifier		cl_verifier; 	/* generated by client */
 	time_t                  cl_time;        /* time of last lease renewal */
 	struct sockaddr_storage	cl_addr; 	/* client ipaddress */
+	struct sockaddr_storage	cl_daddr; 	/* server ipaddress */
+#define NFSD4_CLIENT_STABLE	(0)		/* client on stable storage */
+	unsigned long		cl_flags;
 	u32			cl_flavor;	/* setclientid pseudoflavor */
 	char			*cl_principal;	/* setclientid principal name */
 	struct svc_cred		cl_cred; 	/* setclientid principal */
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux