/include/

/commit/fs/nfs/nfs4_fs.h?id=b79a4a1b45b2543e38026303a1956bdc0aababa0'>b79a4a1b45b2
707fb4b32437
43f1b3da8b35
6df08189ffd3
b9efa1b27e25
fd954ae124e8
4ce79717ce32

a2118c33aad6
1055d76d91e6
a2118c33aad6


97dc13594718


7c5130588d69

97dc13594718



e047a10c1293

c48f4f3541e6


97dc13594718

4ce79717ce32
cee54fc94442
















cee54fc94442
4e51336a00bd
cee54fc94442







9f958ab8858c




cee54fc94442
4ce79717ce32


4ce79717ce32

9f958ab8858c
6f2e64d3e1f6
24d292b89427
4ce79717ce32

9f958ab8858c


7eff03aec917
4ce79717ce32
cee54fc94442

4ce79717ce32

7eff03aec917




afe6c27ccb8c



4ce79717ce32











77041ed9b49a










4ce79717ce32

8d0a8a9d0ec7
4ce79717ce32

cee54fc94442
d0dc3701cb46
9f958ab8858c
4ce79717ce32

77041ed9b49a
4ce79717ce32




003707c7225d



b79a4a1b45b2

8e469ebd6dc3
4ce79717ce32










8d0a8a9d0ec7
4ce79717ce32
8bda4e4c98d1
003707c7225d

4ce79717ce32
8bda4e4c98d1
003707c7225d


dc0b027dfadf
4ce79717ce32






9e33bed55239
4ce79717ce32


7eff03aec917
b79a4a1b45b2
4ce79717ce32

591d71cbde18
90a16617ee6a
fce5c838e133
4ce79717ce32

29fba38b7932

a7b721037f89
8e69514f2981
29fba38b7932

f786aa90e026
92e1d5be91a0
6b3b5496d7b2
4ce79717ce32
bb8b27e504c0

4d643d1dfa93
adfa6f980bd4

591d71cbde18
4d643d1dfa93
f7e8917a6798
55a975937d40
56659e9926ef
7aaa0b3bd4d2
d3c7b7ccc199
64c2ce8b72ec
4ce79717ce32
557134a39c8d
035168ab39f6





fbcd4abcb384

dc70d7b31895


557134a39c8d

f26468fb9384
c3fad1b1aaf8
fccba8045537
9430fb6b5315

863a3c6c686d
ef31153786bc
94de8b27d0dc






d83217c13531





fbcd4abcb384
035168ab39f6





fbcd4abcb384




fccba8045537




94de8b27d0dc


d83217c13531





94de8b27d0dc


557134a39c8d
4ce79717ce32
97dc13594718
29fba38b7932
4ce79717ce32



830b8e33fe19
4ce79717ce32

adfa6f980bd4
4ce79717ce32
adfa6f980bd4
65f27f38446e
4ce79717ce32

a7b721037f89
6dc9d57af991
a7b721037f89

b4b82607ffcf
0400a6b0cb75




a7b721037f89
4ce79717ce32


4ce79717ce32

dc0b027dfadf


0400a6b0cb75
b0d3ded1a21d
0400a6b0cb75
0629e370dd58
b9efa1b27e25
faf5f49c2d9c
8d0a8a9d0ec7
77041ed9b49a
4ce79717ce32
8535b2be5181
cee54fc94442


72211dbe727f
cee54fc94442

4ce79717ce32


4ce79717ce32





07bccc2dd4e8
4ce79717ce32


4a35bd41aff5
e9a404580cca
4ce79717ce32


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380







































                                                                       
                                      
                             
                               

                                 
                             
                              
                               
                             
                               

  
                         
                             


                              


                               

                                                   



                                                        

                                                            


                                                                   

  
  
















                                                                           
                                           
                              







                                                                                 




                               
  


                                                                     

                         
                                         
                                        
                                            

                                                              


                                      
                                      
                                       

                                          

  




                                 



                                 











                                                                            










                                         

                                                                         
                                                                           

                                         
                                                 
                                            
                                      

                                           
                                         




                                



                                                                               

                                                                                 
                                                                       










                                                                                     
                                                                           
 
                                                                               

                                                                                
 
                                                                    


                                                                             
                                                                              






                       
                                 


                                
                           
                           

                                                                            
                                                                      
                                                                
                                                     

  

                                                                           
                                                                                
                                                                   

  
                                                             
                                                               
 
                

                                                                                                                             
                                                                                

                                                                         
                                                                      
                                                                       
                                                                                                          
                                                                                       
                                                                             
                                                                           
                                                                   
                                                         
 
                            





                                                                                    

                                                                               


                                                                               

                                                                       
                                                         
                                                            
                                                        

                                                           
                                                                      
                                             






                                                                    





                                                                  
                           





                                                                                    




                                                                               




                                                              


                                         





                                    


                     
                            
 
                                                               
 



                                         
                                             

                  
                                                             
                                                              
                                                  
                                                   

                 
                                                                   
                                                                    

                                                                      
                                                                   




                                                                               
                            


                                                                                              

                                                                                          


                                                                          
                                                              
                                                             
                                                                                           
                                                                                 
                                                             
                                                             
                                                                               
                                                                                      
 
                                                                                            


                                                                                
                                                       

                                                    


                                       





                                                 
                                                 


     
                                                  
                                                 


                                     
/*
 * linux/fs/nfs/nfs4_fs.h
 *
 * Copyright (C) 2005 Trond Myklebust
 *
 * NFSv4-specific filesystem definitions and declarations
 */

