hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/fs/nfsd/vfs.h
....@@ -34,14 +34,14 @@
3434 #define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE)
3535 #define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC)
3636
37
+struct nfsd_file;
38
+
3739 /*
3840 * Callback function for readdir
3941 */
4042 typedef int (*nfsd_filldir_t)(void *, const char *, int, loff_t, u64, unsigned);
4143
4244 /* nfsd/vfs.c */
43
-int nfsd_racache_init(int);
44
-void nfsd_racache_shutdown(void);
4545 int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
4646 struct svc_export **expp);
4747 __be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *,
....@@ -50,15 +50,16 @@
5050 const char *, unsigned int,
5151 struct svc_export **, struct dentry **);
5252 __be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *,
53
- struct iattr *, int, time_t);
53
+ struct iattr *, int, time64_t);
5454 int nfsd_mountpoint(struct dentry *, struct svc_export *);
5555 #ifdef CONFIG_NFSD_V4
5656 __be32 nfsd4_set_nfs4_label(struct svc_rqst *, struct svc_fh *,
5757 struct xdr_netobj *);
5858 __be32 nfsd4_vfs_fallocate(struct svc_rqst *, struct svc_fh *,
5959 struct file *, loff_t, loff_t, int);
60
-__be32 nfsd4_clone_file_range(struct file *, u64, struct file *,
61
- u64, u64);
60
+__be32 nfsd4_clone_file_range(struct nfsd_file *nf_src, u64 src_pos,
61
+ struct nfsd_file *nf_dst, u64 dst_pos,
62
+ u64 count, bool sync);
6263 #endif /* CONFIG_NFSD_V4 */
6364 __be32 nfsd_create_locked(struct svc_rqst *, struct svc_fh *,
6465 char *name, int len, struct iattr *attrs,
....@@ -73,26 +74,42 @@
7374 struct svc_fh *res, int createmode,
7475 u32 *verifier, bool *truncp, bool *created);
7576 __be32 nfsd_commit(struct svc_rqst *, struct svc_fh *,
76
- loff_t, unsigned long);
77
+ loff_t, unsigned long, __be32 *verf);
7778 #endif /* CONFIG_NFSD_V3 */
79
+#ifdef CONFIG_NFSD_V4
80
+__be32 nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
81
+ char *name, void **bufp, int *lenp);
82
+__be32 nfsd_listxattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
83
+ char **bufp, int *lenp);
84
+__be32 nfsd_removexattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
85
+ char *name);
86
+__be32 nfsd_setxattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
87
+ char *name, void *buf, u32 len, u32 flags);
88
+#endif
89
+int nfsd_open_break_lease(struct inode *, int);
7890 __be32 nfsd_open(struct svc_rqst *, struct svc_fh *, umode_t,
7991 int, struct file **);
80
-struct raparms;
92
+__be32 nfsd_open_verified(struct svc_rqst *, struct svc_fh *, umode_t,
93
+ int, struct file **);
8194 __be32 nfsd_splice_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
8295 struct file *file, loff_t offset,
83
- unsigned long *count);
96
+ unsigned long *count,
97
+ u32 *eof);
8498 __be32 nfsd_readv(struct svc_rqst *rqstp, struct svc_fh *fhp,
8599 struct file *file, loff_t offset,
86100 struct kvec *vec, int vlen,
87
- unsigned long *count);
101
+ unsigned long *count,
102
+ u32 *eof);
88103 __be32 nfsd_read(struct svc_rqst *, struct svc_fh *,
89
- loff_t, struct kvec *, int, unsigned long *);
104
+ loff_t, struct kvec *, int, unsigned long *,
105
+ u32 *eof);
90106 __be32 nfsd_write(struct svc_rqst *, struct svc_fh *, loff_t,
91
- struct kvec *, int, unsigned long *, int);
107
+ struct kvec *, int, unsigned long *,
108
+ int stable, __be32 *verf);
92109 __be32 nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp,
93
- struct file *file, loff_t offset,
110
+ struct nfsd_file *nf, loff_t offset,
94111 struct kvec *vec, int vlen, unsigned long *cnt,
95
- int stable);
112
+ int stable, __be32 *verf);
96113 __be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
97114 char *, int *);
98115 __be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
....@@ -114,9 +131,6 @@
114131
115132 __be32 nfsd_permission(struct svc_rqst *, struct svc_export *,
116133 struct dentry *, int);
117
-
118
-struct raparms *nfsd_init_raparms(struct file *file);
119
-void nfsd_put_raparams(struct file *file, struct raparms *ra);
120134
121135 static inline int fh_want_write(struct svc_fh *fh)
122136 {
....@@ -150,25 +164,6 @@
150164 {
151165 return createmode == NFS3_CREATE_EXCLUSIVE
152166 || createmode == NFS4_CREATE_EXCLUSIVE4_1;
153
-}
154
-
155
-static inline bool nfsd_eof_on_read(long requested, long read,
156
- loff_t offset, loff_t size)
157
-{
158
- /* We assume a short read means eof: */
159
- if (requested > read)
160
- return true;
161
- /*
162
- * A non-short read might also reach end of file. The spec
163
- * still requires us to set eof in that case.
164
- *
165
- * Further operations may have modified the file size since
166
- * the read, so the following check is not atomic with the read.
167
- * We've only seen that cause a problem for a client in the case
168
- * where the read returned a count of 0 without setting eof.
169
- * That case was fixed by the addition of the above check.
170
- */
171
- return (offset + read >= size);
172167 }
173168
174169 #endif /* LINUX_NFSD_VFS_H */