aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2010-06-14 22:26:31 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-10-21 10:11:49 -0400
commitedd76786633a3145661c7a90c9baccae8e3c9e84 (patch)
tree5f3cde6cdfeea3d752df359f800ca8e4fb4df2c4 /fs/nfsd/nfs4state.c
parentcd5b814458e5554457c6e62f17aed122145b065e (diff)
downloadkernel_samsung_aries-edd76786633a3145661c7a90c9baccae8e3c9e84.zip
kernel_samsung_aries-edd76786633a3145661c7a90c9baccae8e3c9e84.tar.gz
kernel_samsung_aries-edd76786633a3145661c7a90c9baccae8e3c9e84.tar.bz2
nfsd4: move callback setup into session init code
The backchannel should be associated with a session, it isn't really global to the client. We do, however, want a pointer global to the client which tracks which session we're currently using for client-based callbacks. This is a first step in that direction; for now, just reshuffling of code with no significant change in behavior. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 7f12828..db5d8c8 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -771,6 +771,19 @@ static __be32 alloc_init_session(struct svc_rqst *rqstp, struct nfs4_client *clp
free_session(&new->se_ref);
return nfserr_jukebox;
}
+ if (!clp->cl_cb_session && (cses->flags & SESSION4_BACK_CHAN)) {
+ struct sockaddr *sa = svc_addr(rqstp);
+
+ clp->cl_cb_session = new;
+ clp->cl_cb_conn.cb_xprt = rqstp->rq_xprt;
+ svc_xprt_get(rqstp->rq_xprt);
+ rpc_copy_addr((struct sockaddr *)&clp->cl_cb_conn.cb_addr, sa);
+ clp->cl_cb_conn.cb_addrlen = svc_addr_len(sa);
+ clp->cl_cb_conn.cb_minorversion = 1;
+ clp->cl_cb_conn.cb_prog = cses->callback_prog;
+ clp->cl_cb_seq_nr = 1;
+ nfsd4_probe_callback(clp, &clp->cl_cb_conn);
+ }
return nfs_ok;
}
@@ -1045,7 +1058,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir,
clp->cl_flavor = rqstp->rq_flavor;
copy_cred(&clp->cl_cred, &rqstp->rq_cred);
gen_confirm(clp);
-
+ clp->cl_cb_session = NULL;
return clp;
}
@@ -1515,20 +1528,6 @@ nfsd4_create_session(struct svc_rqst *rqstp,
cs_slot->sl_seqid++; /* from 0 to 1 */
move_to_confirmed(unconf);
-
- if (cr_ses->flags & SESSION4_BACK_CHAN) {
- unconf->cl_cb_conn.cb_xprt = rqstp->rq_xprt;
- svc_xprt_get(rqstp->rq_xprt);
- rpc_copy_addr(
- (struct sockaddr *)&unconf->cl_cb_conn.cb_addr,
- sa);
- unconf->cl_cb_conn.cb_addrlen = svc_addr_len(sa);
- unconf->cl_cb_conn.cb_minorversion =
- cstate->minorversion;
- unconf->cl_cb_conn.cb_prog = cr_ses->callback_prog;
- unconf->cl_cb_seq_nr = 1;
- nfsd4_probe_callback(unconf, &unconf->cl_cb_conn);
- }
conf = unconf;
} else {
status = nfserr_stale_clientid;