hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/nfs_xdr.h
....@@ -15,6 +15,8 @@
1515 #define NFS_DEF_FILE_IO_SIZE (4096U)
1616 #define NFS_MIN_FILE_IO_SIZE (1024U)
1717
18
+#define NFS_BITMASK_SZ 3
19
+
1820 struct nfs4_string {
1921 unsigned int len;
2022 char *data;
....@@ -62,19 +64,20 @@
6264 struct nfs_fsid fsid;
6365 __u64 fileid;
6466 __u64 mounted_on_fileid;
65
- struct timespec atime;
66
- struct timespec mtime;
67
- struct timespec ctime;
67
+ struct timespec64 atime;
68
+ struct timespec64 mtime;
69
+ struct timespec64 ctime;
6870 __u64 change_attr; /* NFSv4 change attribute */
6971 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
7072 __u64 pre_size; /* pre_op_attr.size */
71
- struct timespec pre_mtime; /* pre_op_attr.mtime */
72
- struct timespec pre_ctime; /* pre_op_attr.ctime */
73
+ struct timespec64 pre_mtime; /* pre_op_attr.mtime */
74
+ struct timespec64 pre_ctime; /* pre_op_attr.ctime */
7375 unsigned long time_start;
7476 unsigned long gencount;
7577 struct nfs4_string *owner_name;
7678 struct nfs4_string *group_name;
7779 struct nfs4_threshold *mdsthreshold; /* pNFS threshold hints */
80
+ struct nfs4_label *label;
7881 };
7982
8083 #define NFS_ATTR_FATTR_TYPE (1U << 0)
....@@ -143,12 +146,13 @@
143146 __u32 wtmult; /* writes should be multiple of this */
144147 __u32 dtpref; /* pref. readdir transfer size */
145148 __u64 maxfilesize;
146
- struct timespec time_delta; /* server time granularity */
149
+ struct timespec64 time_delta; /* server time granularity */
147150 __u32 lease_time; /* in seconds */
148151 __u32 nlayouttypes; /* number of layouttypes */
149152 __u32 layouttype[NFS_MAX_LAYOUT_TYPES]; /* supported pnfs layout driver */
150153 __u32 blksize; /* preferred pnfs io block size */
151154 __u32 clone_blksize; /* granularity of a CLONE operation */
155
+ __u32 xattr_support; /* User xattrs supported */
152156 };
153157
154158 struct nfs_fsstat {
....@@ -270,7 +274,7 @@
270274 struct nfs4_layoutget {
271275 struct nfs4_layoutget_args args;
272276 struct nfs4_layoutget_res res;
273
- struct rpc_cred *cred;
277
+ const struct cred *cred;
274278 gfp_t gfp_flags;
275279 };
276280
....@@ -309,7 +313,7 @@
309313 struct rpc_task task;
310314 struct nfs_fattr fattr;
311315 struct list_head lseg_list;
312
- struct rpc_cred *cred;
316
+ const struct cred *cred;
313317 struct inode *inode;
314318 struct nfs4_layoutcommit_args args;
315319 struct nfs4_layoutcommit_res res;
....@@ -334,7 +338,7 @@
334338 struct nfs4_layoutreturn {
335339 struct nfs4_layoutreturn_args args;
336340 struct nfs4_layoutreturn_res res;
337
- struct rpc_cred *cred;
341
+ const struct cred *cred;
338342 struct nfs_client *clp;
339343 struct inode *inode;
340344 int rpc_status;
....@@ -381,6 +385,41 @@
381385 struct inode *inode;
382386 struct nfs42_layoutstat_args args;
383387 struct nfs42_layoutstat_res res;
388
+};
389
+
390
+struct nfs42_device_error {
391
+ struct nfs4_deviceid dev_id;
392
+ int status;
393
+ enum nfs_opnum4 opnum;
394
+};
395
+
396
+struct nfs42_layout_error {
397
+ __u64 offset;
398
+ __u64 length;
399
+ nfs4_stateid stateid;
400
+ struct nfs42_device_error errors[1];
401
+};
402
+
403
+#define NFS42_LAYOUTERROR_MAX 5
404
+
405
+struct nfs42_layouterror_args {
406
+ struct nfs4_sequence_args seq_args;
407
+ struct inode *inode;
408
+ unsigned int num_errors;
409
+ struct nfs42_layout_error errors[NFS42_LAYOUTERROR_MAX];
410
+};
411
+
412
+struct nfs42_layouterror_res {
413
+ struct nfs4_sequence_res seq_res;
414
+ unsigned int num_errors;
415
+ int rpc_status;
416
+};
417
+
418
+struct nfs42_layouterror_data {
419
+ struct nfs42_layouterror_args args;
420
+ struct nfs42_layouterror_res res;
421
+ struct inode *inode;
422
+ struct pnfs_layout_segment *lseg;
384423 };
385424
386425 struct nfs42_clone_args {
....@@ -489,6 +528,7 @@
489528 fmode_t fmode;
490529 u32 share_access;
491530 const u32 * bitmask;
531
+ u32 bitmask_store[NFS_BITMASK_SZ];
492532 struct nfs4_layoutreturn_args *lr_args;
493533 };
494534
....@@ -571,7 +611,8 @@
571611 struct nfs4_sequence_args seq_args;
572612 const struct nfs_fh *fhandle;
573613 const nfs4_stateid *stateid;
574
- const u32 * bitmask;
614
+ const u32 *bitmask;
615
+ u32 bitmask_store[NFS_BITMASK_SZ];
575616 struct nfs4_layoutreturn_args *lr_args;
576617 };
577618
....@@ -608,19 +649,31 @@
608649 __u32 count;
609650 unsigned int pgbase;
610651 struct page ** pages;
611
- const u32 * bitmask; /* used by write */
612
- enum nfs3_stable_how stable; /* used by write */
652
+ union {
653
+ unsigned int replen; /* used by read */
654
+ struct {
655
+ const u32 * bitmask; /* used by write */
656
+ u32 bitmask_store[NFS_BITMASK_SZ]; /* used by write */
657
+ enum nfs3_stable_how stable; /* used by write */
658
+ };
659
+ };
613660 };
614661
615662 struct nfs_pgio_res {
616663 struct nfs4_sequence_res seq_res;
617664 struct nfs_fattr * fattr;
618
- __u32 count;
665
+ __u64 count;
619666 __u32 op_status;
620
- int eof; /* used by read */
621
- struct nfs_writeverf * verf; /* used by write */
622
- const struct nfs_server *server; /* used by write */
623
-
667
+ union {
668
+ struct {
669
+ unsigned int replen; /* used by read */
670
+ int eof; /* used by read */
671
+ };
672
+ struct {
673
+ struct nfs_writeverf * verf; /* used by write */
674
+ const struct nfs_server *server; /* used by write */
675
+ };
676
+ };
624677 };
625678
626679 /*
....@@ -823,7 +876,7 @@
823876 struct nfs_fh * fh;
824877 struct iattr * sattr;
825878 unsigned int guard;
826
- struct timespec guardtime;
879
+ struct timespec64 guardtime;
827880 };
828881
829882 struct nfs3_diropargs {
....@@ -1180,7 +1233,7 @@
11801233
11811234 struct nfs4_secinfo_flavors {
11821235 unsigned int num_flavors;
1183
- struct nfs4_secinfo4 flavors[0];
1236
+ struct nfs4_secinfo4 flavors[];
11841237 };
11851238
11861239 struct nfs4_secinfo_arg {
....@@ -1219,16 +1272,25 @@
12191272 struct pnfs_commit_bucket {
12201273 struct list_head written;
12211274 struct list_head committing;
1222
- struct pnfs_layout_segment *wlseg;
1223
- struct pnfs_layout_segment *clseg;
1275
+ struct pnfs_layout_segment *lseg;
12241276 struct nfs_writeverf direct_verf;
12251277 };
12261278
1279
+struct pnfs_commit_array {
1280
+ struct list_head cinfo_list;
1281
+ struct list_head lseg_list;
1282
+ struct pnfs_layout_segment *lseg;
1283
+ struct rcu_head rcu;
1284
+ refcount_t refcount;
1285
+ unsigned int nbuckets;
1286
+ struct pnfs_commit_bucket buckets[];
1287
+};
1288
+
12271289 struct pnfs_ds_commit_info {
1228
- int nwritten;
1229
- int ncommitting;
1230
- int nbuckets;
1231
- struct pnfs_commit_bucket *buckets;
1290
+ struct list_head commits;
1291
+ unsigned int nwritten;
1292
+ unsigned int ncommitting;
1293
+ const struct pnfs_commit_ops *ops;
12321294 };
12331295
12341296 struct nfs41_state_protection {
....@@ -1261,11 +1323,13 @@
12611323 struct nfstime4 date;
12621324 };
12631325
1326
+#define MAX_BIND_CONN_TO_SESSION_RETRIES 3
12641327 struct nfs41_bind_conn_to_session_args {
12651328 struct nfs_client *client;
12661329 struct nfs4_sessionid sessionid;
12671330 u32 dir;
12681331 bool use_conn_in_rdma_mode;
1332
+ int retries;
12691333 };
12701334
12711335 struct nfs41_bind_conn_to_session_res {
....@@ -1339,21 +1403,10 @@
13391403 unsigned int status;
13401404 };
13411405
1342
-static inline void
1343
-nfs_free_pnfs_ds_cinfo(struct pnfs_ds_commit_info *cinfo)
1344
-{
1345
- kfree(cinfo->buckets);
1346
-}
1347
-
13481406 #else
13491407
13501408 struct pnfs_ds_commit_info {
13511409 };
1352
-
1353
-static inline void
1354
-nfs_free_pnfs_ds_cinfo(struct pnfs_ds_commit_info *cinfo)
1355
-{
1356
-}
13571410
13581411 #endif /* CONFIG_NFS_V4_1 */
13591412
....@@ -1389,6 +1442,7 @@
13891442
13901443 u64 count;
13911444 bool sync;
1445
+ struct nl4_server *cp_src;
13921446 };
13931447
13941448 struct nfs42_write_res {
....@@ -1417,6 +1471,22 @@
14171471 int osr_status;
14181472 };
14191473
1474
+struct nfs42_copy_notify_args {
1475
+ struct nfs4_sequence_args cna_seq_args;
1476
+
1477
+ struct nfs_fh *cna_src_fh;
1478
+ nfs4_stateid cna_src_stateid;
1479
+ struct nl4_server cna_dst;
1480
+};
1481
+
1482
+struct nfs42_copy_notify_res {
1483
+ struct nfs4_sequence_res cnr_seq_res;
1484
+
1485
+ struct nfstime4 cnr_lease_time;
1486
+ nfs4_stateid cnr_stateid;
1487
+ struct nl4_server cnr_src;
1488
+};
1489
+
14201490 struct nfs42_seek_args {
14211491 struct nfs4_sequence_args seq_args;
14221492
....@@ -1433,7 +1503,64 @@
14331503 u32 sr_eof;
14341504 u64 sr_offset;
14351505 };
1436
-#endif
1506
+
1507
+struct nfs42_setxattrargs {
1508
+ struct nfs4_sequence_args seq_args;
1509
+ struct nfs_fh *fh;
1510
+ const char *xattr_name;
1511
+ u32 xattr_flags;
1512
+ size_t xattr_len;
1513
+ struct page **xattr_pages;
1514
+};
1515
+
1516
+struct nfs42_setxattrres {
1517
+ struct nfs4_sequence_res seq_res;
1518
+ struct nfs4_change_info cinfo;
1519
+};
1520
+
1521
+struct nfs42_getxattrargs {
1522
+ struct nfs4_sequence_args seq_args;
1523
+ struct nfs_fh *fh;
1524
+ const char *xattr_name;
1525
+ size_t xattr_len;
1526
+ struct page **xattr_pages;
1527
+};
1528
+
1529
+struct nfs42_getxattrres {
1530
+ struct nfs4_sequence_res seq_res;
1531
+ size_t xattr_len;
1532
+};
1533
+
1534
+struct nfs42_listxattrsargs {
1535
+ struct nfs4_sequence_args seq_args;
1536
+ struct nfs_fh *fh;
1537
+ u32 count;
1538
+ u64 cookie;
1539
+ struct page **xattr_pages;
1540
+};
1541
+
1542
+struct nfs42_listxattrsres {
1543
+ struct nfs4_sequence_res seq_res;
1544
+ struct page *scratch;
1545
+ void *xattr_buf;
1546
+ size_t xattr_len;
1547
+ u64 cookie;
1548
+ bool eof;
1549
+ size_t copied;
1550
+};
1551
+
1552
+struct nfs42_removexattrargs {
1553
+ struct nfs4_sequence_args seq_args;
1554
+ struct nfs_fh *fh;
1555
+ const char *xattr_name;
1556
+};
1557
+
1558
+struct nfs42_removexattrres {
1559
+ struct nfs4_sequence_res seq_res;
1560
+ struct nfs4_change_info cinfo;
1561
+};
1562
+
1563
+#endif /* CONFIG_NFS_V4_2 */
14371564
14381565 struct nfs_page;
14391566
....@@ -1458,7 +1585,7 @@
14581585 struct nfs_io_completion;
14591586 struct nfs_pgio_header {
14601587 struct inode *inode;
1461
- struct rpc_cred *cred;
1588
+ const struct cred *cred;
14621589 struct list_head pages;
14631590 struct nfs_page *req;
14641591 struct nfs_writeverf verf; /* Used for writes */
....@@ -1471,11 +1598,10 @@
14711598 const struct nfs_rw_ops *rw_ops;
14721599 struct nfs_io_completion *io_completion;
14731600 struct nfs_direct_req *dreq;
1474
- spinlock_t lock;
1475
- /* fields protected by lock */
1601
+
14761602 int pnfs_error;
14771603 int error; /* merge with pnfs_error */
1478
- unsigned long good_bytes; /* boundary of good data */
1604
+ unsigned int good_bytes; /* boundary of good data */
14791605 unsigned long flags;
14801606
14811607 /*
....@@ -1490,8 +1616,8 @@
14901616 __u64 mds_offset; /* Filelayout dense stripe */
14911617 struct nfs_page_array page_array;
14921618 struct nfs_client *ds_clp; /* pNFS data server */
1493
- int ds_commit_idx; /* ds index if ds_clp is set */
1494
- int pgio_mirror_idx;/* mirror index in pgio layer */
1619
+ u32 ds_commit_idx; /* ds index if ds_clp is set */
1620
+ u32 pgio_mirror_idx;/* mirror index in pgio layer */
14951621 };
14961622
14971623 struct nfs_mds_commit_info {
....@@ -1519,7 +1645,7 @@
15191645 struct nfs_commit_data {
15201646 struct rpc_task task;
15211647 struct inode *inode;
1522
- struct rpc_cred *cred;
1648
+ const struct cred *cred;
15231649 struct nfs_fattr fattr;
15241650 struct nfs_writeverf verf;
15251651 struct list_head pages; /* Coalesced requests we wish to flush */
....@@ -1550,7 +1676,7 @@
15501676 struct nfs_removeres res;
15511677 struct dentry *dentry;
15521678 wait_queue_head_t wq;
1553
- struct rpc_cred *cred;
1679
+ const struct cred *cred;
15541680 struct nfs_fattr dir_attr;
15551681 long timeout;
15561682 };
....@@ -1558,7 +1684,7 @@
15581684 struct nfs_renamedata {
15591685 struct nfs_renameargs args;
15601686 struct nfs_renameres res;
1561
- struct rpc_cred *cred;
1687
+ const struct cred *cred;
15621688 struct inode *old_dir;
15631689 struct dentry *old_dentry;
15641690 struct nfs_fattr old_fattr;
....@@ -1577,6 +1703,7 @@
15771703 struct nfs_mount_info;
15781704 struct nfs_client_initdata;
15791705 struct nfs_pageio_descriptor;
1706
+struct fs_context;
15801707
15811708 /*
15821709 * RPC procedure vector for NFSv2/NFSv3 demuxing
....@@ -1591,16 +1718,14 @@
15911718
15921719 int (*getroot) (struct nfs_server *, struct nfs_fh *,
15931720 struct nfs_fsinfo *);
1594
- struct vfsmount *(*submount) (struct nfs_server *, struct dentry *,
1595
- struct nfs_fh *, struct nfs_fattr *);
1596
- struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *,
1597
- struct nfs_subversion *);
1721
+ int (*submount) (struct fs_context *, struct nfs_server *);
1722
+ int (*try_get_tree) (struct fs_context *);
15981723 int (*getattr) (struct nfs_server *, struct nfs_fh *,
15991724 struct nfs_fattr *, struct nfs4_label *,
16001725 struct inode *);
16011726 int (*setattr) (struct dentry *, struct nfs_fattr *,
16021727 struct iattr *);
1603
- int (*lookup) (struct inode *, const struct qstr *,
1728
+ int (*lookup) (struct inode *, struct dentry *,
16041729 struct nfs_fh *, struct nfs_fattr *,
16051730 struct nfs4_label *);
16061731 int (*lookupp) (struct inode *, struct nfs_fh *,
....@@ -1624,7 +1749,7 @@
16241749 unsigned int, struct iattr *);
16251750 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
16261751 int (*rmdir) (struct inode *, const struct qstr *);
1627
- int (*readdir) (struct dentry *, struct rpc_cred *,
1752
+ int (*readdir) (struct dentry *, const struct cred *,
16281753 u64, struct page **, unsigned int, bool);
16291754 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
16301755 dev_t);
....@@ -1661,7 +1786,7 @@
16611786 struct nfs_client *(*init_client) (struct nfs_client *,
16621787 const struct nfs_client_initdata *);
16631788 void (*free_client) (struct nfs_client *);
1664
- struct nfs_server *(*create_server)(struct nfs_mount_info *, struct nfs_subversion *);
1789
+ struct nfs_server *(*create_server)(struct fs_context *);
16651790 struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
16661791 struct nfs_fattr *, rpc_authflavor_t);
16671792 };