Commit 90c8145b authored by J. Bruce Fields's avatar J. Bruce Fields Committed by J. Bruce Fields

nfsd4: use client pointer to backchannel session

Instead of copying the sessionid, use the new cl_cb_session pointer,
which indicates which session we're using for the backchannel.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent edd76786
...@@ -251,6 +251,7 @@ encode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb, ...@@ -251,6 +251,7 @@ encode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb,
struct nfs4_cb_compound_hdr *hdr) struct nfs4_cb_compound_hdr *hdr)
{ {
__be32 *p; __be32 *p;
struct nfsd4_session *ses = cb->cb_clp->cl_cb_session;
if (hdr->minorversion == 0) if (hdr->minorversion == 0)
return; return;
...@@ -258,7 +259,7 @@ encode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb, ...@@ -258,7 +259,7 @@ encode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb,
RESERVE_SPACE(1 + NFS4_MAX_SESSIONID_LEN + 20); RESERVE_SPACE(1 + NFS4_MAX_SESSIONID_LEN + 20);
WRITE32(OP_CB_SEQUENCE); WRITE32(OP_CB_SEQUENCE);
WRITEMEM(cb->cb_clp->cl_sessionid.data, NFS4_MAX_SESSIONID_LEN); WRITEMEM(ses->se_sessionid.data, NFS4_MAX_SESSIONID_LEN);
WRITE32(cb->cb_clp->cl_cb_seq_nr); WRITE32(cb->cb_clp->cl_cb_seq_nr);
WRITE32(0); /* slotid, always 0 */ WRITE32(0); /* slotid, always 0 */
WRITE32(0); /* highest slotid always 0 */ WRITE32(0); /* highest slotid always 0 */
...@@ -341,6 +342,7 @@ static int ...@@ -341,6 +342,7 @@ static int
decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb, decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb,
struct rpc_rqst *rqstp) struct rpc_rqst *rqstp)
{ {
struct nfsd4_session *ses = cb->cb_clp->cl_cb_session;
struct nfs4_sessionid id; struct nfs4_sessionid id;
int status; int status;
u32 dummy; u32 dummy;
...@@ -362,8 +364,7 @@ decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb, ...@@ -362,8 +364,7 @@ decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb,
READ_BUF(NFS4_MAX_SESSIONID_LEN + 16); READ_BUF(NFS4_MAX_SESSIONID_LEN + 16);
memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN); memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN);
p += XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN); p += XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN);
if (memcmp(id.data, cb->cb_clp->cl_sessionid.data, if (memcmp(id.data, ses->se_sessionid.data, NFS4_MAX_SESSIONID_LEN)) {
NFS4_MAX_SESSIONID_LEN)) {
dprintk("%s Invalid session id\n", __func__); dprintk("%s Invalid session id\n", __func__);
goto out; goto out;
} }
...@@ -587,7 +588,7 @@ void nfsd4_probe_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn) ...@@ -587,7 +588,7 @@ void nfsd4_probe_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
static int nfsd41_cb_setup_sequence(struct nfs4_client *clp, static int nfsd41_cb_setup_sequence(struct nfs4_client *clp,
struct rpc_task *task) struct rpc_task *task)
{ {
u32 *ptr = (u32 *)clp->cl_sessionid.data; u32 *ptr = (u32 *)clp->cl_cb_session->se_sessionid.data;
int status = 0; int status = 0;
dprintk("%s: %u:%u:%u:%u\n", __func__, dprintk("%s: %u:%u:%u:%u\n", __func__,
......
...@@ -753,8 +753,6 @@ static __be32 alloc_init_session(struct svc_rqst *rqstp, struct nfs4_client *clp ...@@ -753,8 +753,6 @@ static __be32 alloc_init_session(struct svc_rqst *rqstp, struct nfs4_client *clp
new->se_client = clp; new->se_client = clp;
gen_sessionid(new); gen_sessionid(new);
memcpy(clp->cl_sessionid.data, new->se_sessionid.data,
NFS4_MAX_SESSIONID_LEN);
INIT_LIST_HEAD(&new->se_conns); INIT_LIST_HEAD(&new->se_conns);
...@@ -1544,7 +1542,7 @@ nfsd4_create_session(struct svc_rqst *rqstp, ...@@ -1544,7 +1542,7 @@ nfsd4_create_session(struct svc_rqst *rqstp,
if (status) if (status)
goto out; goto out;
memcpy(cr_ses->sessionid.data, conf->cl_sessionid.data, memcpy(cr_ses->sessionid.data, conf->cl_cb_session->se_sessionid.data,
NFS4_MAX_SESSIONID_LEN); NFS4_MAX_SESSIONID_LEN);
cr_ses->seqid = cs_slot->sl_seqid; cr_ses->seqid = cs_slot->sl_seqid;
......
...@@ -243,7 +243,6 @@ struct nfs4_client { ...@@ -243,7 +243,6 @@ struct nfs4_client {
struct list_head cl_sessions; struct list_head cl_sessions;
struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */
u32 cl_exchange_flags; u32 cl_exchange_flags;
struct nfs4_sessionid cl_sessionid;
/* number of rpc's in progress over an associated session: */ /* number of rpc's in progress over an associated session: */
atomic_t cl_refcount; atomic_t cl_refcount;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment