0001
0002 #ifndef _LINUX_NFS_XDR_H
0003 #define _LINUX_NFS_XDR_H
0004
0005 #include <linux/nfsacl.h>
0006 #include <linux/sunrpc/gss_api.h>
0007
0008
0009
0010
0011
0012
0013
0014 #define NFS_MAX_FILE_IO_SIZE (1048576U)
0015 #define NFS_DEF_FILE_IO_SIZE (4096U)
0016 #define NFS_MIN_FILE_IO_SIZE (1024U)
0017
0018 #define NFS_BITMASK_SZ 3
0019
0020 struct nfs4_string {
0021 unsigned int len;
0022 char *data;
0023 };
0024
0025 struct nfs_fsid {
0026 uint64_t major;
0027 uint64_t minor;
0028 };
0029
0030
0031
0032
0033 static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
0034 {
0035 return a->major == b->major && a->minor == b->minor;
0036 }
0037
0038 struct nfs4_threshold {
0039 __u32 bm;
0040 __u32 l_type;
0041 __u64 rd_sz;
0042 __u64 wr_sz;
0043 __u64 rd_io_sz;
0044 __u64 wr_io_sz;
0045 };
0046
0047 struct nfs_fattr {
0048 unsigned int valid;
0049 umode_t mode;
0050 __u32 nlink;
0051 kuid_t uid;
0052 kgid_t gid;
0053 dev_t rdev;
0054 __u64 size;
0055 union {
0056 struct {
0057 __u32 blocksize;
0058 __u32 blocks;
0059 } nfs2;
0060 struct {
0061 __u64 used;
0062 } nfs3;
0063 } du;
0064 struct nfs_fsid fsid;
0065 __u64 fileid;
0066 __u64 mounted_on_fileid;
0067 struct timespec64 atime;
0068 struct timespec64 mtime;
0069 struct timespec64 ctime;
0070 __u64 change_attr;
0071 __u64 pre_change_attr;
0072 __u64 pre_size;
0073 struct timespec64 pre_mtime;
0074 struct timespec64 pre_ctime;
0075 unsigned long time_start;
0076 unsigned long gencount;
0077 struct nfs4_string *owner_name;
0078 struct nfs4_string *group_name;
0079 struct nfs4_threshold *mdsthreshold;
0080 struct nfs4_label *label;
0081 };
0082
0083 #define NFS_ATTR_FATTR_TYPE (1U << 0)
0084 #define NFS_ATTR_FATTR_MODE (1U << 1)
0085 #define NFS_ATTR_FATTR_NLINK (1U << 2)
0086 #define NFS_ATTR_FATTR_OWNER (1U << 3)
0087 #define NFS_ATTR_FATTR_GROUP (1U << 4)
0088 #define NFS_ATTR_FATTR_RDEV (1U << 5)
0089 #define NFS_ATTR_FATTR_SIZE (1U << 6)
0090 #define NFS_ATTR_FATTR_PRESIZE (1U << 7)
0091 #define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
0092 #define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
0093 #define NFS_ATTR_FATTR_FSID (1U << 10)
0094 #define NFS_ATTR_FATTR_FILEID (1U << 11)
0095 #define NFS_ATTR_FATTR_ATIME (1U << 12)
0096 #define NFS_ATTR_FATTR_MTIME (1U << 13)
0097 #define NFS_ATTR_FATTR_CTIME (1U << 14)
0098 #define NFS_ATTR_FATTR_PREMTIME (1U << 15)
0099 #define NFS_ATTR_FATTR_PRECTIME (1U << 16)
0100 #define NFS_ATTR_FATTR_CHANGE (1U << 17)
0101 #define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
0102 #define NFS_ATTR_FATTR_V4_LOCATIONS (1U << 19)
0103 #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 20)
0104 #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 21)
0105 #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22)
0106 #define NFS_ATTR_FATTR_OWNER_NAME (1U << 23)
0107 #define NFS_ATTR_FATTR_GROUP_NAME (1U << 24)
0108 #define NFS_ATTR_FATTR_V4_SECURITY_LABEL (1U << 25)
0109
0110 #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
0111 | NFS_ATTR_FATTR_MODE \
0112 | NFS_ATTR_FATTR_NLINK \
0113 | NFS_ATTR_FATTR_OWNER \
0114 | NFS_ATTR_FATTR_GROUP \
0115 | NFS_ATTR_FATTR_RDEV \
0116 | NFS_ATTR_FATTR_SIZE \
0117 | NFS_ATTR_FATTR_FSID \
0118 | NFS_ATTR_FATTR_FILEID \
0119 | NFS_ATTR_FATTR_ATIME \
0120 | NFS_ATTR_FATTR_MTIME \
0121 | NFS_ATTR_FATTR_CTIME \
0122 | NFS_ATTR_FATTR_CHANGE)
0123 #define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
0124 | NFS_ATTR_FATTR_BLOCKS_USED)
0125 #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
0126 | NFS_ATTR_FATTR_SPACE_USED)
0127 #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
0128 | NFS_ATTR_FATTR_SPACE_USED \
0129 | NFS_ATTR_FATTR_V4_SECURITY_LABEL)
0130
0131
0132
0133
0134 #define NFS_MAX_LAYOUT_TYPES 8
0135
0136
0137
0138
0139 struct nfs_fsinfo {
0140 struct nfs_fattr *fattr;
0141 __u32 rtmax;
0142 __u32 rtpref;
0143 __u32 rtmult;
0144 __u32 wtmax;
0145 __u32 wtpref;
0146 __u32 wtmult;
0147 __u32 dtpref;
0148 __u64 maxfilesize;
0149 struct timespec64 time_delta;
0150 __u32 lease_time;
0151 __u32 nlayouttypes;
0152 __u32 layouttype[NFS_MAX_LAYOUT_TYPES];
0153 __u32 blksize;
0154 __u32 clone_blksize;
0155 enum nfs4_change_attr_type
0156 change_attr_type;
0157 __u32 xattr_support;
0158 };
0159
0160 struct nfs_fsstat {
0161 struct nfs_fattr *fattr;
0162 __u64 tbytes;
0163 __u64 fbytes;
0164 __u64 abytes;
0165 __u64 tfiles;
0166 __u64 ffiles;
0167 __u64 afiles;
0168 };
0169
0170 struct nfs2_fsstat {
0171 __u32 tsize;
0172 __u32 bsize;
0173 __u32 blocks;
0174 __u32 bfree;
0175 __u32 bavail;
0176 };
0177
0178 struct nfs_pathconf {
0179 struct nfs_fattr *fattr;
0180 __u32 max_link;
0181 __u32 max_namelen;
0182 };
0183
0184 struct nfs4_change_info {
0185 u32 atomic;
0186 u64 before;
0187 u64 after;
0188 };
0189
0190 struct nfs_seqid;
0191
0192
0193 struct nfs4_channel_attrs {
0194 u32 max_rqst_sz;
0195 u32 max_resp_sz;
0196 u32 max_resp_sz_cached;
0197 u32 max_ops;
0198 u32 max_reqs;
0199 };
0200
0201 struct nfs4_slot;
0202 struct nfs4_sequence_args {
0203 struct nfs4_slot *sa_slot;
0204 u8 sa_cache_this : 1,
0205 sa_privileged : 1;
0206 };
0207
0208 struct nfs4_sequence_res {
0209 struct nfs4_slot *sr_slot;
0210 unsigned long sr_timestamp;
0211 int sr_status;
0212 u32 sr_status_flags;
0213 u32 sr_highest_slotid;
0214 u32 sr_target_highest_slotid;
0215 };
0216
0217 struct nfs4_get_lease_time_args {
0218 struct nfs4_sequence_args la_seq_args;
0219 };
0220
0221 struct nfs4_get_lease_time_res {
0222 struct nfs4_sequence_res lr_seq_res;
0223 struct nfs_fsinfo *lr_fsinfo;
0224 };
0225
0226 struct xdr_stream;
0227 struct nfs4_xdr_opaque_data;
0228
0229 struct nfs4_xdr_opaque_ops {
0230 void (*encode)(struct xdr_stream *, const void *args,
0231 const struct nfs4_xdr_opaque_data *);
0232 void (*free)(struct nfs4_xdr_opaque_data *);
0233 };
0234
0235 struct nfs4_xdr_opaque_data {
0236 const struct nfs4_xdr_opaque_ops *ops;
0237 void *data;
0238 };
0239
0240 #define PNFS_LAYOUT_MAXSIZE 4096
0241
0242 struct nfs4_layoutdriver_data {
0243 struct page **pages;
0244 __u32 pglen;
0245 __u32 len;
0246 };
0247
0248 struct pnfs_layout_range {
0249 u32 iomode;
0250 u64 offset;
0251 u64 length;
0252 };
0253
0254 struct nfs4_layoutget_args {
0255 struct nfs4_sequence_args seq_args;
0256 __u32 type;
0257 struct pnfs_layout_range range;
0258 __u64 minlength;
0259 __u32 maxcount;
0260 struct inode *inode;
0261 struct nfs_open_context *ctx;
0262 nfs4_stateid stateid;
0263 struct nfs4_layoutdriver_data layout;
0264 };
0265
0266 struct nfs4_layoutget_res {
0267 struct nfs4_sequence_res seq_res;
0268 int status;
0269 __u32 return_on_close;
0270 struct pnfs_layout_range range;
0271 __u32 type;
0272 nfs4_stateid stateid;
0273 struct nfs4_layoutdriver_data *layoutp;
0274 };
0275
0276 struct nfs4_layoutget {
0277 struct nfs4_layoutget_args args;
0278 struct nfs4_layoutget_res res;
0279 const struct cred *cred;
0280 struct pnfs_layout_hdr *lo;
0281 gfp_t gfp_flags;
0282 };
0283
0284 struct nfs4_getdeviceinfo_args {
0285 struct nfs4_sequence_args seq_args;
0286 struct pnfs_device *pdev;
0287 __u32 notify_types;
0288 };
0289
0290 struct nfs4_getdeviceinfo_res {
0291 struct nfs4_sequence_res seq_res;
0292 struct pnfs_device *pdev;
0293 __u32 notification;
0294 };
0295
0296 struct nfs4_layoutcommit_args {
0297 struct nfs4_sequence_args seq_args;
0298 nfs4_stateid stateid;
0299 __u64 lastbytewritten;
0300 struct inode *inode;
0301 const u32 *bitmask;
0302 size_t layoutupdate_len;
0303 struct page *layoutupdate_page;
0304 struct page **layoutupdate_pages;
0305 __be32 *start_p;
0306 };
0307
0308 struct nfs4_layoutcommit_res {
0309 struct nfs4_sequence_res seq_res;
0310 struct nfs_fattr *fattr;
0311 const struct nfs_server *server;
0312 int status;
0313 };
0314
0315 struct nfs4_layoutcommit_data {
0316 struct rpc_task task;
0317 struct nfs_fattr fattr;
0318 struct list_head lseg_list;
0319 const struct cred *cred;
0320 struct inode *inode;
0321 struct nfs4_layoutcommit_args args;
0322 struct nfs4_layoutcommit_res res;
0323 };
0324
0325 struct nfs4_layoutreturn_args {
0326 struct nfs4_sequence_args seq_args;
0327 struct pnfs_layout_hdr *layout;
0328 struct inode *inode;
0329 struct pnfs_layout_range range;
0330 nfs4_stateid stateid;
0331 __u32 layout_type;
0332 struct nfs4_xdr_opaque_data *ld_private;
0333 };
0334
0335 struct nfs4_layoutreturn_res {
0336 struct nfs4_sequence_res seq_res;
0337 u32 lrs_present;
0338 nfs4_stateid stateid;
0339 };
0340
0341 struct nfs4_layoutreturn {
0342 struct nfs4_layoutreturn_args args;
0343 struct nfs4_layoutreturn_res res;
0344 const struct cred *cred;
0345 struct nfs_client *clp;
0346 struct inode *inode;
0347 int rpc_status;
0348 struct nfs4_xdr_opaque_data ld_private;
0349 };
0350
0351 #define PNFS_LAYOUTSTATS_MAXSIZE 256
0352
0353 struct nfs42_layoutstat_args;
0354 struct nfs42_layoutstat_devinfo;
0355 typedef void (*layoutstats_encode_t)(struct xdr_stream *,
0356 struct nfs42_layoutstat_args *,
0357 struct nfs42_layoutstat_devinfo *);
0358
0359
0360 struct nfs42_layoutstat_devinfo {
0361 struct nfs4_deviceid dev_id;
0362 __u64 offset;
0363 __u64 length;
0364 __u64 read_count;
0365 __u64 read_bytes;
0366 __u64 write_count;
0367 __u64 write_bytes;
0368 __u32 layout_type;
0369 struct nfs4_xdr_opaque_data ld_private;
0370 };
0371
0372 struct nfs42_layoutstat_args {
0373 struct nfs4_sequence_args seq_args;
0374 struct nfs_fh *fh;
0375 struct inode *inode;
0376 nfs4_stateid stateid;
0377 int num_dev;
0378 struct nfs42_layoutstat_devinfo *devinfo;
0379 };
0380
0381 struct nfs42_layoutstat_res {
0382 struct nfs4_sequence_res seq_res;
0383 int num_dev;
0384 int rpc_status;
0385 };
0386
0387 struct nfs42_layoutstat_data {
0388 struct inode *inode;
0389 struct nfs42_layoutstat_args args;
0390 struct nfs42_layoutstat_res res;
0391 };
0392
0393 struct nfs42_device_error {
0394 struct nfs4_deviceid dev_id;
0395 int status;
0396 enum nfs_opnum4 opnum;
0397 };
0398
0399 struct nfs42_layout_error {
0400 __u64 offset;
0401 __u64 length;
0402 nfs4_stateid stateid;
0403 struct nfs42_device_error errors[1];
0404 };
0405
0406 #define NFS42_LAYOUTERROR_MAX 5
0407
0408 struct nfs42_layouterror_args {
0409 struct nfs4_sequence_args seq_args;
0410 struct inode *inode;
0411 unsigned int num_errors;
0412 struct nfs42_layout_error errors[NFS42_LAYOUTERROR_MAX];
0413 };
0414
0415 struct nfs42_layouterror_res {
0416 struct nfs4_sequence_res seq_res;
0417 unsigned int num_errors;
0418 int rpc_status;
0419 };
0420
0421 struct nfs42_layouterror_data {
0422 struct nfs42_layouterror_args args;
0423 struct nfs42_layouterror_res res;
0424 struct inode *inode;
0425 struct pnfs_layout_segment *lseg;
0426 };
0427
0428 struct nfs42_clone_args {
0429 struct nfs4_sequence_args seq_args;
0430 struct nfs_fh *src_fh;
0431 struct nfs_fh *dst_fh;
0432 nfs4_stateid src_stateid;
0433 nfs4_stateid dst_stateid;
0434 __u64 src_offset;
0435 __u64 dst_offset;
0436 __u64 count;
0437 const u32 *dst_bitmask;
0438 };
0439
0440 struct nfs42_clone_res {
0441 struct nfs4_sequence_res seq_res;
0442 unsigned int rpc_status;
0443 struct nfs_fattr *dst_fattr;
0444 const struct nfs_server *server;
0445 };
0446
0447 struct stateowner_id {
0448 __u64 create_time;
0449 __u32 uniquifier;
0450 };
0451
0452
0453
0454
0455 struct nfs_openargs {
0456 struct nfs4_sequence_args seq_args;
0457 const struct nfs_fh * fh;
0458 struct nfs_seqid * seqid;
0459 int open_flags;
0460 fmode_t fmode;
0461 u32 share_access;
0462 u32 access;
0463 __u64 clientid;
0464 struct stateowner_id id;
0465 union {
0466 struct {
0467 struct iattr * attrs;
0468 nfs4_verifier verifier;
0469 };
0470 nfs4_stateid delegation;
0471 fmode_t delegation_type;
0472 } u;
0473 const struct qstr * name;
0474 const struct nfs_server *server;
0475 const u32 * bitmask;
0476 const u32 * open_bitmap;
0477 enum open_claim_type4 claim;
0478 enum createmode4 createmode;
0479 const struct nfs4_label *label;
0480 umode_t umask;
0481 struct nfs4_layoutget_args *lg_args;
0482 };
0483
0484 struct nfs_openres {
0485 struct nfs4_sequence_res seq_res;
0486 nfs4_stateid stateid;
0487 struct nfs_fh fh;
0488 struct nfs4_change_info cinfo;
0489 __u32 rflags;
0490 struct nfs_fattr * f_attr;
0491 struct nfs_seqid * seqid;
0492 const struct nfs_server *server;
0493 fmode_t delegation_type;
0494 nfs4_stateid delegation;
0495 unsigned long pagemod_limit;
0496 __u32 do_recall;
0497 __u32 attrset[NFS4_BITMAP_SIZE];
0498 struct nfs4_string *owner;
0499 struct nfs4_string *group_owner;
0500 __u32 access_request;
0501 __u32 access_supported;
0502 __u32 access_result;
0503 struct nfs4_layoutget_res *lg_res;
0504 };
0505
0506
0507
0508
0509 struct nfs_open_confirmargs {
0510 struct nfs4_sequence_args seq_args;
0511 const struct nfs_fh * fh;
0512 nfs4_stateid * stateid;
0513 struct nfs_seqid * seqid;
0514 };
0515
0516 struct nfs_open_confirmres {
0517 struct nfs4_sequence_res seq_res;
0518 nfs4_stateid stateid;
0519 struct nfs_seqid * seqid;
0520 };
0521
0522
0523
0524
0525 struct nfs_closeargs {
0526 struct nfs4_sequence_args seq_args;
0527 struct nfs_fh * fh;
0528 nfs4_stateid stateid;
0529 struct nfs_seqid * seqid;
0530 fmode_t fmode;
0531 u32 share_access;
0532 const u32 * bitmask;
0533 u32 bitmask_store[NFS_BITMASK_SZ];
0534 struct nfs4_layoutreturn_args *lr_args;
0535 };
0536
0537 struct nfs_closeres {
0538 struct nfs4_sequence_res seq_res;
0539 nfs4_stateid stateid;
0540 struct nfs_fattr * fattr;
0541 struct nfs_seqid * seqid;
0542 const struct nfs_server *server;
0543 struct nfs4_layoutreturn_res *lr_res;
0544 int lr_ret;
0545 };
0546
0547
0548
0549 struct nfs_lowner {
0550 __u64 clientid;
0551 __u64 id;
0552 dev_t s_dev;
0553 };
0554
0555 struct nfs_lock_args {
0556 struct nfs4_sequence_args seq_args;
0557 struct nfs_fh * fh;
0558 struct file_lock * fl;
0559 struct nfs_seqid * lock_seqid;
0560 nfs4_stateid lock_stateid;
0561 struct nfs_seqid * open_seqid;
0562 nfs4_stateid open_stateid;
0563 struct nfs_lowner lock_owner;
0564 unsigned char block : 1;
0565 unsigned char reclaim : 1;
0566 unsigned char new_lock : 1;
0567 unsigned char new_lock_owner : 1;
0568 };
0569
0570 struct nfs_lock_res {
0571 struct nfs4_sequence_res seq_res;
0572 nfs4_stateid stateid;
0573 struct nfs_seqid * lock_seqid;
0574 struct nfs_seqid * open_seqid;
0575 };
0576
0577 struct nfs_locku_args {
0578 struct nfs4_sequence_args seq_args;
0579 struct nfs_fh * fh;
0580 struct file_lock * fl;
0581 struct nfs_seqid * seqid;
0582 nfs4_stateid stateid;
0583 };
0584
0585 struct nfs_locku_res {
0586 struct nfs4_sequence_res seq_res;
0587 nfs4_stateid stateid;
0588 struct nfs_seqid * seqid;
0589 };
0590
0591 struct nfs_lockt_args {
0592 struct nfs4_sequence_args seq_args;
0593 struct nfs_fh * fh;
0594 struct file_lock * fl;
0595 struct nfs_lowner lock_owner;
0596 };
0597
0598 struct nfs_lockt_res {
0599 struct nfs4_sequence_res seq_res;
0600 struct file_lock * denied;
0601 };
0602
0603 struct nfs_release_lockowner_args {
0604 struct nfs4_sequence_args seq_args;
0605 struct nfs_lowner lock_owner;
0606 };
0607
0608 struct nfs_release_lockowner_res {
0609 struct nfs4_sequence_res seq_res;
0610 };
0611
0612 struct nfs4_delegreturnargs {
0613 struct nfs4_sequence_args seq_args;
0614 const struct nfs_fh *fhandle;
0615 const nfs4_stateid *stateid;
0616 const u32 *bitmask;
0617 u32 bitmask_store[NFS_BITMASK_SZ];
0618 struct nfs4_layoutreturn_args *lr_args;
0619 };
0620
0621 struct nfs4_delegreturnres {
0622 struct nfs4_sequence_res seq_res;
0623 struct nfs_fattr * fattr;
0624 struct nfs_server *server;
0625 struct nfs4_layoutreturn_res *lr_res;
0626 int lr_ret;
0627 };
0628
0629
0630
0631
0632 struct nfs_write_verifier {
0633 char data[8];
0634 };
0635
0636 struct nfs_writeverf {
0637 struct nfs_write_verifier verifier;
0638 enum nfs3_stable_how committed;
0639 };
0640
0641
0642
0643
0644 struct nfs_pgio_args {
0645 struct nfs4_sequence_args seq_args;
0646 struct nfs_fh * fh;
0647 struct nfs_open_context *context;
0648 struct nfs_lock_context *lock_context;
0649 nfs4_stateid stateid;
0650 __u64 offset;
0651 __u32 count;
0652 unsigned int pgbase;
0653 struct page ** pages;
0654 union {
0655 unsigned int replen;
0656 struct {
0657 const u32 * bitmask;
0658 u32 bitmask_store[NFS_BITMASK_SZ];
0659 enum nfs3_stable_how stable;
0660 };
0661 };
0662 };
0663
0664 struct nfs_pgio_res {
0665 struct nfs4_sequence_res seq_res;
0666 struct nfs_fattr * fattr;
0667 __u64 count;
0668 __u32 op_status;
0669 union {
0670 struct {
0671 unsigned int replen;
0672 int eof;
0673 };
0674 struct {
0675 struct nfs_writeverf * verf;
0676 const struct nfs_server *server;
0677 };
0678 };
0679 };
0680
0681
0682
0683
0684 struct nfs_commitargs {
0685 struct nfs4_sequence_args seq_args;
0686 struct nfs_fh *fh;
0687 __u64 offset;
0688 __u32 count;
0689 const u32 *bitmask;
0690 };
0691
0692 struct nfs_commitres {
0693 struct nfs4_sequence_res seq_res;
0694 __u32 op_status;
0695 struct nfs_fattr *fattr;
0696 struct nfs_writeverf *verf;
0697 const struct nfs_server *server;
0698 };
0699
0700
0701
0702
0703 struct nfs_removeargs {
0704 struct nfs4_sequence_args seq_args;
0705 const struct nfs_fh *fh;
0706 struct qstr name;
0707 };
0708
0709 struct nfs_removeres {
0710 struct nfs4_sequence_res seq_res;
0711 struct nfs_server *server;
0712 struct nfs_fattr *dir_attr;
0713 struct nfs4_change_info cinfo;
0714 };
0715
0716
0717
0718
0719 struct nfs_renameargs {
0720 struct nfs4_sequence_args seq_args;
0721 const struct nfs_fh *old_dir;
0722 const struct nfs_fh *new_dir;
0723 const struct qstr *old_name;
0724 const struct qstr *new_name;
0725 };
0726
0727 struct nfs_renameres {
0728 struct nfs4_sequence_res seq_res;
0729 struct nfs_server *server;
0730 struct nfs4_change_info old_cinfo;
0731 struct nfs_fattr *old_fattr;
0732 struct nfs4_change_info new_cinfo;
0733 struct nfs_fattr *new_fattr;
0734 };
0735
0736
0737 #define NFS_AUTH_INFO_MAX_FLAVORS 12
0738 struct nfs_auth_info {
0739 unsigned int flavor_len;
0740 rpc_authflavor_t flavors[NFS_AUTH_INFO_MAX_FLAVORS];
0741 };
0742
0743
0744
0745
0746 struct nfs_entry {
0747 __u64 ino;
0748 __u64 cookie;
0749 const char * name;
0750 unsigned int len;
0751 int eof;
0752 struct nfs_fh * fh;
0753 struct nfs_fattr * fattr;
0754 unsigned char d_type;
0755 struct nfs_server * server;
0756 };
0757
0758 struct nfs_readdir_arg {
0759 struct dentry *dentry;
0760 const struct cred *cred;
0761 __be32 *verf;
0762 u64 cookie;
0763 struct page **pages;
0764 unsigned int page_len;
0765 bool plus;
0766 };
0767
0768 struct nfs_readdir_res {
0769 __be32 *verf;
0770 };
0771
0772
0773
0774
0775 struct nfs_sattrargs {
0776 struct nfs_fh * fh;
0777 struct iattr * sattr;
0778 };
0779
0780 struct nfs_diropargs {
0781 struct nfs_fh * fh;
0782 const char * name;
0783 unsigned int len;
0784 };
0785
0786 struct nfs_createargs {
0787 struct nfs_fh * fh;
0788 const char * name;
0789 unsigned int len;
0790 struct iattr * sattr;
0791 };
0792
0793 struct nfs_setattrargs {
0794 struct nfs4_sequence_args seq_args;
0795 struct nfs_fh * fh;
0796 nfs4_stateid stateid;
0797 struct iattr * iap;
0798 const struct nfs_server * server;
0799 const u32 * bitmask;
0800 const struct nfs4_label *label;
0801 };
0802
0803 enum nfs4_acl_type {
0804 NFS4ACL_NONE = 0,
0805 NFS4ACL_ACL,
0806 NFS4ACL_DACL,
0807 NFS4ACL_SACL,
0808 };
0809
0810 struct nfs_setaclargs {
0811 struct nfs4_sequence_args seq_args;
0812 struct nfs_fh * fh;
0813 enum nfs4_acl_type acl_type;
0814 size_t acl_len;
0815 struct page ** acl_pages;
0816 };
0817
0818 struct nfs_setaclres {
0819 struct nfs4_sequence_res seq_res;
0820 };
0821
0822 struct nfs_getaclargs {
0823 struct nfs4_sequence_args seq_args;
0824 struct nfs_fh * fh;
0825 enum nfs4_acl_type acl_type;
0826 size_t acl_len;
0827 struct page ** acl_pages;
0828 };
0829
0830
0831 #define NFS4_ACL_TRUNC 0x0001
0832 struct nfs_getaclres {
0833 struct nfs4_sequence_res seq_res;
0834 enum nfs4_acl_type acl_type;
0835 size_t acl_len;
0836 size_t acl_data_offset;
0837 int acl_flags;
0838 struct page * acl_scratch;
0839 };
0840
0841 struct nfs_setattrres {
0842 struct nfs4_sequence_res seq_res;
0843 struct nfs_fattr * fattr;
0844 const struct nfs_server * server;
0845 };
0846
0847 struct nfs_linkargs {
0848 struct nfs_fh * fromfh;
0849 struct nfs_fh * tofh;
0850 const char * toname;
0851 unsigned int tolen;
0852 };
0853
0854 struct nfs_symlinkargs {
0855 struct nfs_fh * fromfh;
0856 const char * fromname;
0857 unsigned int fromlen;
0858 struct page ** pages;
0859 unsigned int pathlen;
0860 struct iattr * sattr;
0861 };
0862
0863 struct nfs_readdirargs {
0864 struct nfs_fh * fh;
0865 __u32 cookie;
0866 unsigned int count;
0867 struct page ** pages;
0868 };
0869
0870 struct nfs3_getaclargs {
0871 struct nfs_fh * fh;
0872 int mask;
0873 struct page ** pages;
0874 };
0875
0876 struct nfs3_setaclargs {
0877 struct inode * inode;
0878 int mask;
0879 struct posix_acl * acl_access;
0880 struct posix_acl * acl_default;
0881 size_t len;
0882 unsigned int npages;
0883 struct page ** pages;
0884 };
0885
0886 struct nfs_diropok {
0887 struct nfs_fh * fh;
0888 struct nfs_fattr * fattr;
0889 };
0890
0891 struct nfs_readlinkargs {
0892 struct nfs_fh * fh;
0893 unsigned int pgbase;
0894 unsigned int pglen;
0895 struct page ** pages;
0896 };
0897
0898 struct nfs3_sattrargs {
0899 struct nfs_fh * fh;
0900 struct iattr * sattr;
0901 unsigned int guard;
0902 struct timespec64 guardtime;
0903 };
0904
0905 struct nfs3_diropargs {
0906 struct nfs_fh * fh;
0907 const char * name;
0908 unsigned int len;
0909 };
0910
0911 struct nfs3_accessargs {
0912 struct nfs_fh * fh;
0913 __u32 access;
0914 };
0915
0916 struct nfs3_createargs {
0917 struct nfs_fh * fh;
0918 const char * name;
0919 unsigned int len;
0920 struct iattr * sattr;
0921 enum nfs3_createmode createmode;
0922 __be32 verifier[2];
0923 };
0924
0925 struct nfs3_mkdirargs {
0926 struct nfs_fh * fh;
0927 const char * name;
0928 unsigned int len;
0929 struct iattr * sattr;
0930 };
0931
0932 struct nfs3_symlinkargs {
0933 struct nfs_fh * fromfh;
0934 const char * fromname;
0935 unsigned int fromlen;
0936 struct page ** pages;
0937 unsigned int pathlen;
0938 struct iattr * sattr;
0939 };
0940
0941 struct nfs3_mknodargs {
0942 struct nfs_fh * fh;
0943 const char * name;
0944 unsigned int len;
0945 enum nfs3_ftype type;
0946 struct iattr * sattr;
0947 dev_t rdev;
0948 };
0949
0950 struct nfs3_linkargs {
0951 struct nfs_fh * fromfh;
0952 struct nfs_fh * tofh;
0953 const char * toname;
0954 unsigned int tolen;
0955 };
0956
0957 struct nfs3_readdirargs {
0958 struct nfs_fh * fh;
0959 __u64 cookie;
0960 __be32 verf[2];
0961 bool plus;
0962 unsigned int count;
0963 struct page ** pages;
0964 };
0965
0966 struct nfs3_diropres {
0967 struct nfs_fattr * dir_attr;
0968 struct nfs_fh * fh;
0969 struct nfs_fattr * fattr;
0970 };
0971
0972 struct nfs3_accessres {
0973 struct nfs_fattr * fattr;
0974 __u32 access;
0975 };
0976
0977 struct nfs3_readlinkargs {
0978 struct nfs_fh * fh;
0979 unsigned int pgbase;
0980 unsigned int pglen;
0981 struct page ** pages;
0982 };
0983
0984 struct nfs3_linkres {
0985 struct nfs_fattr * dir_attr;
0986 struct nfs_fattr * fattr;
0987 };
0988
0989 struct nfs3_readdirres {
0990 struct nfs_fattr * dir_attr;
0991 __be32 * verf;
0992 bool plus;
0993 };
0994
0995 struct nfs3_getaclres {
0996 struct nfs_fattr * fattr;
0997 int mask;
0998 unsigned int acl_access_count;
0999 unsigned int acl_default_count;
1000 struct posix_acl * acl_access;
1001 struct posix_acl * acl_default;
1002 };
1003
1004 #if IS_ENABLED(CONFIG_NFS_V4)
1005
1006 typedef u64 clientid4;
1007
1008 struct nfs4_accessargs {
1009 struct nfs4_sequence_args seq_args;
1010 const struct nfs_fh * fh;
1011 const u32 * bitmask;
1012 u32 access;
1013 };
1014
1015 struct nfs4_accessres {
1016 struct nfs4_sequence_res seq_res;
1017 const struct nfs_server * server;
1018 struct nfs_fattr * fattr;
1019 u32 supported;
1020 u32 access;
1021 };
1022
1023 struct nfs4_create_arg {
1024 struct nfs4_sequence_args seq_args;
1025 u32 ftype;
1026 union {
1027 struct {
1028 struct page ** pages;
1029 unsigned int len;
1030 } symlink;
1031 struct {
1032 u32 specdata1;
1033 u32 specdata2;
1034 } device;
1035 } u;
1036 const struct qstr * name;
1037 const struct nfs_server * server;
1038 const struct iattr * attrs;
1039 const struct nfs_fh * dir_fh;
1040 const u32 * bitmask;
1041 const struct nfs4_label *label;
1042 umode_t umask;
1043 };
1044
1045 struct nfs4_create_res {
1046 struct nfs4_sequence_res seq_res;
1047 const struct nfs_server * server;
1048 struct nfs_fh * fh;
1049 struct nfs_fattr * fattr;
1050 struct nfs4_change_info dir_cinfo;
1051 };
1052
1053 struct nfs4_fsinfo_arg {
1054 struct nfs4_sequence_args seq_args;
1055 const struct nfs_fh * fh;
1056 const u32 * bitmask;
1057 };
1058
1059 struct nfs4_fsinfo_res {
1060 struct nfs4_sequence_res seq_res;
1061 struct nfs_fsinfo *fsinfo;
1062 };
1063
1064 struct nfs4_getattr_arg {
1065 struct nfs4_sequence_args seq_args;
1066 const struct nfs_fh * fh;
1067 const u32 * bitmask;
1068 };
1069
1070 struct nfs4_getattr_res {
1071 struct nfs4_sequence_res seq_res;
1072 const struct nfs_server * server;
1073 struct nfs_fattr * fattr;
1074 };
1075
1076 struct nfs4_link_arg {
1077 struct nfs4_sequence_args seq_args;
1078 const struct nfs_fh * fh;
1079 const struct nfs_fh * dir_fh;
1080 const struct qstr * name;
1081 const u32 * bitmask;
1082 };
1083
1084 struct nfs4_link_res {
1085 struct nfs4_sequence_res seq_res;
1086 const struct nfs_server * server;
1087 struct nfs_fattr * fattr;
1088 struct nfs4_change_info cinfo;
1089 struct nfs_fattr * dir_attr;
1090 };
1091
1092 struct nfs4_lookup_arg {
1093 struct nfs4_sequence_args seq_args;
1094 const struct nfs_fh * dir_fh;
1095 const struct qstr * name;
1096 const u32 * bitmask;
1097 };
1098
1099 struct nfs4_lookup_res {
1100 struct nfs4_sequence_res seq_res;
1101 const struct nfs_server * server;
1102 struct nfs_fattr * fattr;
1103 struct nfs_fh * fh;
1104 };
1105
1106 struct nfs4_lookupp_arg {
1107 struct nfs4_sequence_args seq_args;
1108 const struct nfs_fh *fh;
1109 const u32 *bitmask;
1110 };
1111
1112 struct nfs4_lookupp_res {
1113 struct nfs4_sequence_res seq_res;
1114 const struct nfs_server *server;
1115 struct nfs_fattr *fattr;
1116 struct nfs_fh *fh;
1117 };
1118
1119 struct nfs4_lookup_root_arg {
1120 struct nfs4_sequence_args seq_args;
1121 const u32 * bitmask;
1122 };
1123
1124 struct nfs4_pathconf_arg {
1125 struct nfs4_sequence_args seq_args;
1126 const struct nfs_fh * fh;
1127 const u32 * bitmask;
1128 };
1129
1130 struct nfs4_pathconf_res {
1131 struct nfs4_sequence_res seq_res;
1132 struct nfs_pathconf *pathconf;
1133 };
1134
1135 struct nfs4_readdir_arg {
1136 struct nfs4_sequence_args seq_args;
1137 const struct nfs_fh * fh;
1138 u64 cookie;
1139 nfs4_verifier verifier;
1140 u32 count;
1141 struct page ** pages;
1142 unsigned int pgbase;
1143 const u32 * bitmask;
1144 bool plus;
1145 };
1146
1147 struct nfs4_readdir_res {
1148 struct nfs4_sequence_res seq_res;
1149 nfs4_verifier verifier;
1150 unsigned int pgbase;
1151 };
1152
1153 struct nfs4_readlink {
1154 struct nfs4_sequence_args seq_args;
1155 const struct nfs_fh * fh;
1156 unsigned int pgbase;
1157 unsigned int pglen;
1158 struct page ** pages;
1159 };
1160
1161 struct nfs4_readlink_res {
1162 struct nfs4_sequence_res seq_res;
1163 };
1164
1165 struct nfs4_setclientid {
1166 const nfs4_verifier * sc_verifier;
1167 u32 sc_prog;
1168 unsigned int sc_netid_len;
1169 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
1170 unsigned int sc_uaddr_len;
1171 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
1172 struct nfs_client *sc_clnt;
1173 struct rpc_cred *sc_cred;
1174 };
1175
1176 struct nfs4_setclientid_res {
1177 u64 clientid;
1178 nfs4_verifier confirm;
1179 };
1180
1181 struct nfs4_statfs_arg {
1182 struct nfs4_sequence_args seq_args;
1183 const struct nfs_fh * fh;
1184 const u32 * bitmask;
1185 };
1186
1187 struct nfs4_statfs_res {
1188 struct nfs4_sequence_res seq_res;
1189 struct nfs_fsstat *fsstat;
1190 };
1191
1192 struct nfs4_server_caps_arg {
1193 struct nfs4_sequence_args seq_args;
1194 struct nfs_fh *fhandle;
1195 const u32 * bitmask;
1196 };
1197
1198 struct nfs4_server_caps_res {
1199 struct nfs4_sequence_res seq_res;
1200 u32 attr_bitmask[3];
1201 u32 exclcreat_bitmask[3];
1202 u32 acl_bitmask;
1203 u32 has_links;
1204 u32 has_symlinks;
1205 u32 fh_expire_type;
1206 u32 case_insensitive;
1207 u32 case_preserving;
1208 };
1209
1210 #define NFS4_PATHNAME_MAXCOMPONENTS 512
1211 struct nfs4_pathname {
1212 unsigned int ncomponents;
1213 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
1214 };
1215
1216 #define NFS4_FS_LOCATION_MAXSERVERS 10
1217 struct nfs4_fs_location {
1218 unsigned int nservers;
1219 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
1220 struct nfs4_pathname rootpath;
1221 };
1222
1223 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
1224 struct nfs4_fs_locations {
1225 struct nfs_fattr *fattr;
1226 const struct nfs_server *server;
1227 struct nfs4_pathname fs_path;
1228 int nlocations;
1229 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
1230 };
1231
1232 struct nfs4_fs_locations_arg {
1233 struct nfs4_sequence_args seq_args;
1234 const struct nfs_fh *dir_fh;
1235 const struct nfs_fh *fh;
1236 const struct qstr *name;
1237 struct page *page;
1238 const u32 *bitmask;
1239 clientid4 clientid;
1240 unsigned char migration:1, renew:1;
1241 };
1242
1243 struct nfs4_fs_locations_res {
1244 struct nfs4_sequence_res seq_res;
1245 struct nfs4_fs_locations *fs_locations;
1246 unsigned char migration:1, renew:1;
1247 };
1248
1249 struct nfs4_secinfo4 {
1250 u32 flavor;
1251 struct rpcsec_gss_info flavor_info;
1252 };
1253
1254 struct nfs4_secinfo_flavors {
1255 unsigned int num_flavors;
1256 struct nfs4_secinfo4 flavors[];
1257 };
1258
1259 struct nfs4_secinfo_arg {
1260 struct nfs4_sequence_args seq_args;
1261 const struct nfs_fh *dir_fh;
1262 const struct qstr *name;
1263 };
1264
1265 struct nfs4_secinfo_res {
1266 struct nfs4_sequence_res seq_res;
1267 struct nfs4_secinfo_flavors *flavors;
1268 };
1269
1270 struct nfs4_fsid_present_arg {
1271 struct nfs4_sequence_args seq_args;
1272 const struct nfs_fh *fh;
1273 clientid4 clientid;
1274 unsigned char renew:1;
1275 };
1276
1277 struct nfs4_fsid_present_res {
1278 struct nfs4_sequence_res seq_res;
1279 struct nfs_fh *fh;
1280 unsigned char renew:1;
1281 };
1282
1283 #endif
1284
1285 struct nfstime4 {
1286 u64 seconds;
1287 u32 nseconds;
1288 };
1289
1290 #ifdef CONFIG_NFS_V4_1
1291
1292 struct pnfs_commit_bucket {
1293 struct list_head written;
1294 struct list_head committing;
1295 struct pnfs_layout_segment *lseg;
1296 struct nfs_writeverf direct_verf;
1297 };
1298
1299 struct pnfs_commit_array {
1300 struct list_head cinfo_list;
1301 struct list_head lseg_list;
1302 struct pnfs_layout_segment *lseg;
1303 struct rcu_head rcu;
1304 refcount_t refcount;
1305 unsigned int nbuckets;
1306 struct pnfs_commit_bucket buckets[];
1307 };
1308
1309 struct pnfs_ds_commit_info {
1310 struct list_head commits;
1311 unsigned int nwritten;
1312 unsigned int ncommitting;
1313 const struct pnfs_commit_ops *ops;
1314 };
1315
1316 struct nfs41_state_protection {
1317 u32 how;
1318 struct nfs4_op_map enforce;
1319 struct nfs4_op_map allow;
1320 };
1321
1322 struct nfs41_exchange_id_args {
1323 struct nfs_client *client;
1324 nfs4_verifier verifier;
1325 u32 flags;
1326 struct nfs41_state_protection state_protect;
1327 };
1328
1329 struct nfs41_server_owner {
1330 uint64_t minor_id;
1331 uint32_t major_id_sz;
1332 char major_id[NFS4_OPAQUE_LIMIT];
1333 };
1334
1335 struct nfs41_server_scope {
1336 uint32_t server_scope_sz;
1337 char server_scope[NFS4_OPAQUE_LIMIT];
1338 };
1339
1340 struct nfs41_impl_id {
1341 char domain[NFS4_OPAQUE_LIMIT + 1];
1342 char name[NFS4_OPAQUE_LIMIT + 1];
1343 struct nfstime4 date;
1344 };
1345
1346 #define MAX_BIND_CONN_TO_SESSION_RETRIES 3
1347 struct nfs41_bind_conn_to_session_args {
1348 struct nfs_client *client;
1349 struct nfs4_sessionid sessionid;
1350 u32 dir;
1351 bool use_conn_in_rdma_mode;
1352 int retries;
1353 };
1354
1355 struct nfs41_bind_conn_to_session_res {
1356 struct nfs4_sessionid sessionid;
1357 u32 dir;
1358 bool use_conn_in_rdma_mode;
1359 };
1360
1361 struct nfs41_exchange_id_res {
1362 u64 clientid;
1363 u32 seqid;
1364 u32 flags;
1365 struct nfs41_server_owner *server_owner;
1366 struct nfs41_server_scope *server_scope;
1367 struct nfs41_impl_id *impl_id;
1368 struct nfs41_state_protection state_protect;
1369 };
1370
1371 struct nfs41_create_session_args {
1372 struct nfs_client *client;
1373 u64 clientid;
1374 uint32_t seqid;
1375 uint32_t flags;
1376 uint32_t cb_program;
1377 struct nfs4_channel_attrs fc_attrs;
1378 struct nfs4_channel_attrs bc_attrs;
1379 };
1380
1381 struct nfs41_create_session_res {
1382 struct nfs4_sessionid sessionid;
1383 uint32_t seqid;
1384 uint32_t flags;
1385 struct nfs4_channel_attrs fc_attrs;
1386 struct nfs4_channel_attrs bc_attrs;
1387 };
1388
1389 struct nfs41_reclaim_complete_args {
1390 struct nfs4_sequence_args seq_args;
1391
1392 unsigned char one_fs:1;
1393 };
1394
1395 struct nfs41_reclaim_complete_res {
1396 struct nfs4_sequence_res seq_res;
1397 };
1398
1399 #define SECINFO_STYLE_CURRENT_FH 0
1400 #define SECINFO_STYLE_PARENT 1
1401 struct nfs41_secinfo_no_name_args {
1402 struct nfs4_sequence_args seq_args;
1403 int style;
1404 };
1405
1406 struct nfs41_test_stateid_args {
1407 struct nfs4_sequence_args seq_args;
1408 nfs4_stateid *stateid;
1409 };
1410
1411 struct nfs41_test_stateid_res {
1412 struct nfs4_sequence_res seq_res;
1413 unsigned int status;
1414 };
1415
1416 struct nfs41_free_stateid_args {
1417 struct nfs4_sequence_args seq_args;
1418 nfs4_stateid stateid;
1419 };
1420
1421 struct nfs41_free_stateid_res {
1422 struct nfs4_sequence_res seq_res;
1423 unsigned int status;
1424 };
1425
1426 #else
1427
1428 struct pnfs_ds_commit_info {
1429 };
1430
1431 #endif
1432
1433 #ifdef CONFIG_NFS_V4_2
1434 struct nfs42_falloc_args {
1435 struct nfs4_sequence_args seq_args;
1436
1437 struct nfs_fh *falloc_fh;
1438 nfs4_stateid falloc_stateid;
1439 u64 falloc_offset;
1440 u64 falloc_length;
1441 const u32 *falloc_bitmask;
1442 };
1443
1444 struct nfs42_falloc_res {
1445 struct nfs4_sequence_res seq_res;
1446 unsigned int status;
1447
1448 struct nfs_fattr *falloc_fattr;
1449 const struct nfs_server *falloc_server;
1450 };
1451
1452 struct nfs42_copy_args {
1453 struct nfs4_sequence_args seq_args;
1454
1455 struct nfs_fh *src_fh;
1456 nfs4_stateid src_stateid;
1457 u64 src_pos;
1458
1459 struct nfs_fh *dst_fh;
1460 nfs4_stateid dst_stateid;
1461 u64 dst_pos;
1462
1463 u64 count;
1464 bool sync;
1465 struct nl4_server *cp_src;
1466 };
1467
1468 struct nfs42_write_res {
1469 nfs4_stateid stateid;
1470 u64 count;
1471 struct nfs_writeverf verifier;
1472 };
1473
1474 struct nfs42_copy_res {
1475 struct nfs4_sequence_res seq_res;
1476 struct nfs42_write_res write_res;
1477 bool consecutive;
1478 bool synchronous;
1479 struct nfs_commitres commit_res;
1480 };
1481
1482 struct nfs42_offload_status_args {
1483 struct nfs4_sequence_args osa_seq_args;
1484 struct nfs_fh *osa_src_fh;
1485 nfs4_stateid osa_stateid;
1486 };
1487
1488 struct nfs42_offload_status_res {
1489 struct nfs4_sequence_res osr_seq_res;
1490 uint64_t osr_count;
1491 int osr_status;
1492 };
1493
1494 struct nfs42_copy_notify_args {
1495 struct nfs4_sequence_args cna_seq_args;
1496
1497 struct nfs_fh *cna_src_fh;
1498 nfs4_stateid cna_src_stateid;
1499 struct nl4_server cna_dst;
1500 };
1501
1502 struct nfs42_copy_notify_res {
1503 struct nfs4_sequence_res cnr_seq_res;
1504
1505 struct nfstime4 cnr_lease_time;
1506 nfs4_stateid cnr_stateid;
1507 struct nl4_server cnr_src;
1508 };
1509
1510 struct nfs42_seek_args {
1511 struct nfs4_sequence_args seq_args;
1512
1513 struct nfs_fh *sa_fh;
1514 nfs4_stateid sa_stateid;
1515 u64 sa_offset;
1516 u32 sa_what;
1517 };
1518
1519 struct nfs42_seek_res {
1520 struct nfs4_sequence_res seq_res;
1521 unsigned int status;
1522
1523 u32 sr_eof;
1524 u64 sr_offset;
1525 };
1526
1527 struct nfs42_setxattrargs {
1528 struct nfs4_sequence_args seq_args;
1529 struct nfs_fh *fh;
1530 const char *xattr_name;
1531 u32 xattr_flags;
1532 size_t xattr_len;
1533 struct page **xattr_pages;
1534 };
1535
1536 struct nfs42_setxattrres {
1537 struct nfs4_sequence_res seq_res;
1538 struct nfs4_change_info cinfo;
1539 };
1540
1541 struct nfs42_getxattrargs {
1542 struct nfs4_sequence_args seq_args;
1543 struct nfs_fh *fh;
1544 const char *xattr_name;
1545 size_t xattr_len;
1546 struct page **xattr_pages;
1547 };
1548
1549 struct nfs42_getxattrres {
1550 struct nfs4_sequence_res seq_res;
1551 size_t xattr_len;
1552 };
1553
1554 struct nfs42_listxattrsargs {
1555 struct nfs4_sequence_args seq_args;
1556 struct nfs_fh *fh;
1557 u32 count;
1558 u64 cookie;
1559 struct page **xattr_pages;
1560 };
1561
1562 struct nfs42_listxattrsres {
1563 struct nfs4_sequence_res seq_res;
1564 struct page *scratch;
1565 void *xattr_buf;
1566 size_t xattr_len;
1567 u64 cookie;
1568 bool eof;
1569 size_t copied;
1570 };
1571
1572 struct nfs42_removexattrargs {
1573 struct nfs4_sequence_args seq_args;
1574 struct nfs_fh *fh;
1575 const char *xattr_name;
1576 };
1577
1578 struct nfs42_removexattrres {
1579 struct nfs4_sequence_res seq_res;
1580 struct nfs4_change_info cinfo;
1581 };
1582
1583 #endif
1584
1585 struct nfs_page;
1586
1587 #define NFS_PAGEVEC_SIZE (8U)
1588
1589 struct nfs_page_array {
1590 struct page **pagevec;
1591 unsigned int npages;
1592 struct page *page_array[NFS_PAGEVEC_SIZE];
1593 };
1594
1595
1596 enum {
1597 NFS_IOHDR_ERROR = 0,
1598 NFS_IOHDR_EOF,
1599 NFS_IOHDR_REDO,
1600 NFS_IOHDR_STAT,
1601 NFS_IOHDR_RESEND_PNFS,
1602 NFS_IOHDR_RESEND_MDS,
1603 NFS_IOHDR_UNSTABLE_WRITES,
1604 };
1605
1606 struct nfs_io_completion;
1607 struct nfs_pgio_header {
1608 struct inode *inode;
1609 const struct cred *cred;
1610 struct list_head pages;
1611 struct nfs_page *req;
1612 struct nfs_writeverf verf;
1613 fmode_t rw_mode;
1614 struct pnfs_layout_segment *lseg;
1615 loff_t io_start;
1616 const struct rpc_call_ops *mds_ops;
1617 void (*release) (struct nfs_pgio_header *hdr);
1618 const struct nfs_pgio_completion_ops *completion_ops;
1619 const struct nfs_rw_ops *rw_ops;
1620 struct nfs_io_completion *io_completion;
1621 struct nfs_direct_req *dreq;
1622
1623 int pnfs_error;
1624 int error;
1625 unsigned int good_bytes;
1626 unsigned long flags;
1627
1628
1629
1630
1631 struct rpc_task task;
1632 struct nfs_fattr fattr;
1633 struct nfs_pgio_args args;
1634 struct nfs_pgio_res res;
1635 unsigned long timestamp;
1636 int (*pgio_done_cb)(struct rpc_task *, struct nfs_pgio_header *);
1637 __u64 mds_offset;
1638 struct nfs_page_array page_array;
1639 struct nfs_client *ds_clp;
1640 u32 ds_commit_idx;
1641 u32 pgio_mirror_idx;
1642 };
1643
1644 struct nfs_mds_commit_info {
1645 atomic_t rpcs_out;
1646 atomic_long_t ncommit;
1647 struct list_head list;
1648 };
1649
1650 struct nfs_commit_info;
1651 struct nfs_commit_data;
1652 struct nfs_inode;
1653 struct nfs_commit_completion_ops {
1654 void (*completion) (struct nfs_commit_data *data);
1655 void (*resched_write) (struct nfs_commit_info *, struct nfs_page *);
1656 };
1657
1658 struct nfs_commit_info {
1659 struct inode *inode;
1660 struct nfs_mds_commit_info *mds;
1661 struct pnfs_ds_commit_info *ds;
1662 struct nfs_direct_req *dreq;
1663 const struct nfs_commit_completion_ops *completion_ops;
1664 };
1665
1666 struct nfs_commit_data {
1667 struct rpc_task task;
1668 struct inode *inode;
1669 const struct cred *cred;
1670 struct nfs_fattr fattr;
1671 struct nfs_writeverf verf;
1672 struct list_head pages;
1673 struct list_head list;
1674 struct nfs_direct_req *dreq;
1675 struct nfs_commitargs args;
1676 struct nfs_commitres res;
1677 struct nfs_open_context *context;
1678 struct pnfs_layout_segment *lseg;
1679 struct nfs_client *ds_clp;
1680 int ds_commit_index;
1681 loff_t lwb;
1682 const struct rpc_call_ops *mds_ops;
1683 const struct nfs_commit_completion_ops *completion_ops;
1684 int (*commit_done_cb) (struct rpc_task *task, struct nfs_commit_data *data);
1685 unsigned long flags;
1686 };
1687
1688 struct nfs_pgio_completion_ops {
1689 void (*error_cleanup)(struct list_head *head, int);
1690 void (*init_hdr)(struct nfs_pgio_header *hdr);
1691 void (*completion)(struct nfs_pgio_header *hdr);
1692 void (*reschedule_io)(struct nfs_pgio_header *hdr);
1693 };
1694
1695 struct nfs_unlinkdata {
1696 struct nfs_removeargs args;
1697 struct nfs_removeres res;
1698 struct dentry *dentry;
1699 wait_queue_head_t wq;
1700 const struct cred *cred;
1701 struct nfs_fattr dir_attr;
1702 long timeout;
1703 };
1704
1705 struct nfs_renamedata {
1706 struct nfs_renameargs args;
1707 struct nfs_renameres res;
1708 struct rpc_task task;
1709 const struct cred *cred;
1710 struct inode *old_dir;
1711 struct dentry *old_dentry;
1712 struct nfs_fattr old_fattr;
1713 struct inode *new_dir;
1714 struct dentry *new_dentry;
1715 struct nfs_fattr new_fattr;
1716 void (*complete)(struct rpc_task *, struct nfs_renamedata *);
1717 long timeout;
1718 bool cancelled;
1719 };
1720
1721 struct nfs_access_entry;
1722 struct nfs_client;
1723 struct rpc_timeout;
1724 struct nfs_subversion;
1725 struct nfs_mount_info;
1726 struct nfs_client_initdata;
1727 struct nfs_pageio_descriptor;
1728 struct fs_context;
1729
1730
1731
1732
1733 struct nfs_rpc_ops {
1734 u32 version;
1735 const struct dentry_operations *dentry_ops;
1736 const struct inode_operations *dir_inode_ops;
1737 const struct inode_operations *file_inode_ops;
1738 const struct file_operations *file_ops;
1739 const struct nlmclnt_operations *nlmclnt_ops;
1740
1741 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1742 struct nfs_fsinfo *);
1743 int (*submount) (struct fs_context *, struct nfs_server *);
1744 int (*try_get_tree) (struct fs_context *);
1745 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1746 struct nfs_fattr *, struct inode *);
1747 int (*setattr) (struct dentry *, struct nfs_fattr *,
1748 struct iattr *);
1749 int (*lookup) (struct inode *, struct dentry *,
1750 struct nfs_fh *, struct nfs_fattr *);
1751 int (*lookupp) (struct inode *, struct nfs_fh *,
1752 struct nfs_fattr *);
1753 int (*access) (struct inode *, struct nfs_access_entry *, const struct cred *);
1754 int (*readlink)(struct inode *, struct page *, unsigned int,
1755 unsigned int);
1756 int (*create) (struct inode *, struct dentry *,
1757 struct iattr *, int);
1758 int (*remove) (struct inode *, struct dentry *);
1759 void (*unlink_setup) (struct rpc_message *, struct dentry *, struct inode *);
1760 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
1761 int (*unlink_done) (struct rpc_task *, struct inode *);
1762 void (*rename_setup) (struct rpc_message *msg,
1763 struct dentry *old_dentry,
1764 struct dentry *new_dentry);
1765 void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
1766 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1767 int (*link) (struct inode *, struct inode *, const struct qstr *);
1768 int (*symlink) (struct inode *, struct dentry *, struct page *,
1769 unsigned int, struct iattr *);
1770 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1771 int (*rmdir) (struct inode *, const struct qstr *);
1772 int (*readdir) (struct nfs_readdir_arg *, struct nfs_readdir_res *);
1773 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1774 dev_t);
1775 int (*statfs) (struct nfs_server *, struct nfs_fh *,
1776 struct nfs_fsstat *);
1777 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
1778 struct nfs_fsinfo *);
1779 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1780 struct nfs_pathconf *);
1781 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1782 int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, bool);
1783 int (*pgio_rpc_prepare)(struct rpc_task *,
1784 struct nfs_pgio_header *);
1785 void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *);
1786 int (*read_done)(struct rpc_task *, struct nfs_pgio_header *);
1787 void (*write_setup)(struct nfs_pgio_header *, struct rpc_message *,
1788 struct rpc_clnt **);
1789 int (*write_done)(struct rpc_task *, struct nfs_pgio_header *);
1790 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *,
1791 struct rpc_clnt **);
1792 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
1793 int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
1794 int (*lock)(struct file *, int, struct file_lock *);
1795 int (*lock_check_bounds)(const struct file_lock *);
1796 void (*clear_acl_cache)(struct inode *);
1797 void (*close_context)(struct nfs_open_context *ctx, int);
1798 struct inode * (*open_context) (struct inode *dir,
1799 struct nfs_open_context *ctx,
1800 int open_flags,
1801 struct iattr *iattr,
1802 int *);
1803 int (*have_delegation)(struct inode *, fmode_t);
1804 struct nfs_client *(*alloc_client) (const struct nfs_client_initdata *);
1805 struct nfs_client *(*init_client) (struct nfs_client *,
1806 const struct nfs_client_initdata *);
1807 void (*free_client) (struct nfs_client *);
1808 struct nfs_server *(*create_server)(struct fs_context *);
1809 struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
1810 struct nfs_fattr *, rpc_authflavor_t);
1811 int (*discover_trunking)(struct nfs_server *, struct nfs_fh *);
1812 void (*enable_swap)(struct inode *inode);
1813 void (*disable_swap)(struct inode *inode);
1814 };
1815
1816
1817
1818
1819
1820
1821 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
1822
1823
1824
1825
1826 extern const struct nfs_rpc_ops nfs_v2_clientops;
1827 extern const struct nfs_rpc_ops nfs_v3_clientops;
1828 extern const struct nfs_rpc_ops nfs_v4_clientops;
1829 extern const struct rpc_version nfs_version2;
1830 extern const struct rpc_version nfs_version3;
1831 extern const struct rpc_version nfs_version4;
1832
1833 extern const struct rpc_version nfsacl_version3;
1834 extern const struct rpc_program nfsacl_program;
1835
1836 #endif