hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/nfsd/xdr4.h
....@@ -46,9 +46,9 @@
4646 #define CURRENT_STATE_ID_FLAG (1<<0)
4747 #define SAVED_STATE_ID_FLAG (1<<1)
4848
49
-#define SET_STATE_ID(c, f) ((c)->sid_flags |= (f))
50
-#define HAS_STATE_ID(c, f) ((c)->sid_flags & (f))
51
-#define CLEAR_STATE_ID(c, f) ((c)->sid_flags &= ~(f))
49
+#define SET_CSTATE_FLAG(c, f) ((c)->sid_flags |= (f))
50
+#define HAS_CSTATE_FLAG(c, f) ((c)->sid_flags & (f))
51
+#define CLEAR_CSTATE_FLAG(c, f) ((c)->sid_flags &= ~(f))
5252
5353 struct nfsd4_compound_state {
5454 struct svc_fh current_fh;
....@@ -221,6 +221,33 @@
221221 struct nfsd4_putfh {
222222 u32 pf_fhlen; /* request */
223223 char *pf_fhval; /* request */
224
+ bool no_verify; /* represents foreigh fh */
225
+};
226
+
227
+struct nfsd4_getxattr {
228
+ char *getxa_name; /* request */
229
+ u32 getxa_len; /* request */
230
+ void *getxa_buf;
231
+};
232
+
233
+struct nfsd4_setxattr {
234
+ u32 setxa_flags; /* request */
235
+ char *setxa_name; /* request */
236
+ char *setxa_buf; /* request */
237
+ u32 setxa_len; /* request */
238
+ struct nfsd4_change_info setxa_cinfo; /* response */
239
+};
240
+
241
+struct nfsd4_removexattr {
242
+ char *rmxa_name; /* request */
243
+ struct nfsd4_change_info rmxa_cinfo; /* response */
244
+};
245
+
246
+struct nfsd4_listxattrs {
247
+ u64 lsxa_cookie; /* request */
248
+ u32 lsxa_maxcount; /* request */
249
+ char *lsxa_buf; /* unfiltered buffer (reply) */
250
+ u32 lsxa_len; /* unfiltered len (reply) */
224251 };
225252
226253 struct nfsd4_open {
....@@ -273,15 +300,14 @@
273300
274301
275302 struct nfsd4_read {
276
- stateid_t rd_stateid; /* request */
277
- u64 rd_offset; /* request */
278
- u32 rd_length; /* request */
279
- int rd_vlen;
280
- struct file *rd_filp;
281
- bool rd_tmp_file;
303
+ stateid_t rd_stateid; /* request */
304
+ u64 rd_offset; /* request */
305
+ u32 rd_length; /* request */
306
+ int rd_vlen;
307
+ struct nfsd_file *rd_nf;
282308
283
- struct svc_rqst *rd_rqstp; /* response */
284
- struct svc_fh * rd_fhp; /* response */
309
+ struct svc_rqst *rd_rqstp; /* response */
310
+ struct svc_fh *rd_fhp; /* response */
285311 };
286312
287313 struct nfsd4_readdir {
....@@ -410,6 +436,9 @@
410436 int spa_how;
411437 u32 spo_must_enforce[3];
412438 u32 spo_must_allow[3];
439
+ struct xdr_netobj nii_domain;
440
+ struct xdr_netobj nii_name;
441
+ struct timespec64 nii_time;
413442 };
414443
415444 struct nfsd4_sequence {
....@@ -472,7 +501,7 @@
472501 u32 lc_reclaim; /* request */
473502 u32 lc_newoffset; /* request */
474503 u64 lc_last_wr; /* request */
475
- struct timespec lc_mtime; /* request */
504
+ struct timespec64 lc_mtime; /* request */
476505 u32 lc_layout_type; /* request */
477506 u32 lc_up_len; /* layout length */
478507 void *lc_up_layout; /* decoded by callback */
....@@ -511,22 +540,47 @@
511540 u64 wr_bytes_written;
512541 u32 wr_stable_how;
513542 nfs4_verifier wr_verifier;
543
+ stateid_t cb_stateid;
514544 };
515545
516546 struct nfsd4_copy {
517547 /* request */
518
- stateid_t cp_src_stateid;
519
- stateid_t cp_dst_stateid;
520
- u64 cp_src_pos;
521
- u64 cp_dst_pos;
522
- u64 cp_count;
548
+ stateid_t cp_src_stateid;
549
+ stateid_t cp_dst_stateid;
550
+ u64 cp_src_pos;
551
+ u64 cp_dst_pos;
552
+ u64 cp_count;
553
+ struct nl4_server cp_src;
554
+ bool cp_intra;
523555
524556 /* both */
525557 bool cp_synchronous;
526558
527559 /* response */
528560 struct nfsd42_write_res cp_res;
561
+
562
+ /* for cb_offload */
563
+ struct nfsd4_callback cp_cb;
564
+ __be32 nfserr;
565
+ struct knfsd_fh fh;
566
+
567
+ struct nfs4_client *cp_clp;
568
+
569
+ struct nfsd_file *nf_src;
570
+ struct nfsd_file *nf_dst;
571
+
572
+ copy_stateid_t cp_stateid;
573
+
574
+ struct list_head copies;
575
+ struct task_struct *copy_task;
576
+ refcount_t refcount;
577
+ bool stopped;
578
+
579
+ struct vfsmount *ss_mnt;
580
+ struct nfs_fh c_fh;
581
+ nfs4_stateid stateid;
529582 };
583
+extern bool inter_copy_offload_enable;
530584
531585 struct nfsd4_seek {
532586 /* request */
....@@ -537,6 +591,27 @@
537591 /* response */
538592 u32 seek_eof;
539593 loff_t seek_pos;
594
+};
595
+
596
+struct nfsd4_offload_status {
597
+ /* request */
598
+ stateid_t stateid;
599
+
600
+ /* response */
601
+ u64 count;
602
+ u32 status;
603
+};
604
+
605
+struct nfsd4_copy_notify {
606
+ /* request */
607
+ stateid_t cpn_src_stateid;
608
+ struct nl4_server cpn_dst;
609
+
610
+ /* response */
611
+ stateid_t cpn_cnr_stateid;
612
+ u64 cpn_sec;
613
+ u32 cpn_nsec;
614
+ struct nl4_server cpn_src;
540615 };
541616
542617 struct nfsd4_op {
....@@ -597,7 +672,14 @@
597672 struct nfsd4_fallocate deallocate;
598673 struct nfsd4_clone clone;
599674 struct nfsd4_copy copy;
675
+ struct nfsd4_offload_status offload_status;
676
+ struct nfsd4_copy_notify copy_notify;
600677 struct nfsd4_seek seek;
678
+
679
+ struct nfsd4_getxattr getxattr;
680
+ struct nfsd4_setxattr setxattr;
681
+ struct nfsd4_listxattrs listxattrs;
682
+ struct nfsd4_removexattr removexattr;
601683 } u;
602684 struct nfs4_replay * replay;
603685 };
....@@ -699,6 +781,7 @@
699781
700782
701783 bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp);
784
+int nfs4svc_decode_voidarg(struct svc_rqst *, __be32 *);
702785 int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *);
703786 int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *);
704787 int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *);