Commit b66ae6dd authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields

nfsd: Pass the nfsd_file as arguments to nfsd4_clone_file_range()

Needed in order to fix exclusion w.r.t. writes.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 7bf94c6b
...@@ -1085,8 +1085,8 @@ nfsd4_clone(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -1085,8 +1085,8 @@ nfsd4_clone(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
if (status) if (status)
goto out; goto out;
status = nfsd4_clone_file_range(src->nf_file, clone->cl_src_pos, status = nfsd4_clone_file_range(src, clone->cl_src_pos,
dst->nf_file, clone->cl_dst_pos, clone->cl_count, dst, clone->cl_dst_pos, clone->cl_count,
EX_ISSYNC(cstate->current_fh.fh_export)); EX_ISSYNC(cstate->current_fh.fh_export));
nfsd_file_put(dst); nfsd_file_put(dst);
......
...@@ -530,9 +530,11 @@ __be32 nfsd4_set_nfs4_label(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -530,9 +530,11 @@ __be32 nfsd4_set_nfs4_label(struct svc_rqst *rqstp, struct svc_fh *fhp,
} }
#endif #endif
__be32 nfsd4_clone_file_range(struct file *src, u64 src_pos, struct file *dst, __be32 nfsd4_clone_file_range(struct nfsd_file *nf_src, u64 src_pos,
u64 dst_pos, u64 count, bool sync) struct nfsd_file *nf_dst, u64 dst_pos, u64 count, bool sync)
{ {
struct file *src = nf_src->nf_file;
struct file *dst = nf_dst->nf_file;
loff_t cloned; loff_t cloned;
cloned = vfs_clone_file_range(src, src_pos, dst, dst_pos, count, 0); cloned = vfs_clone_file_range(src, src_pos, dst, dst_pos, count, 0);
......
...@@ -57,8 +57,9 @@ __be32 nfsd4_set_nfs4_label(struct svc_rqst *, struct svc_fh *, ...@@ -57,8 +57,9 @@ __be32 nfsd4_set_nfs4_label(struct svc_rqst *, struct svc_fh *,
struct xdr_netobj *); struct xdr_netobj *);
__be32 nfsd4_vfs_fallocate(struct svc_rqst *, struct svc_fh *, __be32 nfsd4_vfs_fallocate(struct svc_rqst *, struct svc_fh *,
struct file *, loff_t, loff_t, int); struct file *, loff_t, loff_t, int);
__be32 nfsd4_clone_file_range(struct file *, u64, struct file *, __be32 nfsd4_clone_file_range(struct nfsd_file *nf_src, u64 src_pos,
u64, u64, bool); struct nfsd_file *nf_dst, u64 dst_pos,
u64 count, bool sync);
#endif /* CONFIG_NFSD_V4 */ #endif /* CONFIG_NFSD_V4 */
__be32 nfsd_create_locked(struct svc_rqst *, struct svc_fh *, __be32 nfsd_create_locked(struct svc_rqst *, struct svc_fh *,
char *name, int len, struct iattr *attrs, char *name, int len, struct iattr *attrs,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment