diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2010-06-14 17:49:37 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-10-21 10:11:50 -0400 |
commit | 90c8145bb6fe1d9e0a808de6a701748967588bbd (patch) | |
tree | 49a1b74340f8369b3d77c705cf5b5f93f44f74b3 /fs/nfsd | |
parent | edd76786633a3145661c7a90c9baccae8e3c9e84 (diff) |
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: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 9 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 | ||||
-rw-r--r-- | fs/nfsd/state.h | 1 |
3 files changed, 6 insertions, 8 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index a269dbeff150..78ac779c09ff 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -251,6 +251,7 @@ encode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb, | |||
251 | struct nfs4_cb_compound_hdr *hdr) | 251 | struct nfs4_cb_compound_hdr *hdr) |
252 | { | 252 | { |
253 | __be32 *p; | 253 | __be32 *p; |
254 | struct nfsd4_session *ses = cb->cb_clp->cl_cb_session; | ||
254 | 255 | ||
255 | if (hdr->minorversion == 0) | 256 | if (hdr->minorversion == 0) |
256 | return; | 257 | return; |
@@ -258,7 +259,7 @@ encode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb, | |||
258 | RESERVE_SPACE(1 + NFS4_MAX_SESSIONID_LEN + 20); | 259 | RESERVE_SPACE(1 + NFS4_MAX_SESSIONID_LEN + 20); |
259 | 260 | ||
260 | WRITE32(OP_CB_SEQUENCE); | 261 | WRITE32(OP_CB_SEQUENCE); |
261 | WRITEMEM(cb->cb_clp->cl_sessionid.data, NFS4_MAX_SESSIONID_LEN); | 262 | WRITEMEM(ses->se_sessionid.data, NFS4_MAX_SESSIONID_LEN); |
262 | WRITE32(cb->cb_clp->cl_cb_seq_nr); | 263 | WRITE32(cb->cb_clp->cl_cb_seq_nr); |
263 | WRITE32(0); /* slotid, always 0 */ | 264 | WRITE32(0); /* slotid, always 0 */ |
264 | WRITE32(0); /* highest slotid always 0 */ | 265 | WRITE32(0); /* highest slotid always 0 */ |
@@ -341,6 +342,7 @@ static int | |||
341 | decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb, | 342 | decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb, |
342 | struct rpc_rqst *rqstp) | 343 | struct rpc_rqst *rqstp) |
343 | { | 344 | { |
345 | struct nfsd4_session *ses = cb->cb_clp->cl_cb_session; | ||
344 | struct nfs4_sessionid id; | 346 | struct nfs4_sessionid id; |
345 | int status; | 347 | int status; |
346 | u32 dummy; | 348 | u32 dummy; |
@@ -362,8 +364,7 @@ decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_callback *cb, | |||
362 | READ_BUF(NFS4_MAX_SESSIONID_LEN + 16); | 364 | READ_BUF(NFS4_MAX_SESSIONID_LEN + 16); |
363 | memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN); | 365 | memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN); |
364 | p += XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN); | 366 | p += XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN); |
365 | if (memcmp(id.data, cb->cb_clp->cl_sessionid.data, | 367 | if (memcmp(id.data, ses->se_sessionid.data, NFS4_MAX_SESSIONID_LEN)) { |
366 | NFS4_MAX_SESSIONID_LEN)) { | ||
367 | dprintk("%s Invalid session id\n", __func__); | 368 | dprintk("%s Invalid session id\n", __func__); |
368 | goto out; | 369 | goto out; |
369 | } | 370 | } |
@@ -587,7 +588,7 @@ void nfsd4_probe_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn) | |||
587 | static int nfsd41_cb_setup_sequence(struct nfs4_client *clp, | 588 | static int nfsd41_cb_setup_sequence(struct nfs4_client *clp, |
588 | struct rpc_task *task) | 589 | struct rpc_task *task) |
589 | { | 590 | { |
590 | u32 *ptr = (u32 *)clp->cl_sessionid.data; | 591 | u32 *ptr = (u32 *)clp->cl_cb_session->se_sessionid.data; |
591 | int status = 0; | 592 | int status = 0; |
592 | 593 | ||
593 | dprintk("%s: %u:%u:%u:%u\n", __func__, | 594 | dprintk("%s: %u:%u:%u:%u\n", __func__, |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index db5d8c8537ed..c942511f73e6 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -753,8 +753,6 @@ static __be32 alloc_init_session(struct svc_rqst *rqstp, struct nfs4_client *clp | |||
753 | 753 | ||
754 | new->se_client = clp; | 754 | new->se_client = clp; |
755 | gen_sessionid(new); | 755 | gen_sessionid(new); |
756 | memcpy(clp->cl_sessionid.data, new->se_sessionid.data, | ||
757 | NFS4_MAX_SESSIONID_LEN); | ||
758 | 756 | ||
759 | INIT_LIST_HEAD(&new->se_conns); | 757 | INIT_LIST_HEAD(&new->se_conns); |
760 | 758 | ||
@@ -1544,7 +1542,7 @@ nfsd4_create_session(struct svc_rqst *rqstp, | |||
1544 | if (status) | 1542 | if (status) |
1545 | goto out; | 1543 | goto out; |
1546 | 1544 | ||
1547 | memcpy(cr_ses->sessionid.data, conf->cl_sessionid.data, | 1545 | memcpy(cr_ses->sessionid.data, conf->cl_cb_session->se_sessionid.data, |
1548 | NFS4_MAX_SESSIONID_LEN); | 1546 | NFS4_MAX_SESSIONID_LEN); |
1549 | cr_ses->seqid = cs_slot->sl_seqid; | 1547 | cr_ses->seqid = cs_slot->sl_seqid; |
1550 | 1548 | ||
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 6e63c1d272bf..cdce26ad50b5 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -243,7 +243,6 @@ struct nfs4_client { | |||
243 | struct list_head cl_sessions; | 243 | struct list_head cl_sessions; |
244 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ | 244 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ |
245 | u32 cl_exchange_flags; | 245 | u32 cl_exchange_flags; |
246 | struct nfs4_sessionid cl_sessionid; | ||
247 | /* number of rpc's in progress over an associated session: */ | 246 | /* number of rpc's in progress over an associated session: */ |
248 | atomic_t cl_refcount; | 247 | atomic_t cl_refcount; |
249 | 248 | ||