| .. | .. |
|---|
| 34 | 34 | #define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE) |
|---|
| 35 | 35 | #define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC) |
|---|
| 36 | 36 | |
|---|
| 37 | +struct nfsd_file; |
|---|
| 38 | + |
|---|
| 37 | 39 | /* |
|---|
| 38 | 40 | * Callback function for readdir |
|---|
| 39 | 41 | */ |
|---|
| 40 | 42 | typedef int (*nfsd_filldir_t)(void *, const char *, int, loff_t, u64, unsigned); |
|---|
| 41 | 43 | |
|---|
| 42 | 44 | /* nfsd/vfs.c */ |
|---|
| 43 | | -int nfsd_racache_init(int); |
|---|
| 44 | | -void nfsd_racache_shutdown(void); |
|---|
| 45 | 45 | int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, |
|---|
| 46 | 46 | struct svc_export **expp); |
|---|
| 47 | 47 | __be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, |
|---|
| .. | .. |
|---|
| 50 | 50 | const char *, unsigned int, |
|---|
| 51 | 51 | struct svc_export **, struct dentry **); |
|---|
| 52 | 52 | __be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, |
|---|
| 53 | | - struct iattr *, int, time_t); |
|---|
| 53 | + struct iattr *, int, time64_t); |
|---|
| 54 | 54 | int nfsd_mountpoint(struct dentry *, struct svc_export *); |
|---|
| 55 | 55 | #ifdef CONFIG_NFSD_V4 |
|---|
| 56 | 56 | __be32 nfsd4_set_nfs4_label(struct svc_rqst *, struct svc_fh *, |
|---|
| 57 | 57 | struct xdr_netobj *); |
|---|
| 58 | 58 | __be32 nfsd4_vfs_fallocate(struct svc_rqst *, struct svc_fh *, |
|---|
| 59 | 59 | 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); |
|---|
| 62 | 63 | #endif /* CONFIG_NFSD_V4 */ |
|---|
| 63 | 64 | __be32 nfsd_create_locked(struct svc_rqst *, struct svc_fh *, |
|---|
| 64 | 65 | char *name, int len, struct iattr *attrs, |
|---|
| .. | .. |
|---|
| 73 | 74 | struct svc_fh *res, int createmode, |
|---|
| 74 | 75 | u32 *verifier, bool *truncp, bool *created); |
|---|
| 75 | 76 | __be32 nfsd_commit(struct svc_rqst *, struct svc_fh *, |
|---|
| 76 | | - loff_t, unsigned long); |
|---|
| 77 | + loff_t, unsigned long, __be32 *verf); |
|---|
| 77 | 78 | #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); |
|---|
| 78 | 90 | __be32 nfsd_open(struct svc_rqst *, struct svc_fh *, umode_t, |
|---|
| 79 | 91 | int, struct file **); |
|---|
| 80 | | -struct raparms; |
|---|
| 92 | +__be32 nfsd_open_verified(struct svc_rqst *, struct svc_fh *, umode_t, |
|---|
| 93 | + int, struct file **); |
|---|
| 81 | 94 | __be32 nfsd_splice_read(struct svc_rqst *rqstp, struct svc_fh *fhp, |
|---|
| 82 | 95 | struct file *file, loff_t offset, |
|---|
| 83 | | - unsigned long *count); |
|---|
| 96 | + unsigned long *count, |
|---|
| 97 | + u32 *eof); |
|---|
| 84 | 98 | __be32 nfsd_readv(struct svc_rqst *rqstp, struct svc_fh *fhp, |
|---|
| 85 | 99 | struct file *file, loff_t offset, |
|---|
| 86 | 100 | struct kvec *vec, int vlen, |
|---|
| 87 | | - unsigned long *count); |
|---|
| 101 | + unsigned long *count, |
|---|
| 102 | + u32 *eof); |
|---|
| 88 | 103 | __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); |
|---|
| 90 | 106 | __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); |
|---|
| 92 | 109 | __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, |
|---|
| 94 | 111 | struct kvec *vec, int vlen, unsigned long *cnt, |
|---|
| 95 | | - int stable); |
|---|
| 112 | + int stable, __be32 *verf); |
|---|
| 96 | 113 | __be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *, |
|---|
| 97 | 114 | char *, int *); |
|---|
| 98 | 115 | __be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *, |
|---|
| .. | .. |
|---|
| 114 | 131 | |
|---|
| 115 | 132 | __be32 nfsd_permission(struct svc_rqst *, struct svc_export *, |
|---|
| 116 | 133 | struct dentry *, int); |
|---|
| 117 | | - |
|---|
| 118 | | -struct raparms *nfsd_init_raparms(struct file *file); |
|---|
| 119 | | -void nfsd_put_raparams(struct file *file, struct raparms *ra); |
|---|
| 120 | 134 | |
|---|
| 121 | 135 | static inline int fh_want_write(struct svc_fh *fh) |
|---|
| 122 | 136 | { |
|---|
| .. | .. |
|---|
| 150 | 164 | { |
|---|
| 151 | 165 | return createmode == NFS3_CREATE_EXCLUSIVE |
|---|
| 152 | 166 | || 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); |
|---|
| 172 | 167 | } |
|---|
| 173 | 168 | |
|---|
| 174 | 169 | #endif /* LINUX_NFSD_VFS_H */ |
|---|