diff options
author | Benny Halevy <bhalevy@panasas.com> | 2009-04-01 09:23:11 -0400 |
---|---|---|
committer | Benny Halevy <bhalevy@panasas.com> | 2009-06-17 17:11:31 -0400 |
commit | 8f975242352e92898dc641ebff0d24808f39848a (patch) | |
tree | 5a14be85500e5da33b97f4951efa42abe56cd570 /fs | |
parent | 9c9f3f5fa62cc4959e4d4d1cf1ec74f2d6ac1197 (diff) |
nfs41: create a svc_xprt for nfs41 callback thread and use for incoming callbacks
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/callback.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 470928898063..37815f3216aa 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
@@ -185,16 +185,31 @@ nfs41_callback_svc(void *vrqstp) | |||
185 | struct svc_rqst * | 185 | struct svc_rqst * |
186 | nfs41_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt) | 186 | nfs41_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt) |
187 | { | 187 | { |
188 | struct svc_xprt *bc_xprt; | ||
189 | struct svc_rqst *rqstp = ERR_PTR(-ENOMEM); | ||
190 | |||
191 | dprintk("--> %s\n", __func__); | ||
192 | /* Create a svc_sock for the service */ | ||
193 | bc_xprt = svc_sock_create(serv, xprt->prot); | ||
194 | if (!bc_xprt) | ||
195 | goto out; | ||
196 | |||
188 | /* | 197 | /* |
189 | * Save the svc_serv in the transport so that it can | 198 | * Save the svc_serv in the transport so that it can |
190 | * be referenced when the session backchannel is initialized | 199 | * be referenced when the session backchannel is initialized |
191 | */ | 200 | */ |
201 | serv->bc_xprt = bc_xprt; | ||
192 | xprt->bc_serv = serv; | 202 | xprt->bc_serv = serv; |
193 | 203 | ||
194 | INIT_LIST_HEAD(&serv->sv_cb_list); | 204 | INIT_LIST_HEAD(&serv->sv_cb_list); |
195 | spin_lock_init(&serv->sv_cb_lock); | 205 | spin_lock_init(&serv->sv_cb_lock); |
196 | init_waitqueue_head(&serv->sv_cb_waitq); | 206 | init_waitqueue_head(&serv->sv_cb_waitq); |
197 | return svc_prepare_thread(serv, &serv->sv_pools[0]); | 207 | rqstp = svc_prepare_thread(serv, &serv->sv_pools[0]); |
208 | if (IS_ERR(rqstp)) | ||
209 | svc_sock_destroy(bc_xprt); | ||
210 | out: | ||
211 | dprintk("--> %s return %p\n", __func__, rqstp); | ||
212 | return rqstp; | ||
198 | } | 213 | } |
199 | 214 | ||
200 | static inline int nfs_minorversion_callback_svc_setup(u32 minorversion, | 215 | static inline int nfs_minorversion_callback_svc_setup(u32 minorversion, |