aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-06-17 20:59:58 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-06-17 20:59:58 -0400
commit301933a0acfdec837fd8b4884093b3f0fff01d8a (patch)
tree1f2412a30d710493179b1b3743cf30302872df15 /include/linux
parent3fe0344faf7fdcb158bd5c1a9aec960a8d70c8e8 (diff)
parent68f3f90133d56e0c38f04f991e662c2b21592b31 (diff)
Merge commit 'linux-pnfs/nfs41-for-2.6.31' into nfsv41-for-2.6.31
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs4.h18
-rw-r--r--include/linux/nfs_fs_sb.h67
-rw-r--r--include/linux/nfs_xdr.h171
-rw-r--r--include/linux/nfsd/state.h1
-rw-r--r--include/linux/sunrpc/bc_xprt.h49
-rw-r--r--include/linux/sunrpc/clnt.h1
-rw-r--r--include/linux/sunrpc/sched.h3
-rw-r--r--include/linux/sunrpc/svc.h11
-rw-r--r--include/linux/sunrpc/svcsock.h2
-rw-r--r--include/linux/sunrpc/xprt.h38
10 files changed, 358 insertions, 3 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index e3f0cbcbd0db..bd2eba530667 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -21,6 +21,7 @@
21#define NFS4_FHSIZE 128 21#define NFS4_FHSIZE 128
22#define NFS4_MAXPATHLEN PATH_MAX 22#define NFS4_MAXPATHLEN PATH_MAX
23#define NFS4_MAXNAMLEN NAME_MAX 23#define NFS4_MAXNAMLEN NAME_MAX
24#define NFS4_OPAQUE_LIMIT 1024
24#define NFS4_MAX_SESSIONID_LEN 16 25#define NFS4_MAX_SESSIONID_LEN 16
25 26
26#define NFS4_ACCESS_READ 0x0001 27#define NFS4_ACCESS_READ 0x0001
@@ -130,6 +131,16 @@
130 131
131#define NFS4_MAX_UINT64 (~(u64)0) 132#define NFS4_MAX_UINT64 (~(u64)0)
132 133
134/* An NFS4 sessions server must support at least NFS4_MAX_OPS operations.
135 * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly.
136 */
137#define NFS4_MAX_OPS 8
138
139/* Our NFS4 client back channel server only wants the cb_sequene and the
140 * actual operation per compound
141 */
142#define NFS4_MAX_BACK_CHANNEL_OPS 2
143
133enum nfs4_acl_whotype { 144enum nfs4_acl_whotype {
134 NFS4_ACL_WHO_NAMED = 0, 145 NFS4_ACL_WHO_NAMED = 0,
135 NFS4_ACL_WHO_OWNER, 146 NFS4_ACL_WHO_OWNER,
@@ -462,6 +473,13 @@ enum lock_type4 {
462#define NFSPROC4_NULL 0 473#define NFSPROC4_NULL 0
463#define NFSPROC4_COMPOUND 1 474#define NFSPROC4_COMPOUND 1
464#define NFS4_MINOR_VERSION 0 475#define NFS4_MINOR_VERSION 0
476
477#if defined(CONFIG_NFS_V4_1)
478#define NFS4_MAX_MINOR_VERSION 1
479#else
480#define NFS4_MAX_MINOR_VERSION 0
481#endif /* CONFIG_NFS_V4_1 */
482
465#define NFS4_DEBUG 1 483#define NFS4_DEBUG 1
466 484
467/* Index of predefined Linux client operations */ 485/* Index of predefined Linux client operations */
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 6ad75948cbf7..19fe15d12042 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -4,11 +4,17 @@
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/backing-dev.h> 5#include <linux/backing-dev.h>
6#include <linux/wait.h> 6#include <linux/wait.h>
7#include <linux/nfs_xdr.h>
8#include <linux/sunrpc/xprt.h>
7 9
8#include <asm/atomic.h> 10#include <asm/atomic.h>
9 11
12struct nfs4_session;
10struct nfs_iostats; 13struct nfs_iostats;
11struct nlm_host; 14struct nlm_host;
15struct nfs4_sequence_args;
16struct nfs4_sequence_res;
17struct nfs_server;
12 18
13/* 19/*
14 * The nfs_client identifies our client state to the server. 20 * The nfs_client identifies our client state to the server.
@@ -18,6 +24,7 @@ struct nfs_client {
18 int cl_cons_state; /* current construction state (-ve: init error) */ 24 int cl_cons_state; /* current construction state (-ve: init error) */
19#define NFS_CS_READY 0 /* ready to be used */ 25#define NFS_CS_READY 0 /* ready to be used */
20#define NFS_CS_INITING 1 /* busy initialising */ 26#define NFS_CS_INITING 1 /* busy initialising */
27#define NFS_CS_SESSION_INITING 2 /* busy initialising session */
21 unsigned long cl_res_state; /* NFS resources state */ 28 unsigned long cl_res_state; /* NFS resources state */
22#define NFS_CS_CALLBACK 1 /* - callback started */ 29#define NFS_CS_CALLBACK 1 /* - callback started */
23#define NFS_CS_IDMAP 2 /* - idmap started */ 30#define NFS_CS_IDMAP 2 /* - idmap started */
@@ -32,6 +39,7 @@ struct nfs_client {
32 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */ 39 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */
33 int cl_proto; /* Network transport protocol */ 40 int cl_proto; /* Network transport protocol */
34 41
42 u32 cl_minorversion;/* NFSv4 minorversion */
35 struct rpc_cred *cl_machine_cred; 43 struct rpc_cred *cl_machine_cred;
36 44
37#ifdef CONFIG_NFS_V4 45#ifdef CONFIG_NFS_V4
@@ -63,7 +71,22 @@ struct nfs_client {
63 */ 71 */
64 char cl_ipaddr[48]; 72 char cl_ipaddr[48];
65 unsigned char cl_id_uniquifier; 73 unsigned char cl_id_uniquifier;
66#endif 74 int (* cl_call_sync)(struct nfs_server *server,
75 struct rpc_message *msg,
76 struct nfs4_sequence_args *args,
77 struct nfs4_sequence_res *res,
78 int cache_reply);
79#endif /* CONFIG_NFS_V4 */
80
81#ifdef CONFIG_NFS_V4_1
82 /* clientid returned from EXCHANGE_ID, used by session operations */
83 u64 cl_ex_clid;
84 /* The sequence id to use for the next CREATE_SESSION */
85 u32 cl_seqid;
86 /* The flags used for obtaining the clientid during EXCHANGE_ID */
87 u32 cl_exchange_flags;
88 struct nfs4_session *cl_session; /* sharred session */
89#endif /* CONFIG_NFS_V4_1 */
67 90
68#ifdef CONFIG_NFS_FSCACHE 91#ifdef CONFIG_NFS_FSCACHE
69 struct fscache_cookie *fscache; /* client index cache cookie */ 92 struct fscache_cookie *fscache; /* client index cache cookie */
@@ -145,4 +168,46 @@ struct nfs_server {
145#define NFS_CAP_ACLS (1U << 3) 168#define NFS_CAP_ACLS (1U << 3)
146#define NFS_CAP_ATOMIC_OPEN (1U << 4) 169#define NFS_CAP_ATOMIC_OPEN (1U << 4)
147 170
171
172/* maximum number of slots to use */
173#define NFS4_MAX_SLOT_TABLE RPC_MAX_SLOT_TABLE
174
175#if defined(CONFIG_NFS_V4_1)
176
177/* Sessions */
178#define SLOT_TABLE_SZ (NFS4_MAX_SLOT_TABLE/(8*sizeof(long)))
179struct nfs4_slot_table {
180 struct nfs4_slot *slots; /* seqid per slot */
181 unsigned long used_slots[SLOT_TABLE_SZ]; /* used/unused bitmap */
182 spinlock_t slot_tbl_lock;
183 struct rpc_wait_queue slot_tbl_waitq; /* allocators may wait here */
184 int max_slots; /* # slots in table */
185 int highest_used_slotid; /* sent to server on each SEQ.
186 * op for dynamic resizing */
187};
188
189static inline int slot_idx(struct nfs4_slot_table *tbl, struct nfs4_slot *sp)
190{
191 return sp - tbl->slots;
192}
193
194/*
195 * Session related parameters
196 */
197struct nfs4_session {
198 struct nfs4_sessionid sess_id;
199 u32 flags;
200 unsigned long session_state;
201 u32 hash_alg;
202 u32 ssv_len;
203
204 /* The fore and back channel */
205 struct nfs4_channel_attrs fc_attrs;
206 struct nfs4_slot_table fc_slot_table;
207 struct nfs4_channel_attrs bc_attrs;
208 struct nfs4_slot_table bc_slot_table;
209 struct nfs_client *clp;
210};
211
212#endif /* CONFIG_NFS_V4_1 */
148#endif 213#endif
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index b89c34e40bc2..62f63fb0c4c8 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -145,6 +145,44 @@ struct nfs4_change_info {
145}; 145};
146 146
147struct nfs_seqid; 147struct nfs_seqid;
148
149/* nfs41 sessions channel attributes */
150struct nfs4_channel_attrs {
151 u32 headerpadsz;
152 u32 max_rqst_sz;
153 u32 max_resp_sz;
154 u32 max_resp_sz_cached;
155 u32 max_ops;
156 u32 max_reqs;
157};
158
159/* nfs41 sessions slot seqid */
160struct nfs4_slot {
161 u32 seq_nr;
162};
163
164struct nfs4_sequence_args {
165 struct nfs4_session *sa_session;
166 u8 sa_slotid;
167 u8 sa_cache_this;
168};
169
170struct nfs4_sequence_res {
171 struct nfs4_session *sr_session;
172 u8 sr_slotid; /* slot used to send request */
173 unsigned long sr_renewal_time;
174 int sr_status; /* sequence operation status */
175};
176
177struct nfs4_get_lease_time_args {
178 struct nfs4_sequence_args la_seq_args;
179};
180
181struct nfs4_get_lease_time_res {
182 struct nfs_fsinfo *lr_fsinfo;
183 struct nfs4_sequence_res lr_seq_res;
184};
185
148/* 186/*
149 * Arguments to the open call. 187 * Arguments to the open call.
150 */ 188 */
@@ -165,6 +203,7 @@ struct nfs_openargs {
165 const struct nfs_server *server; /* Needed for ID mapping */ 203 const struct nfs_server *server; /* Needed for ID mapping */
166 const u32 * bitmask; 204 const u32 * bitmask;
167 __u32 claim; 205 __u32 claim;
206 struct nfs4_sequence_args seq_args;
168}; 207};
169 208
170struct nfs_openres { 209struct nfs_openres {
@@ -181,6 +220,7 @@ struct nfs_openres {
181 __u32 do_recall; 220 __u32 do_recall;
182 __u64 maxsize; 221 __u64 maxsize;
183 __u32 attrset[NFS4_BITMAP_SIZE]; 222 __u32 attrset[NFS4_BITMAP_SIZE];
223 struct nfs4_sequence_res seq_res;
184}; 224};
185 225
186/* 226/*
@@ -206,6 +246,7 @@ struct nfs_closeargs {
206 struct nfs_seqid * seqid; 246 struct nfs_seqid * seqid;
207 fmode_t fmode; 247 fmode_t fmode;
208 const u32 * bitmask; 248 const u32 * bitmask;
249 struct nfs4_sequence_args seq_args;
209}; 250};
210 251
211struct nfs_closeres { 252struct nfs_closeres {
@@ -213,6 +254,7 @@ struct nfs_closeres {
213 struct nfs_fattr * fattr; 254 struct nfs_fattr * fattr;
214 struct nfs_seqid * seqid; 255 struct nfs_seqid * seqid;
215 const struct nfs_server *server; 256 const struct nfs_server *server;
257 struct nfs4_sequence_res seq_res;
216}; 258};
217/* 259/*
218 * * Arguments to the lock,lockt, and locku call. 260 * * Arguments to the lock,lockt, and locku call.
@@ -233,12 +275,14 @@ struct nfs_lock_args {
233 unsigned char block : 1; 275 unsigned char block : 1;
234 unsigned char reclaim : 1; 276 unsigned char reclaim : 1;
235 unsigned char new_lock_owner : 1; 277 unsigned char new_lock_owner : 1;
278 struct nfs4_sequence_args seq_args;
236}; 279};
237 280
238struct nfs_lock_res { 281struct nfs_lock_res {
239 nfs4_stateid stateid; 282 nfs4_stateid stateid;
240 struct nfs_seqid * lock_seqid; 283 struct nfs_seqid * lock_seqid;
241 struct nfs_seqid * open_seqid; 284 struct nfs_seqid * open_seqid;
285 struct nfs4_sequence_res seq_res;
242}; 286};
243 287
244struct nfs_locku_args { 288struct nfs_locku_args {
@@ -246,32 +290,38 @@ struct nfs_locku_args {
246 struct file_lock * fl; 290 struct file_lock * fl;
247 struct nfs_seqid * seqid; 291 struct nfs_seqid * seqid;
248 nfs4_stateid * stateid; 292 nfs4_stateid * stateid;
293 struct nfs4_sequence_args seq_args;
249}; 294};
250 295
251struct nfs_locku_res { 296struct nfs_locku_res {
252 nfs4_stateid stateid; 297 nfs4_stateid stateid;
253 struct nfs_seqid * seqid; 298 struct nfs_seqid * seqid;
299 struct nfs4_sequence_res seq_res;
254}; 300};
255 301
256struct nfs_lockt_args { 302struct nfs_lockt_args {
257 struct nfs_fh * fh; 303 struct nfs_fh * fh;
258 struct file_lock * fl; 304 struct file_lock * fl;
259 struct nfs_lowner lock_owner; 305 struct nfs_lowner lock_owner;
306 struct nfs4_sequence_args seq_args;
260}; 307};
261 308
262struct nfs_lockt_res { 309struct nfs_lockt_res {
263 struct file_lock * denied; /* LOCK, LOCKT failed */ 310 struct file_lock * denied; /* LOCK, LOCKT failed */
311 struct nfs4_sequence_res seq_res;
264}; 312};
265 313
266struct nfs4_delegreturnargs { 314struct nfs4_delegreturnargs {
267 const struct nfs_fh *fhandle; 315 const struct nfs_fh *fhandle;
268 const nfs4_stateid *stateid; 316 const nfs4_stateid *stateid;
269 const u32 * bitmask; 317 const u32 * bitmask;
318 struct nfs4_sequence_args seq_args;
270}; 319};
271 320
272struct nfs4_delegreturnres { 321struct nfs4_delegreturnres {
273 struct nfs_fattr * fattr; 322 struct nfs_fattr * fattr;
274 const struct nfs_server *server; 323 const struct nfs_server *server;
324 struct nfs4_sequence_res seq_res;
275}; 325};
276 326
277/* 327/*
@@ -284,12 +334,14 @@ struct nfs_readargs {
284 __u32 count; 334 __u32 count;
285 unsigned int pgbase; 335 unsigned int pgbase;
286 struct page ** pages; 336 struct page ** pages;
337 struct nfs4_sequence_args seq_args;
287}; 338};
288 339
289struct nfs_readres { 340struct nfs_readres {
290 struct nfs_fattr * fattr; 341 struct nfs_fattr * fattr;
291 __u32 count; 342 __u32 count;
292 int eof; 343 int eof;
344 struct nfs4_sequence_res seq_res;
293}; 345};
294 346
295/* 347/*
@@ -304,6 +356,7 @@ struct nfs_writeargs {
304 unsigned int pgbase; 356 unsigned int pgbase;
305 struct page ** pages; 357 struct page ** pages;
306 const u32 * bitmask; 358 const u32 * bitmask;
359 struct nfs4_sequence_args seq_args;
307}; 360};
308 361
309struct nfs_writeverf { 362struct nfs_writeverf {
@@ -316,6 +369,7 @@ struct nfs_writeres {
316 struct nfs_writeverf * verf; 369 struct nfs_writeverf * verf;
317 __u32 count; 370 __u32 count;
318 const struct nfs_server *server; 371 const struct nfs_server *server;
372 struct nfs4_sequence_res seq_res;
319}; 373};
320 374
321/* 375/*
@@ -325,12 +379,14 @@ struct nfs_removeargs {
325 const struct nfs_fh *fh; 379 const struct nfs_fh *fh;
326 struct qstr name; 380 struct qstr name;
327 const u32 * bitmask; 381 const u32 * bitmask;
382 struct nfs4_sequence_args seq_args;
328}; 383};
329 384
330struct nfs_removeres { 385struct nfs_removeres {
331 const struct nfs_server *server; 386 const struct nfs_server *server;
332 struct nfs4_change_info cinfo; 387 struct nfs4_change_info cinfo;
333 struct nfs_fattr dir_attr; 388 struct nfs_fattr dir_attr;
389 struct nfs4_sequence_res seq_res;
334}; 390};
335 391
336/* 392/*
@@ -383,6 +439,7 @@ struct nfs_setattrargs {
383 struct iattr * iap; 439 struct iattr * iap;
384 const struct nfs_server * server; /* Needed for name mapping */ 440 const struct nfs_server * server; /* Needed for name mapping */
385 const u32 * bitmask; 441 const u32 * bitmask;
442 struct nfs4_sequence_args seq_args;
386}; 443};
387 444
388struct nfs_setaclargs { 445struct nfs_setaclargs {
@@ -390,6 +447,11 @@ struct nfs_setaclargs {
390 size_t acl_len; 447 size_t acl_len;
391 unsigned int acl_pgbase; 448 unsigned int acl_pgbase;
392 struct page ** acl_pages; 449 struct page ** acl_pages;
450 struct nfs4_sequence_args seq_args;
451};
452
453struct nfs_setaclres {
454 struct nfs4_sequence_res seq_res;
393}; 455};
394 456
395struct nfs_getaclargs { 457struct nfs_getaclargs {
@@ -397,11 +459,18 @@ struct nfs_getaclargs {
397 size_t acl_len; 459 size_t acl_len;
398 unsigned int acl_pgbase; 460 unsigned int acl_pgbase;
399 struct page ** acl_pages; 461 struct page ** acl_pages;
462 struct nfs4_sequence_args seq_args;
463};
464
465struct nfs_getaclres {
466 size_t acl_len;
467 struct nfs4_sequence_res seq_res;
400}; 468};
401 469
402struct nfs_setattrres { 470struct nfs_setattrres {
403 struct nfs_fattr * fattr; 471 struct nfs_fattr * fattr;
404 const struct nfs_server * server; 472 const struct nfs_server * server;
473 struct nfs4_sequence_res seq_res;
405}; 474};
406 475
407struct nfs_linkargs { 476struct nfs_linkargs {
@@ -583,6 +652,7 @@ struct nfs4_accessargs {
583 const struct nfs_fh * fh; 652 const struct nfs_fh * fh;
584 const u32 * bitmask; 653 const u32 * bitmask;
585 u32 access; 654 u32 access;
655 struct nfs4_sequence_args seq_args;
586}; 656};
587 657
588struct nfs4_accessres { 658struct nfs4_accessres {
@@ -590,6 +660,7 @@ struct nfs4_accessres {
590 struct nfs_fattr * fattr; 660 struct nfs_fattr * fattr;
591 u32 supported; 661 u32 supported;
592 u32 access; 662 u32 access;
663 struct nfs4_sequence_res seq_res;
593}; 664};
594 665
595struct nfs4_create_arg { 666struct nfs4_create_arg {
@@ -609,6 +680,7 @@ struct nfs4_create_arg {
609 const struct iattr * attrs; 680 const struct iattr * attrs;
610 const struct nfs_fh * dir_fh; 681 const struct nfs_fh * dir_fh;
611 const u32 * bitmask; 682 const u32 * bitmask;
683 struct nfs4_sequence_args seq_args;
612}; 684};
613 685
614struct nfs4_create_res { 686struct nfs4_create_res {
@@ -617,21 +689,30 @@ struct nfs4_create_res {
617 struct nfs_fattr * fattr; 689 struct nfs_fattr * fattr;
618 struct nfs4_change_info dir_cinfo; 690 struct nfs4_change_info dir_cinfo;
619 struct nfs_fattr * dir_fattr; 691 struct nfs_fattr * dir_fattr;
692 struct nfs4_sequence_res seq_res;
620}; 693};
621 694
622struct nfs4_fsinfo_arg { 695struct nfs4_fsinfo_arg {
623 const struct nfs_fh * fh; 696 const struct nfs_fh * fh;
624 const u32 * bitmask; 697 const u32 * bitmask;
698 struct nfs4_sequence_args seq_args;
699};
700
701struct nfs4_fsinfo_res {
702 struct nfs_fsinfo *fsinfo;
703 struct nfs4_sequence_res seq_res;
625}; 704};
626 705
627struct nfs4_getattr_arg { 706struct nfs4_getattr_arg {
628 const struct nfs_fh * fh; 707 const struct nfs_fh * fh;
629 const u32 * bitmask; 708 const u32 * bitmask;
709 struct nfs4_sequence_args seq_args;
630}; 710};
631 711
632struct nfs4_getattr_res { 712struct nfs4_getattr_res {
633 const struct nfs_server * server; 713 const struct nfs_server * server;
634 struct nfs_fattr * fattr; 714 struct nfs_fattr * fattr;
715 struct nfs4_sequence_res seq_res;
635}; 716};
636 717
637struct nfs4_link_arg { 718struct nfs4_link_arg {
@@ -639,6 +720,7 @@ struct nfs4_link_arg {
639 const struct nfs_fh * dir_fh; 720 const struct nfs_fh * dir_fh;
640 const struct qstr * name; 721 const struct qstr * name;
641 const u32 * bitmask; 722 const u32 * bitmask;
723 struct nfs4_sequence_args seq_args;
642}; 724};
643 725
644struct nfs4_link_res { 726struct nfs4_link_res {
@@ -646,6 +728,7 @@ struct nfs4_link_res {
646 struct nfs_fattr * fattr; 728 struct nfs_fattr * fattr;
647 struct nfs4_change_info cinfo; 729 struct nfs4_change_info cinfo;
648 struct nfs_fattr * dir_attr; 730 struct nfs_fattr * dir_attr;
731 struct nfs4_sequence_res seq_res;
649}; 732};
650 733
651 734
@@ -653,21 +736,30 @@ struct nfs4_lookup_arg {
653 const struct nfs_fh * dir_fh; 736 const struct nfs_fh * dir_fh;
654 const struct qstr * name; 737 const struct qstr * name;
655 const u32 * bitmask; 738 const u32 * bitmask;
739 struct nfs4_sequence_args seq_args;
656}; 740};
657 741
658struct nfs4_lookup_res { 742struct nfs4_lookup_res {
659 const struct nfs_server * server; 743 const struct nfs_server * server;
660 struct nfs_fattr * fattr; 744 struct nfs_fattr * fattr;
661 struct nfs_fh * fh; 745 struct nfs_fh * fh;
746 struct nfs4_sequence_res seq_res;
662}; 747};
663 748
664struct nfs4_lookup_root_arg { 749struct nfs4_lookup_root_arg {
665 const u32 * bitmask; 750 const u32 * bitmask;
751 struct nfs4_sequence_args seq_args;
666}; 752};
667 753
668struct nfs4_pathconf_arg { 754struct nfs4_pathconf_arg {
669 const struct nfs_fh * fh; 755 const struct nfs_fh * fh;
670 const u32 * bitmask; 756 const u32 * bitmask;
757 struct nfs4_sequence_args seq_args;
758};
759
760struct nfs4_pathconf_res {
761 struct nfs_pathconf *pathconf;
762 struct nfs4_sequence_res seq_res;
671}; 763};
672 764
673struct nfs4_readdir_arg { 765struct nfs4_readdir_arg {
@@ -678,11 +770,13 @@ struct nfs4_readdir_arg {
678 struct page ** pages; /* zero-copy data */ 770 struct page ** pages; /* zero-copy data */
679 unsigned int pgbase; /* zero-copy data */ 771 unsigned int pgbase; /* zero-copy data */
680 const u32 * bitmask; 772 const u32 * bitmask;
773 struct nfs4_sequence_args seq_args;
681}; 774};
682 775
683struct nfs4_readdir_res { 776struct nfs4_readdir_res {
684 nfs4_verifier verifier; 777 nfs4_verifier verifier;
685 unsigned int pgbase; 778 unsigned int pgbase;
779 struct nfs4_sequence_res seq_res;
686}; 780};
687 781
688struct nfs4_readlink { 782struct nfs4_readlink {
@@ -690,6 +784,11 @@ struct nfs4_readlink {
690 unsigned int pgbase; 784 unsigned int pgbase;
691 unsigned int pglen; /* zero-copy data */ 785 unsigned int pglen; /* zero-copy data */
692 struct page ** pages; /* zero-copy data */ 786 struct page ** pages; /* zero-copy data */
787 struct nfs4_sequence_args seq_args;
788};
789
790struct nfs4_readlink_res {
791 struct nfs4_sequence_res seq_res;
693}; 792};
694 793
695struct nfs4_rename_arg { 794struct nfs4_rename_arg {
@@ -698,6 +797,7 @@ struct nfs4_rename_arg {
698 const struct qstr * old_name; 797 const struct qstr * old_name;
699 const struct qstr * new_name; 798 const struct qstr * new_name;
700 const u32 * bitmask; 799 const u32 * bitmask;
800 struct nfs4_sequence_args seq_args;
701}; 801};
702 802
703struct nfs4_rename_res { 803struct nfs4_rename_res {
@@ -706,6 +806,7 @@ struct nfs4_rename_res {
706 struct nfs_fattr * old_fattr; 806 struct nfs_fattr * old_fattr;
707 struct nfs4_change_info new_cinfo; 807 struct nfs4_change_info new_cinfo;
708 struct nfs_fattr * new_fattr; 808 struct nfs_fattr * new_fattr;
809 struct nfs4_sequence_res seq_res;
709}; 810};
710 811
711#define NFS4_SETCLIENTID_NAMELEN (127) 812#define NFS4_SETCLIENTID_NAMELEN (127)
@@ -724,6 +825,17 @@ struct nfs4_setclientid {
724struct nfs4_statfs_arg { 825struct nfs4_statfs_arg {
725 const struct nfs_fh * fh; 826 const struct nfs_fh * fh;
726 const u32 * bitmask; 827 const u32 * bitmask;
828 struct nfs4_sequence_args seq_args;
829};
830
831struct nfs4_statfs_res {
832 struct nfs_fsstat *fsstat;
833 struct nfs4_sequence_res seq_res;
834};
835
836struct nfs4_server_caps_arg {
837 struct nfs_fh *fhandle;
838 struct nfs4_sequence_args seq_args;
727}; 839};
728 840
729struct nfs4_server_caps_res { 841struct nfs4_server_caps_res {
@@ -731,6 +843,7 @@ struct nfs4_server_caps_res {
731 u32 acl_bitmask; 843 u32 acl_bitmask;
732 u32 has_links; 844 u32 has_links;
733 u32 has_symlinks; 845 u32 has_symlinks;
846 struct nfs4_sequence_res seq_res;
734}; 847};
735 848
736struct nfs4_string { 849struct nfs4_string {
@@ -765,10 +878,68 @@ struct nfs4_fs_locations_arg {
765 const struct qstr *name; 878 const struct qstr *name;
766 struct page *page; 879 struct page *page;
767 const u32 *bitmask; 880 const u32 *bitmask;
881 struct nfs4_sequence_args seq_args;
882};
883
884struct nfs4_fs_locations_res {
885 struct nfs4_fs_locations *fs_locations;
886 struct nfs4_sequence_res seq_res;
768}; 887};
769 888
770#endif /* CONFIG_NFS_V4 */ 889#endif /* CONFIG_NFS_V4 */
771 890
891struct nfstime4 {
892 u64 seconds;
893 u32 nseconds;
894};
895
896#ifdef CONFIG_NFS_V4_1
897struct nfs_impl_id4 {
898 u32 domain_len;
899 char *domain;
900 u32 name_len;
901 char *name;
902 struct nfstime4 date;
903};
904
905#define NFS4_EXCHANGE_ID_LEN (48)
906struct nfs41_exchange_id_args {
907 struct nfs_client *client;
908 nfs4_verifier *verifier;
909 unsigned int id_len;
910 char id[NFS4_EXCHANGE_ID_LEN];
911 u32 flags;
912};
913
914struct server_owner {
915 uint64_t minor_id;
916 uint32_t major_id_sz;
917 char major_id[NFS4_OPAQUE_LIMIT];
918};
919
920struct server_scope {
921 uint32_t server_scope_sz;
922 char server_scope[NFS4_OPAQUE_LIMIT];
923};
924
925struct nfs41_exchange_id_res {
926 struct nfs_client *client;
927 u32 flags;
928};
929
930struct nfs41_create_session_args {
931 struct nfs_client *client;
932 uint32_t flags;
933 uint32_t cb_program;
934 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
935 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
936};
937
938struct nfs41_create_session_res {
939 struct nfs_client *client;
940};
941#endif /* CONFIG_NFS_V4_1 */
942
772struct nfs_page; 943struct nfs_page;
773 944
774#define NFS_PAGEVEC_SIZE (8U) 945#define NFS_PAGEVEC_SIZE (8U)
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 4d61c873feed..7ef4b7ad1214 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -41,7 +41,6 @@
41#include <linux/kref.h> 41#include <linux/kref.h>
42#include <linux/sunrpc/clnt.h> 42#include <linux/sunrpc/clnt.h>
43 43
44#define NFS4_OPAQUE_LIMIT 1024
45typedef struct { 44typedef struct {
46 u32 cl_boot; 45 u32 cl_boot;
47 u32 cl_id; 46 u32 cl_id;
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
new file mode 100644
index 000000000000..6508f0dc0eff
--- /dev/null
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -0,0 +1,49 @@
1/******************************************************************************
2
3(c) 2008 NetApp. All Rights Reserved.
4
5NetApp provides this source code under the GPL v2 License.
6The GPL v2 license is available at
7http://opensource.org/licenses/gpl-license.php.
8
9THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
11LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
12A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
13CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
14EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
15PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
16PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
17LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
18NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20
21******************************************************************************/
22
23/*
24 * Functions to create and manage the backchannel
25 */
26
27#ifndef _LINUX_SUNRPC_BC_XPRT_H
28#define _LINUX_SUNRPC_BC_XPRT_H
29
30#include <linux/sunrpc/svcsock.h>
31#include <linux/sunrpc/xprt.h>
32#include <linux/sunrpc/sched.h>
33
34#ifdef CONFIG_NFS_V4_1
35struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt);
36void xprt_free_bc_request(struct rpc_rqst *req);
37int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
38void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs);
39void bc_release_request(struct rpc_task *);
40int bc_send(struct rpc_rqst *req);
41#else /* CONFIG_NFS_V4_1 */
42static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
43 unsigned int min_reqs)
44{
45 return 0;
46}
47#endif /* CONFIG_NFS_V4_1 */
48#endif /* _LINUX_SUNRPC_BC_XPRT_H */
49
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index c39a21040dcb..37881f1a0bd7 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -143,6 +143,7 @@ int rpc_call_sync(struct rpc_clnt *clnt,
143 const struct rpc_message *msg, int flags); 143 const struct rpc_message *msg, int flags);
144struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, 144struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred,
145 int flags); 145 int flags);
146void rpc_restart_call_prepare(struct rpc_task *);
146void rpc_restart_call(struct rpc_task *); 147void rpc_restart_call(struct rpc_task *);
147void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); 148void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
148size_t rpc_max_payload(struct rpc_clnt *); 149size_t rpc_max_payload(struct rpc_clnt *);
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 64981a2f1cae..401097781fc0 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -210,6 +210,8 @@ struct rpc_wait_queue {
210 */ 210 */
211struct rpc_task *rpc_new_task(const struct rpc_task_setup *); 211struct rpc_task *rpc_new_task(const struct rpc_task_setup *);
212struct rpc_task *rpc_run_task(const struct rpc_task_setup *); 212struct rpc_task *rpc_run_task(const struct rpc_task_setup *);
213struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req,
214 const struct rpc_call_ops *ops);
213void rpc_put_task(struct rpc_task *); 215void rpc_put_task(struct rpc_task *);
214void rpc_exit_task(struct rpc_task *); 216void rpc_exit_task(struct rpc_task *);
215void rpc_release_calldata(const struct rpc_call_ops *, void *); 217void rpc_release_calldata(const struct rpc_call_ops *, void *);
@@ -237,6 +239,7 @@ void rpc_show_tasks(void);
237int rpc_init_mempool(void); 239int rpc_init_mempool(void);
238void rpc_destroy_mempool(void); 240void rpc_destroy_mempool(void);
239extern struct workqueue_struct *rpciod_workqueue; 241extern struct workqueue_struct *rpciod_workqueue;
242void rpc_prepare_task(struct rpc_task *task);
240 243
241static inline void rpc_exit(struct rpc_task *task, int status) 244static inline void rpc_exit(struct rpc_task *task, int status)
242{ 245{
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 2a30775959e9..ea8009695c69 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -96,6 +96,15 @@ struct svc_serv {
96 svc_thread_fn sv_function; /* main function for threads */ 96 svc_thread_fn sv_function; /* main function for threads */
97 unsigned int sv_drc_max_pages; /* Total pages for DRC */ 97 unsigned int sv_drc_max_pages; /* Total pages for DRC */
98 unsigned int sv_drc_pages_used;/* DRC pages used */ 98 unsigned int sv_drc_pages_used;/* DRC pages used */
99#if defined(CONFIG_NFS_V4_1)
100 struct list_head sv_cb_list; /* queue for callback requests
101 * that arrive over the same
102 * connection */
103 spinlock_t sv_cb_lock; /* protects the svc_cb_list */
104 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no
105 * entries in the svc_cb_list */
106 struct svc_xprt *bc_xprt;
107#endif /* CONFIG_NFS_V4_1 */
99}; 108};
100 109
101/* 110/*
@@ -411,6 +420,8 @@ int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
411int svc_pool_stats_open(struct svc_serv *serv, struct file *file); 420int svc_pool_stats_open(struct svc_serv *serv, struct file *file);
412void svc_destroy(struct svc_serv *); 421void svc_destroy(struct svc_serv *);
413int svc_process(struct svc_rqst *); 422int svc_process(struct svc_rqst *);
423int bc_svc_process(struct svc_serv *, struct rpc_rqst *,
424 struct svc_rqst *);
414int svc_register(const struct svc_serv *, const int, 425int svc_register(const struct svc_serv *, const int,
415 const unsigned short, const unsigned short); 426 const unsigned short, const unsigned short);
416 427
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 483e10380aae..6bb1ec4ae310 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -42,6 +42,8 @@ int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose);
42int svc_addsock(struct svc_serv *serv, int fd, char *name_return); 42int svc_addsock(struct svc_serv *serv, int fd, char *name_return);
43void svc_init_xprt_sock(void); 43void svc_init_xprt_sock(void);
44void svc_cleanup_xprt_sock(void); 44void svc_cleanup_xprt_sock(void);
45struct svc_xprt *svc_sock_create(struct svc_serv *serv, int prot);
46void svc_sock_destroy(struct svc_xprt *);
45 47
46/* 48/*
47 * svc_makesock socket characteristics 49 * svc_makesock socket characteristics
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 08afe43118f4..1175d58efc2e 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -67,7 +67,8 @@ struct rpc_rqst {
67 struct rpc_task * rq_task; /* RPC task data */ 67 struct rpc_task * rq_task; /* RPC task data */
68 __be32 rq_xid; /* request XID */ 68 __be32 rq_xid; /* request XID */
69 int rq_cong; /* has incremented xprt->cong */ 69 int rq_cong; /* has incremented xprt->cong */
70 int rq_received; /* receive completed */ 70 int rq_reply_bytes_recvd; /* number of reply */
71 /* bytes received */
71 u32 rq_seqno; /* gss seq no. used on req. */ 72 u32 rq_seqno; /* gss seq no. used on req. */
72 int rq_enc_pages_num; 73 int rq_enc_pages_num;
73 struct page **rq_enc_pages; /* scratch pages for use by 74 struct page **rq_enc_pages; /* scratch pages for use by
@@ -97,6 +98,12 @@ struct rpc_rqst {
97 98
98 unsigned long rq_xtime; /* when transmitted */ 99 unsigned long rq_xtime; /* when transmitted */
99 int rq_ntrans; 100 int rq_ntrans;
101
102#if defined(CONFIG_NFS_V4_1)
103 struct list_head rq_bc_list; /* Callback service list */
104 unsigned long rq_bc_pa_state; /* Backchannel prealloc state */
105 struct list_head rq_bc_pa_list; /* Backchannel prealloc list */
106#endif /* CONFIG_NFS_V4_1 */
100}; 107};
101#define rq_svec rq_snd_buf.head 108#define rq_svec rq_snd_buf.head
102#define rq_slen rq_snd_buf.len 109#define rq_slen rq_snd_buf.len
@@ -174,6 +181,15 @@ struct rpc_xprt {
174 spinlock_t reserve_lock; /* lock slot table */ 181 spinlock_t reserve_lock; /* lock slot table */
175 u32 xid; /* Next XID value to use */ 182 u32 xid; /* Next XID value to use */
176 struct rpc_task * snd_task; /* Task blocked in send */ 183 struct rpc_task * snd_task; /* Task blocked in send */
184#if defined(CONFIG_NFS_V4_1)
185 struct svc_serv *bc_serv; /* The RPC service which will */
186 /* process the callback */
187 unsigned int bc_alloc_count; /* Total number of preallocs */
188 spinlock_t bc_pa_lock; /* Protects the preallocated
189 * items */
190 struct list_head bc_pa_list; /* List of preallocated
191 * backchannel rpc_rqst's */
192#endif /* CONFIG_NFS_V4_1 */
177 struct list_head recv; 193 struct list_head recv;
178 194
179 struct { 195 struct {
@@ -192,6 +208,26 @@ struct rpc_xprt {
192 const char *address_strings[RPC_DISPLAY_MAX]; 208 const char *address_strings[RPC_DISPLAY_MAX];
193}; 209};
194 210
211#if defined(CONFIG_NFS_V4_1)
212/*
213 * Backchannel flags
214 */
215#define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */
216 /* buffer in use */
217#endif /* CONFIG_NFS_V4_1 */
218
219#if defined(CONFIG_NFS_V4_1)
220static inline int bc_prealloc(struct rpc_rqst *req)
221{
222 return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
223}
224#else
225static inline int bc_prealloc(struct rpc_rqst *req)
226{
227 return 0;
228}
229#endif /* CONFIG_NFS_V4_1 */
230
195struct xprt_create { 231struct xprt_create {
196 int ident; /* XPRT_TRANSPORT identifier */ 232 int ident; /* XPRT_TRANSPORT identifier */
197 struct sockaddr * srcaddr; /* optional local address */ 233 struct sockaddr * srcaddr; /* optional local address */