diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2010-05-21 15:27:26 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-05-21 15:27:26 -0400 |
commit | ee9a3607fb03e804ddf624544105f4e34260c380 (patch) | |
tree | ce41b6e0fa10982a306f6c142a92dbf3c9961284 /fs/nfsd/state.h | |
parent | b492e95be0ae672922f4734acf3f5d35c30be948 (diff) | |
parent | d515e86e639890b33a09390d062b0831664f04a2 (diff) |
Merge branch 'master' into for-2.6.35
Conflicts:
fs/ext3/fsync.c
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r-- | fs/nfsd/state.h | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index fefeae27f25e..006c84230c7c 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -70,6 +70,16 @@ struct nfsd4_cb_sequence { | |||
70 | struct nfs4_client *cbs_clp; | 70 | struct nfs4_client *cbs_clp; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | struct nfs4_rpc_args { | ||
74 | void *args_op; | ||
75 | struct nfsd4_cb_sequence args_seq; | ||
76 | }; | ||
77 | |||
78 | struct nfsd4_callback { | ||
79 | struct nfs4_rpc_args cb_args; | ||
80 | struct work_struct cb_work; | ||
81 | }; | ||
82 | |||
73 | struct nfs4_delegation { | 83 | struct nfs4_delegation { |
74 | struct list_head dl_perfile; | 84 | struct list_head dl_perfile; |
75 | struct list_head dl_perclnt; | 85 | struct list_head dl_perclnt; |
@@ -86,6 +96,7 @@ struct nfs4_delegation { | |||
86 | stateid_t dl_stateid; | 96 | stateid_t dl_stateid; |
87 | struct knfsd_fh dl_fh; | 97 | struct knfsd_fh dl_fh; |
88 | int dl_retries; | 98 | int dl_retries; |
99 | struct nfsd4_callback dl_recall; | ||
89 | }; | 100 | }; |
90 | 101 | ||
91 | /* client delegation callback info */ | 102 | /* client delegation callback info */ |
@@ -96,9 +107,7 @@ struct nfs4_cb_conn { | |||
96 | u32 cb_prog; | 107 | u32 cb_prog; |
97 | u32 cb_minorversion; | 108 | u32 cb_minorversion; |
98 | u32 cb_ident; /* minorversion 0 only */ | 109 | u32 cb_ident; /* minorversion 0 only */ |
99 | /* RPC client info */ | 110 | struct svc_xprt *cb_xprt; /* minorversion 1 only */ |
100 | atomic_t cb_set; /* successful CB_NULL call */ | ||
101 | struct rpc_clnt * cb_client; | ||
102 | }; | 111 | }; |
103 | 112 | ||
104 | /* Maximum number of slots per session. 160 is useful for long haul TCP */ | 113 | /* Maximum number of slots per session. 160 is useful for long haul TCP */ |
@@ -157,7 +166,7 @@ struct nfsd4_session { | |||
157 | struct list_head se_hash; /* hash by sessionid */ | 166 | struct list_head se_hash; /* hash by sessionid */ |
158 | struct list_head se_perclnt; | 167 | struct list_head se_perclnt; |
159 | u32 se_flags; | 168 | u32 se_flags; |
160 | struct nfs4_client *se_client; /* for expire_client */ | 169 | struct nfs4_client *se_client; |
161 | struct nfs4_sessionid se_sessionid; | 170 | struct nfs4_sessionid se_sessionid; |
162 | struct nfsd4_channel_attrs se_fchannel; | 171 | struct nfsd4_channel_attrs se_fchannel; |
163 | struct nfsd4_channel_attrs se_bchannel; | 172 | struct nfsd4_channel_attrs se_bchannel; |
@@ -212,25 +221,41 @@ struct nfs4_client { | |||
212 | struct svc_cred cl_cred; /* setclientid principal */ | 221 | struct svc_cred cl_cred; /* setclientid principal */ |
213 | clientid_t cl_clientid; /* generated by server */ | 222 | clientid_t cl_clientid; /* generated by server */ |
214 | nfs4_verifier cl_confirm; /* generated by server */ | 223 | nfs4_verifier cl_confirm; /* generated by server */ |
215 | struct nfs4_cb_conn cl_cb_conn; /* callback info */ | ||
216 | atomic_t cl_count; /* ref count */ | ||
217 | u32 cl_firststate; /* recovery dir creation */ | 224 | u32 cl_firststate; /* recovery dir creation */ |
218 | 225 | ||
226 | /* for v4.0 and v4.1 callbacks: */ | ||
227 | struct nfs4_cb_conn cl_cb_conn; | ||
228 | struct rpc_clnt *cl_cb_client; | ||
229 | atomic_t cl_cb_set; | ||
230 | |||
219 | /* for nfs41 */ | 231 | /* for nfs41 */ |
220 | struct list_head cl_sessions; | 232 | struct list_head cl_sessions; |
221 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ | 233 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ |
222 | u32 cl_exchange_flags; | 234 | u32 cl_exchange_flags; |
223 | struct nfs4_sessionid cl_sessionid; | 235 | struct nfs4_sessionid cl_sessionid; |
236 | /* number of rpc's in progress over an associated session: */ | ||
237 | atomic_t cl_refcount; | ||
224 | 238 | ||
225 | /* for nfs41 callbacks */ | 239 | /* for nfs41 callbacks */ |
226 | /* We currently support a single back channel with a single slot */ | 240 | /* We currently support a single back channel with a single slot */ |
227 | unsigned long cl_cb_slot_busy; | 241 | unsigned long cl_cb_slot_busy; |
228 | u32 cl_cb_seq_nr; | 242 | u32 cl_cb_seq_nr; |
229 | struct svc_xprt *cl_cb_xprt; /* 4.1 callback transport */ | ||
230 | struct rpc_wait_queue cl_cb_waitq; /* backchannel callers may */ | 243 | struct rpc_wait_queue cl_cb_waitq; /* backchannel callers may */ |
231 | /* wait here for slots */ | 244 | /* wait here for slots */ |
232 | }; | 245 | }; |
233 | 246 | ||
247 | static inline void | ||
248 | mark_client_expired(struct nfs4_client *clp) | ||
249 | { | ||
250 | clp->cl_time = 0; | ||
251 | } | ||
252 | |||
253 | static inline bool | ||
254 | is_client_expired(struct nfs4_client *clp) | ||
255 | { | ||
256 | return clp->cl_time == 0; | ||
257 | } | ||
258 | |||
234 | /* struct nfs4_client_reset | 259 | /* struct nfs4_client_reset |
235 | * one per old client. Populates reset_str_hashtbl. Filled from conf_id_hashtbl | 260 | * one per old client. Populates reset_str_hashtbl. Filled from conf_id_hashtbl |
236 | * upon lease reset, or from upcall to state_daemon (to read in state | 261 | * upon lease reset, or from upcall to state_daemon (to read in state |
@@ -377,11 +402,14 @@ extern void nfs4_lock_state(void); | |||
377 | extern void nfs4_unlock_state(void); | 402 | extern void nfs4_unlock_state(void); |
378 | extern int nfs4_in_grace(void); | 403 | extern int nfs4_in_grace(void); |
379 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); | 404 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); |
380 | extern void put_nfs4_client(struct nfs4_client *clp); | ||
381 | extern void nfs4_free_stateowner(struct kref *kref); | 405 | extern void nfs4_free_stateowner(struct kref *kref); |
382 | extern int set_callback_cred(void); | 406 | extern int set_callback_cred(void); |
383 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | 407 | extern void nfsd4_probe_callback(struct nfs4_client *clp, struct nfs4_cb_conn *); |
408 | extern void nfsd4_do_callback_rpc(struct work_struct *); | ||
384 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); | 409 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); |
410 | extern int nfsd4_create_callback_queue(void); | ||
411 | extern void nfsd4_destroy_callback_queue(void); | ||
412 | extern void nfsd4_set_callback_client(struct nfs4_client *, struct rpc_clnt *); | ||
385 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); | 413 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); |
386 | extern __be32 nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname); | 414 | extern __be32 nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname); |
387 | extern void nfsd4_init_recdir(char *recdir_name); | 415 | extern void nfsd4_init_recdir(char *recdir_name); |
@@ -392,6 +420,7 @@ extern int nfs4_has_reclaimed_state(const char *name, bool use_exchange_id); | |||
392 | extern void nfsd4_recdir_purge_old(void); | 420 | extern void nfsd4_recdir_purge_old(void); |
393 | extern int nfsd4_create_clid_dir(struct nfs4_client *clp); | 421 | extern int nfsd4_create_clid_dir(struct nfs4_client *clp); |
394 | extern void nfsd4_remove_clid_dir(struct nfs4_client *clp); | 422 | extern void nfsd4_remove_clid_dir(struct nfs4_client *clp); |
423 | extern void release_session_client(struct nfsd4_session *); | ||
395 | 424 | ||
396 | static inline void | 425 | static inline void |
397 | nfs4_put_stateowner(struct nfs4_stateowner *so) | 426 | nfs4_put_stateowner(struct nfs4_stateowner *so) |