#ifndef __LINUX_FS_NFS_NFS4_FS_H
#define __LINUX_FS_NFS_NFS4_FS_H

#ifdef CONFIG_NFS_V4

struct idmap;

/*
 * In a seqid-mutating op, this macro controls which error return
 * values trigger incrementation of the seqid.
 *
 * from rfc 3010:
 * The client MUST monotonically increment the sequence number for the
 * CLOSE, LOCK, LOCKU, OPEN, OPEN_CONFIRM, and OPEN_DOWNGRADE
 * operations.  This is true even in the event that the previous
 * operation that used the sequence number received an error.  The only
 * exception to this rule is if the previous operation received one of
 * the following errors: NFSERR_STALE_CLIENTID, NFSERR_STALE_STATEID,
 * NFSERR_BAD_STATEID, NFSERR_BAD_SEQID, NFSERR_BADXDR,
 * NFSERR_RESOURCE, NFSERR_NOFILEHANDLE.
 *
 */
#define seqid_mutating_err(err)       \
(((err) != NFSERR_STALE_CLIENTID) &&  \
 ((err) != NFSERR_STALE_STATEID)  &&  \
 ((err) != NFSERR_BAD_STATEID)    &&  \
 ((err) != NFSERR_BAD_SEQID)      &&  \
 ((err) != NFSERR_BAD_XDR)        &&  \
 ((err) != NFSERR_RESOURCE)       &&  \
 ((err) != NFSERR_NOFILEHANDLE))

enum nfs4_client_state {
	NFS4CLNT_MANAGER_RUNNING  = 0,
	NFS4CLNT_CHECK_LEASE,
	NFS4CLNT_LEASE_EXPIRED,
	NFS4CLNT_RECLAIM_REBOOT,
	NFS4CLNT_RECLAIM_NOGRACE,
	NFS4CLNT_DELEGRETURN,
	NFS4CLNT_LAYOUTRECALL,
	NFS4CLNT_SESSION_RESET,
	NFS4CLNT_RECALL_SLOT,
	NFS4CLNT_LEASE_CONFIRM,
};

enum nfs4_session_state {
	NFS4_SESSION_INITING,
	NFS4_SESSION_DRAINING,
};

struct nfs4_minor_version_ops {
	u32	minor_version;

	int	(*call_sync)(struct rpc_clnt *clnt,
			struct nfs_server *server,
			struct rpc_message *msg,
			struct nfs4_sequence_args *args,
			struct nfs4_sequence_res *res,
			int cache_reply);
	int	(*validate_stateid)(struct nfs_delegation *,
			const nfs4_stateid *);
	const struct nfs4_state_recovery_ops *reboot_recovery_ops;
	const struct nfs4_state_recovery_ops *nograce_recovery_ops;
	const struct nfs4_state_maintenance_ops *state_renewal_ops;
};

/*
 * struct rpc_sequence ensures that RPC calls are sent in the exact
 * order that they appear on the list.
 */
struct rpc_sequence {
	struct rpc_wait_queue	wait;	/* RPC call delay queue */
	spinlock_t lock;		/* Protects the list */
	struct list_head list;		/* Defines sequence of RPC calls */
};

#define NFS_SEQID_CONFIRMED 1
struct nfs_seqid_counter {
	struct rpc_sequence *sequence;
	int flags;
	u32 counter;
};

struct nfs_seqid {
	struct nfs_seqid_counter *sequence;
	struct list_head list;
};

static inline void nfs_confirm_seqid(struct nfs_seqid_counter *seqid, int status)
{
	if (seqid_mutating_err(-status))
		seqid->flags |= NFS_SEQID_CONFIRMED;
}

struct nfs_unique_id {
	struct rb_node rb_node;
	__u64 id;
};

/*
 * NFS4 state_owners and lock_owners are simply labels for ordered
 * sequences of RPC calls. Their sole purpose is to provide once-only
 * semantics by allowing the server to identify replayed requests.
 */
struct nfs4_state_owner {
	struct nfs_unique_id so_owner_id;
	struct nfs_server    *so_server;
	struct rb_node	     so_server_node;

	struct rpc_cred	     *so_cred;	 /* Associated cred */

	spinlock_t	     so_lock;
	atomic_t	     so_count;
	unsigned long	     so_flags;
	struct list_head     so_states;
	struct nfs_seqid_counter so_seqid;
	struct rpc_sequence  so_sequence;
};

enum {
	NFS_OWNER_RECLAIM_REBOOT,
	NFS_OWNER_RECLAIM_NOGRACE
};

#define NFS_LOCK_NEW		0
#define NFS_LOCK_RECLAIM	1
#define NFS_LOCK_EXPIRED	2

/*
 * struct nfs4_state maintains the client-side state for a given
 * (state_owner,inode) tuple (OPEN) or state_owner (LOCK).
 *
 * OPEN: