diff options
Diffstat (limited to 'include/linux/nfsd/state.h')
-rw-r--r-- | include/linux/nfsd/state.h | 77 |
1 files changed, 54 insertions, 23 deletions
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index 57ab2ed0845..b38d1132418 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -60,6 +60,12 @@ typedef struct { | |||
60 | #define si_stateownerid si_opaque.so_stateownerid | 60 | #define si_stateownerid si_opaque.so_stateownerid |
61 | #define si_fileid si_opaque.so_fileid | 61 | #define si_fileid si_opaque.so_fileid |
62 | 62 | ||
63 | struct nfsd4_cb_sequence { | ||
64 | /* args/res */ | ||
65 | u32 cbs_minorversion; | ||
66 | struct nfs4_client *cbs_clp; | ||
67 | }; | ||
68 | |||
63 | struct nfs4_delegation { | 69 | struct nfs4_delegation { |
64 | struct list_head dl_perfile; | 70 | struct list_head dl_perfile; |
65 | struct list_head dl_perclnt; | 71 | struct list_head dl_perclnt; |
@@ -81,38 +87,35 @@ struct nfs4_delegation { | |||
81 | /* client delegation callback info */ | 87 | /* client delegation callback info */ |
82 | struct nfs4_cb_conn { | 88 | struct nfs4_cb_conn { |
83 | /* SETCLIENTID info */ | 89 | /* SETCLIENTID info */ |
84 | u32 cb_addr; | 90 | struct sockaddr_storage cb_addr; |
85 | unsigned short cb_port; | 91 | size_t cb_addrlen; |
86 | u32 cb_prog; | 92 | u32 cb_prog; |
87 | u32 cb_minorversion; | 93 | u32 cb_minorversion; |
88 | u32 cb_ident; /* minorversion 0 only */ | 94 | u32 cb_ident; /* minorversion 0 only */ |
89 | /* RPC client info */ | 95 | /* RPC client info */ |
90 | atomic_t cb_set; /* successful CB_NULL call */ | 96 | atomic_t cb_set; /* successful CB_NULL call */ |
91 | struct rpc_clnt * cb_client; | 97 | struct rpc_clnt * cb_client; |
92 | struct rpc_cred * cb_cred; | ||
93 | }; | 98 | }; |
94 | 99 | ||
95 | /* Maximum number of slots per session. 128 is useful for long haul TCP */ | 100 | /* Maximum number of slots per session. 160 is useful for long haul TCP */ |
96 | #define NFSD_MAX_SLOTS_PER_SESSION 128 | 101 | #define NFSD_MAX_SLOTS_PER_SESSION 160 |
97 | /* Maximum number of pages per slot cache entry */ | ||
98 | #define NFSD_PAGES_PER_SLOT 1 | ||
99 | /* Maximum number of operations per session compound */ | 102 | /* Maximum number of operations per session compound */ |
100 | #define NFSD_MAX_OPS_PER_COMPOUND 16 | 103 | #define NFSD_MAX_OPS_PER_COMPOUND 16 |
101 | 104 | /* Maximum session per slot cache size */ | |
102 | struct nfsd4_cache_entry { | 105 | #define NFSD_SLOT_CACHE_SIZE 1024 |
103 | __be32 ce_status; | 106 | /* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */ |
104 | struct kvec ce_datav; /* encoded NFSv4.1 data in rq_res.head[0] */ | 107 | #define NFSD_CACHE_SIZE_SLOTS_PER_SESSION 32 |
105 | struct page *ce_respages[NFSD_PAGES_PER_SLOT + 1]; | 108 | #define NFSD_MAX_MEM_PER_SESSION \ |
106 | int ce_cachethis; | 109 | (NFSD_CACHE_SIZE_SLOTS_PER_SESSION * NFSD_SLOT_CACHE_SIZE) |
107 | short ce_resused; | ||
108 | int ce_opcnt; | ||
109 | int ce_rpchdrlen; | ||
110 | }; | ||
111 | 110 | ||
112 | struct nfsd4_slot { | 111 | struct nfsd4_slot { |
113 | bool sl_inuse; | 112 | bool sl_inuse; |
114 | u32 sl_seqid; | 113 | bool sl_cachethis; |
115 | struct nfsd4_cache_entry sl_cache_entry; | 114 | u16 sl_opcnt; |
115 | u32 sl_seqid; | ||
116 | __be32 sl_status; | ||
117 | u32 sl_datalen; | ||
118 | char sl_data[]; | ||
116 | }; | 119 | }; |
117 | 120 | ||
118 | struct nfsd4_channel_attrs { | 121 | struct nfsd4_channel_attrs { |
@@ -126,6 +129,25 @@ struct nfsd4_channel_attrs { | |||
126 | u32 rdma_attrs; | 129 | u32 rdma_attrs; |
127 | }; | 130 | }; |
128 | 131 | ||
132 | struct nfsd4_create_session { | ||
133 | clientid_t clientid; | ||
134 | struct nfs4_sessionid sessionid; | ||
135 | u32 seqid; | ||
136 | u32 flags; | ||
137 | struct nfsd4_channel_attrs fore_channel; | ||
138 | struct nfsd4_channel_attrs back_channel; | ||
139 | u32 callback_prog; | ||
140 | u32 uid; | ||
141 | u32 gid; | ||
142 | }; | ||
143 | |||
144 | /* The single slot clientid cache structure */ | ||
145 | struct nfsd4_clid_slot { | ||
146 | u32 sl_seqid; | ||
147 | __be32 sl_status; | ||
148 | struct nfsd4_create_session sl_cr_ses; | ||
149 | }; | ||
150 | |||
129 | struct nfsd4_session { | 151 | struct nfsd4_session { |
130 | struct kref se_ref; | 152 | struct kref se_ref; |
131 | struct list_head se_hash; /* hash by sessionid */ | 153 | struct list_head se_hash; /* hash by sessionid */ |
@@ -135,7 +157,7 @@ struct nfsd4_session { | |||
135 | struct nfs4_sessionid se_sessionid; | 157 | struct nfs4_sessionid se_sessionid; |
136 | struct nfsd4_channel_attrs se_fchannel; | 158 | struct nfsd4_channel_attrs se_fchannel; |
137 | struct nfsd4_channel_attrs se_bchannel; | 159 | struct nfsd4_channel_attrs se_bchannel; |
138 | struct nfsd4_slot se_slots[]; /* forward channel slots */ | 160 | struct nfsd4_slot *se_slots[]; /* forward channel slots */ |
139 | }; | 161 | }; |
140 | 162 | ||
141 | static inline void | 163 | static inline void |
@@ -180,7 +202,7 @@ struct nfs4_client { | |||
180 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ | 202 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ |
181 | nfs4_verifier cl_verifier; /* generated by client */ | 203 | nfs4_verifier cl_verifier; /* generated by client */ |
182 | time_t cl_time; /* time of last lease renewal */ | 204 | time_t cl_time; /* time of last lease renewal */ |
183 | __be32 cl_addr; /* client ipaddress */ | 205 | struct sockaddr_storage cl_addr; /* client ipaddress */ |
184 | u32 cl_flavor; /* setclientid pseudoflavor */ | 206 | u32 cl_flavor; /* setclientid pseudoflavor */ |
185 | char *cl_principal; /* setclientid principal name */ | 207 | char *cl_principal; /* setclientid principal name */ |
186 | struct svc_cred cl_cred; /* setclientid principal */ | 208 | struct svc_cred cl_cred; /* setclientid principal */ |
@@ -192,9 +214,17 @@ struct nfs4_client { | |||
192 | 214 | ||
193 | /* for nfs41 */ | 215 | /* for nfs41 */ |
194 | struct list_head cl_sessions; | 216 | struct list_head cl_sessions; |
195 | struct nfsd4_slot cl_slot; /* create_session slot */ | 217 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ |
196 | u32 cl_exchange_flags; | 218 | u32 cl_exchange_flags; |
197 | struct nfs4_sessionid cl_sessionid; | 219 | struct nfs4_sessionid cl_sessionid; |
220 | |||
221 | /* for nfs41 callbacks */ | ||
222 | /* We currently support a single back channel with a single slot */ | ||
223 | unsigned long cl_cb_slot_busy; | ||
224 | u32 cl_cb_seq_nr; | ||
225 | struct svc_xprt *cl_cb_xprt; /* 4.1 callback transport */ | ||
226 | struct rpc_wait_queue cl_cb_waitq; /* backchannel callers may */ | ||
227 | /* wait here for slots */ | ||
198 | }; | 228 | }; |
199 | 229 | ||
200 | /* struct nfs4_client_reset | 230 | /* struct nfs4_client_reset |
@@ -345,6 +375,7 @@ extern int nfs4_in_grace(void); | |||
345 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); | 375 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); |
346 | extern void put_nfs4_client(struct nfs4_client *clp); | 376 | extern void put_nfs4_client(struct nfs4_client *clp); |
347 | extern void nfs4_free_stateowner(struct kref *kref); | 377 | extern void nfs4_free_stateowner(struct kref *kref); |
378 | extern int set_callback_cred(void); | ||
348 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | 379 | extern void nfsd4_probe_callback(struct nfs4_client *clp); |
349 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); | 380 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); |
350 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); | 381 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); |