aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_xdr.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/nfs_xdr.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/linux/nfs_xdr.h')
-rw-r--r--include/linux/nfs_xdr.h240
1 files changed, 191 insertions, 49 deletions
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index fc461926c412..00848d86ffb2 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/nfsacl.h> 4#include <linux/nfsacl.h>
5#include <linux/nfs3.h> 5#include <linux/nfs3.h>
6#include <linux/sunrpc/gss_api.h>
6 7
7/* 8/*
8 * To change the maximum rsize and wsize supported by the NFS client, adjust 9 * To change the maximum rsize and wsize supported by the NFS client, adjust
@@ -14,6 +15,9 @@
14#define NFS_DEF_FILE_IO_SIZE (4096U) 15#define NFS_DEF_FILE_IO_SIZE (4096U)
15#define NFS_MIN_FILE_IO_SIZE (1024U) 16#define NFS_MIN_FILE_IO_SIZE (1024U)
16 17
18/* Forward declaration for NFS v3 */
19struct nfs4_secinfo_flavors;
20
17struct nfs_fsid { 21struct nfs_fsid {
18 uint64_t major; 22 uint64_t major;
19 uint64_t minor; 23 uint64_t minor;
@@ -46,6 +50,7 @@ struct nfs_fattr {
46 } du; 50 } du;
47 struct nfs_fsid fsid; 51 struct nfs_fsid fsid;
48 __u64 fileid; 52 __u64 fileid;
53 __u64 mounted_on_fileid;
49 struct timespec atime; 54 struct timespec atime;
50 struct timespec mtime; 55 struct timespec mtime;
51 struct timespec ctime; 56 struct timespec ctime;
@@ -78,6 +83,8 @@ struct nfs_fattr {
78#define NFS_ATTR_FATTR_CHANGE (1U << 17) 83#define NFS_ATTR_FATTR_CHANGE (1U << 17)
79#define NFS_ATTR_FATTR_PRECHANGE (1U << 18) 84#define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
80#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */ 85#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
86#define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */
87#define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 21)
81 88
82#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ 89#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
83 | NFS_ATTR_FATTR_MODE \ 90 | NFS_ATTR_FATTR_MODE \
@@ -112,7 +119,9 @@ struct nfs_fsinfo {
112 __u32 wtmult; /* writes should be multiple of this */ 119 __u32 wtmult; /* writes should be multiple of this */
113 __u32 dtpref; /* pref. readdir transfer size */ 120 __u32 dtpref; /* pref. readdir transfer size */
114 __u64 maxfilesize; 121 __u64 maxfilesize;
122 struct timespec time_delta; /* server time granularity */
115 __u32 lease_time; /* in seconds */ 123 __u32 lease_time; /* in seconds */
124 __u32 layouttype; /* supported pnfs layout driver */
116}; 125};
117 126
118struct nfs_fsstat { 127struct nfs_fsstat {
@@ -149,7 +158,6 @@ struct nfs_seqid;
149 158
150/* nfs41 sessions channel attributes */ 159/* nfs41 sessions channel attributes */
151struct nfs4_channel_attrs { 160struct nfs4_channel_attrs {
152 u32 headerpadsz;
153 u32 max_rqst_sz; 161 u32 max_rqst_sz;
154 u32 max_resp_sz; 162 u32 max_resp_sz;
155 u32 max_resp_sz_cached; 163 u32 max_resp_sz_cached;
@@ -170,7 +178,7 @@ struct nfs4_sequence_args {
170 178
171struct nfs4_sequence_res { 179struct nfs4_sequence_res {
172 struct nfs4_session *sr_session; 180 struct nfs4_session *sr_session;
173 u8 sr_slotid; /* slot used to send request */ 181 struct nfs4_slot *sr_slot; /* slot used to send request */
174 int sr_status; /* sequence operation status */ 182 int sr_status; /* sequence operation status */
175 unsigned long sr_renewal_time; 183 unsigned long sr_renewal_time;
176 u32 sr_status_flags; 184 u32 sr_status_flags;
@@ -185,6 +193,102 @@ struct nfs4_get_lease_time_res {
185 struct nfs4_sequence_res lr_seq_res; 193 struct nfs4_sequence_res lr_seq_res;
186}; 194};
187 195
196#define PNFS_LAYOUT_MAXSIZE 4096
197
198struct nfs4_layoutdriver_data {
199 struct page **pages;
200 __u32 pglen;
201 __u32 len;
202};
203
204struct pnfs_layout_range {
205 u32 iomode;
206 u64 offset;
207 u64 length;
208};
209
210struct nfs4_layoutget_args {
211 __u32 type;
212 struct pnfs_layout_range range;
213 __u64 minlength;
214 __u32 maxcount;
215 struct inode *inode;
216 struct nfs_open_context *ctx;
217 struct nfs4_sequence_args seq_args;
218 nfs4_stateid stateid;
219 struct nfs4_layoutdriver_data layout;
220};
221
222struct nfs4_layoutget_res {
223 __u32 return_on_close;
224 struct pnfs_layout_range range;
225 __u32 type;
226 nfs4_stateid stateid;
227 struct nfs4_sequence_res seq_res;
228 struct nfs4_layoutdriver_data *layoutp;
229};
230
231struct nfs4_layoutget {
232 struct nfs4_layoutget_args args;
233 struct nfs4_layoutget_res res;
234 struct pnfs_layout_segment **lsegpp;
235 gfp_t gfp_flags;
236};
237
238struct nfs4_getdeviceinfo_args {
239 struct pnfs_device *pdev;
240 struct nfs4_sequence_args seq_args;
241};
242
243struct nfs4_getdeviceinfo_res {
244 struct pnfs_device *pdev;
245 struct nfs4_sequence_res seq_res;
246};
247
248struct nfs4_layoutcommit_args {
249 nfs4_stateid stateid;
250 __u64 lastbytewritten;
251 struct inode *inode;
252 const u32 *bitmask;
253 struct nfs4_sequence_args seq_args;
254};
255
256struct nfs4_layoutcommit_res {
257 struct nfs_fattr *fattr;
258 const struct nfs_server *server;
259 struct nfs4_sequence_res seq_res;
260};
261
262struct nfs4_layoutcommit_data {
263 struct rpc_task task;
264 struct nfs_fattr fattr;
265 struct pnfs_layout_segment *lseg;
266 struct rpc_cred *cred;
267 struct nfs4_layoutcommit_args args;
268 struct nfs4_layoutcommit_res res;
269};
270
271struct nfs4_layoutreturn_args {
272 __u32 layout_type;
273 struct inode *inode;
274 nfs4_stateid stateid;
275 struct nfs4_sequence_args seq_args;
276};
277
278struct nfs4_layoutreturn_res {
279 struct nfs4_sequence_res seq_res;
280 u32 lrs_present;
281 nfs4_stateid stateid;
282};
283
284struct nfs4_layoutreturn {
285 struct nfs4_layoutreturn_args args;
286 struct nfs4_layoutreturn_res res;
287 struct rpc_cred *cred;
288 struct nfs_client *clp;
289 int rpc_status;
290};
291
188/* 292/*
189 * Arguments to the open call. 293 * Arguments to the open call.
190 */ 294 */
@@ -266,6 +370,7 @@ struct nfs_closeres {
266struct nfs_lowner { 370struct nfs_lowner {
267 __u64 clientid; 371 __u64 clientid;
268 __u64 id; 372 __u64 id;
373 dev_t s_dev;
269}; 374};
270 375
271struct nfs_lock_args { 376struct nfs_lock_args {
@@ -400,6 +505,27 @@ struct nfs_removeres {
400}; 505};
401 506
402/* 507/*
508 * Common arguments to the rename call
509 */
510struct nfs_renameargs {
511 const struct nfs_fh *old_dir;
512 const struct nfs_fh *new_dir;
513 const struct qstr *old_name;
514 const struct qstr *new_name;
515 const u32 *bitmask;
516 struct nfs4_sequence_args seq_args;
517};
518
519struct nfs_renameres {
520 const struct nfs_server *server;
521 struct nfs4_change_info old_cinfo;
522 struct nfs_fattr *old_fattr;
523 struct nfs4_change_info new_cinfo;
524 struct nfs_fattr *new_fattr;
525 struct nfs4_sequence_res seq_res;
526};
527
528/*
403 * Argument struct for decode_entry function 529 * Argument struct for decode_entry function
404 */ 530 */
405struct nfs_entry { 531struct nfs_entry {
@@ -411,6 +537,8 @@ struct nfs_entry {
411 int eof; 537 int eof;
412 struct nfs_fh * fh; 538 struct nfs_fh * fh;
413 struct nfs_fattr * fattr; 539 struct nfs_fattr * fattr;
540 unsigned char d_type;
541 struct nfs_server * server;
414}; 542};
415 543
416/* 544/*
@@ -434,15 +562,6 @@ struct nfs_createargs {
434 struct iattr * sattr; 562 struct iattr * sattr;
435}; 563};
436 564
437struct nfs_renameargs {
438 struct nfs_fh * fromfh;
439 const char * fromname;
440 unsigned int fromlen;
441 struct nfs_fh * tofh;
442 const char * toname;
443 unsigned int tolen;
444};
445
446struct nfs_setattrargs { 565struct nfs_setattrargs {
447 struct nfs_fh * fh; 566 struct nfs_fh * fh;
448 nfs4_stateid stateid; 567 nfs4_stateid stateid;
@@ -586,15 +705,6 @@ struct nfs3_mknodargs {
586 dev_t rdev; 705 dev_t rdev;
587}; 706};
588 707
589struct nfs3_renameargs {
590 struct nfs_fh * fromfh;
591 const char * fromname;
592 unsigned int fromlen;
593 struct nfs_fh * tofh;
594 const char * toname;
595 unsigned int tolen;
596};
597
598struct nfs3_linkargs { 708struct nfs3_linkargs {
599 struct nfs_fh * fromfh; 709 struct nfs_fh * fromfh;
600 struct nfs_fh * tofh; 710 struct nfs_fh * tofh;
@@ -629,11 +739,6 @@ struct nfs3_readlinkargs {
629 struct page ** pages; 739 struct page ** pages;
630}; 740};
631 741
632struct nfs3_renameres {
633 struct nfs_fattr * fromattr;
634 struct nfs_fattr * toattr;
635};
636
637struct nfs3_linkres { 742struct nfs3_linkres {
638 struct nfs_fattr * dir_attr; 743 struct nfs_fattr * dir_attr;
639 struct nfs_fattr * fattr; 744 struct nfs_fattr * fattr;
@@ -780,6 +885,7 @@ struct nfs4_readdir_arg {
780 struct page ** pages; /* zero-copy data */ 885 struct page ** pages; /* zero-copy data */
781 unsigned int pgbase; /* zero-copy data */ 886 unsigned int pgbase; /* zero-copy data */
782 const u32 * bitmask; 887 const u32 * bitmask;
888 int plus;
783 struct nfs4_sequence_args seq_args; 889 struct nfs4_sequence_args seq_args;
784}; 890};
785 891
@@ -801,24 +907,6 @@ struct nfs4_readlink_res {
801 struct nfs4_sequence_res seq_res; 907 struct nfs4_sequence_res seq_res;
802}; 908};
803 909
804struct nfs4_rename_arg {
805 const struct nfs_fh * old_dir;
806 const struct nfs_fh * new_dir;
807 const struct qstr * old_name;
808 const struct qstr * new_name;
809 const u32 * bitmask;
810 struct nfs4_sequence_args seq_args;
811};
812
813struct nfs4_rename_res {
814 const struct nfs_server * server;
815 struct nfs4_change_info old_cinfo;
816 struct nfs_fattr * old_fattr;
817 struct nfs4_change_info new_cinfo;
818 struct nfs_fattr * new_fattr;
819 struct nfs4_sequence_res seq_res;
820};
821
822#define NFS4_SETCLIENTID_NAMELEN (127) 910#define NFS4_SETCLIENTID_NAMELEN (127)
823struct nfs4_setclientid { 911struct nfs4_setclientid {
824 const nfs4_verifier * sc_verifier; 912 const nfs4_verifier * sc_verifier;
@@ -901,6 +989,38 @@ struct nfs4_fs_locations_res {
901 struct nfs4_sequence_res seq_res; 989 struct nfs4_sequence_res seq_res;
902}; 990};
903 991
992struct nfs4_secinfo_oid {
993 unsigned int len;
994 char data[GSS_OID_MAX_LEN];
995};
996
997struct nfs4_secinfo_gss {
998 struct nfs4_secinfo_oid sec_oid4;
999 unsigned int qop4;
1000 unsigned int service;
1001};
1002
1003struct nfs4_secinfo_flavor {
1004 unsigned int flavor;
1005 struct nfs4_secinfo_gss gss;
1006};
1007
1008struct nfs4_secinfo_flavors {
1009 unsigned int num_flavors;
1010 struct nfs4_secinfo_flavor flavors[0];
1011};
1012
1013struct nfs4_secinfo_arg {
1014 const struct nfs_fh *dir_fh;
1015 const struct qstr *name;
1016 struct nfs4_sequence_args seq_args;
1017};
1018
1019struct nfs4_secinfo_res {
1020 struct nfs4_secinfo_flavors *flavors;
1021 struct nfs4_sequence_res seq_res;
1022};
1023
904#endif /* CONFIG_NFS_V4 */ 1024#endif /* CONFIG_NFS_V4 */
905 1025
906struct nfstime4 { 1026struct nfstime4 {
@@ -981,9 +1101,13 @@ struct nfs_read_data {
981 unsigned int npages; /* Max length of pagevec */ 1101 unsigned int npages; /* Max length of pagevec */
982 struct nfs_readargs args; 1102 struct nfs_readargs args;
983 struct nfs_readres res; 1103 struct nfs_readres res;
984#ifdef CONFIG_NFS_V4
985 unsigned long timestamp; /* For lease renewal */ 1104 unsigned long timestamp; /* For lease renewal */
986#endif 1105 struct pnfs_layout_segment *lseg;
1106 struct nfs_client *ds_clp; /* pNFS data server */
1107 const struct rpc_call_ops *mds_ops;
1108 int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
1109 __u64 mds_offset;
1110 int pnfs_error;
987 struct page *page_array[NFS_PAGEVEC_SIZE]; 1111 struct page *page_array[NFS_PAGEVEC_SIZE];
988}; 1112};
989 1113
@@ -1000,13 +1124,22 @@ struct nfs_write_data {
1000 unsigned int npages; /* Max length of pagevec */ 1124 unsigned int npages; /* Max length of pagevec */
1001 struct nfs_writeargs args; /* argument struct */ 1125 struct nfs_writeargs args; /* argument struct */
1002 struct nfs_writeres res; /* result struct */ 1126 struct nfs_writeres res; /* result struct */
1127 struct pnfs_layout_segment *lseg;
1128 struct nfs_client *ds_clp; /* pNFS data server */
1129 int ds_commit_index;
1130 const struct rpc_call_ops *mds_ops;
1131 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1003#ifdef CONFIG_NFS_V4 1132#ifdef CONFIG_NFS_V4
1004 unsigned long timestamp; /* For lease renewal */ 1133 unsigned long timestamp; /* For lease renewal */
1005#endif 1134#endif
1135 __u64 mds_offset; /* Filelayout dense stripe */
1136 int pnfs_error;
1006 struct page *page_array[NFS_PAGEVEC_SIZE]; 1137 struct page *page_array[NFS_PAGEVEC_SIZE];
1007}; 1138};
1008 1139
1009struct nfs_access_entry; 1140struct nfs_access_entry;
1141struct nfs_client;
1142struct rpc_timeout;
1010 1143
1011/* 1144/*
1012 * RPC procedure vector for NFSv2/NFSv3 demuxing 1145 * RPC procedure vector for NFSv2/NFSv3 demuxing
@@ -1026,25 +1159,27 @@ struct nfs_rpc_ops {
1026 struct nfs_fattr *); 1159 struct nfs_fattr *);
1027 int (*setattr) (struct dentry *, struct nfs_fattr *, 1160 int (*setattr) (struct dentry *, struct nfs_fattr *,
1028 struct iattr *); 1161 struct iattr *);
1029 int (*lookup) (struct inode *, struct qstr *, 1162 int (*lookup) (struct rpc_clnt *clnt, struct inode *, struct qstr *,
1030 struct nfs_fh *, struct nfs_fattr *); 1163 struct nfs_fh *, struct nfs_fattr *);
1031 int (*access) (struct inode *, struct nfs_access_entry *); 1164 int (*access) (struct inode *, struct nfs_access_entry *);
1032 int (*readlink)(struct inode *, struct page *, unsigned int, 1165 int (*readlink)(struct inode *, struct page *, unsigned int,
1033 unsigned int); 1166 unsigned int);
1034 int (*create) (struct inode *, struct dentry *, 1167 int (*create) (struct inode *, struct dentry *,
1035 struct iattr *, int, struct nameidata *); 1168 struct iattr *, int, struct nfs_open_context *);
1036 int (*remove) (struct inode *, struct qstr *); 1169 int (*remove) (struct inode *, struct qstr *);
1037 void (*unlink_setup) (struct rpc_message *, struct inode *dir); 1170 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1038 int (*unlink_done) (struct rpc_task *, struct inode *); 1171 int (*unlink_done) (struct rpc_task *, struct inode *);
1039 int (*rename) (struct inode *, struct qstr *, 1172 int (*rename) (struct inode *, struct qstr *,
1040 struct inode *, struct qstr *); 1173 struct inode *, struct qstr *);
1174 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1175 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1041 int (*link) (struct inode *, struct inode *, struct qstr *); 1176 int (*link) (struct inode *, struct inode *, struct qstr *);
1042 int (*symlink) (struct inode *, struct dentry *, struct page *, 1177 int (*symlink) (struct inode *, struct dentry *, struct page *,
1043 unsigned int, struct iattr *); 1178 unsigned int, struct iattr *);
1044 int (*mkdir) (struct inode *, struct dentry *, struct iattr *); 1179 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1045 int (*rmdir) (struct inode *, struct qstr *); 1180 int (*rmdir) (struct inode *, struct qstr *);
1046 int (*readdir) (struct dentry *, struct rpc_cred *, 1181 int (*readdir) (struct dentry *, struct rpc_cred *,
1047 u64, struct page *, unsigned int, int); 1182 u64, struct page **, unsigned int, int);
1048 int (*mknod) (struct inode *, struct dentry *, struct iattr *, 1183 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1049 dev_t); 1184 dev_t);
1050 int (*statfs) (struct nfs_server *, struct nfs_fh *, 1185 int (*statfs) (struct nfs_server *, struct nfs_fh *,
@@ -1054,7 +1189,7 @@ struct nfs_rpc_ops {
1054 int (*pathconf) (struct nfs_server *, struct nfs_fh *, 1189 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1055 struct nfs_pathconf *); 1190 struct nfs_pathconf *);
1056 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); 1191 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1057 __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus); 1192 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
1058 void (*read_setup) (struct nfs_read_data *, struct rpc_message *); 1193 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
1059 int (*read_done) (struct rpc_task *, struct nfs_read_data *); 1194 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1060 void (*write_setup) (struct nfs_write_data *, struct rpc_message *); 1195 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
@@ -1065,6 +1200,13 @@ struct nfs_rpc_ops {
1065 int (*lock_check_bounds)(const struct file_lock *); 1200 int (*lock_check_bounds)(const struct file_lock *);
1066 void (*clear_acl_cache)(struct inode *); 1201 void (*clear_acl_cache)(struct inode *);
1067 void (*close_context)(struct nfs_open_context *ctx, int); 1202 void (*close_context)(struct nfs_open_context *ctx, int);
1203 struct inode * (*open_context) (struct inode *dir,
1204 struct nfs_open_context *ctx,
1205 int open_flags,
1206 struct iattr *iattr);
1207 int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1208 const char *, rpc_authflavor_t, int);
1209 int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
1068}; 1210};
1069 1211
1070/* 1212/*