diff options
author | Anna Schumaker <Anna.Schumaker@netapp.com> | 2015-12-03 06:59:51 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-07 23:11:52 -0500 |
commit | aa0d6aed45ff48bd41439211f2bda1d54585aba3 (patch) | |
tree | 035920b181729cc6406294d340e2a481feced642 /fs/nfsd | |
parent | 04b38d601239b4d9be641b412cf4b7456a041c67 (diff) |
nfsd: Pass filehandle to nfs4_preprocess_stateid_op()
This will be needed so COPY can look up the saved_fh in addition to the
current_fh.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 16 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 5 | ||||
-rw-r--r-- | fs/nfsd/state.h | 4 |
3 files changed, 13 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index a9f096c7e99f..3ba10a3534f1 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -774,8 +774,9 @@ nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
774 | clear_bit(RQ_SPLICE_OK, &rqstp->rq_flags); | 774 | clear_bit(RQ_SPLICE_OK, &rqstp->rq_flags); |
775 | 775 | ||
776 | /* check stateid */ | 776 | /* check stateid */ |
777 | status = nfs4_preprocess_stateid_op(rqstp, cstate, &read->rd_stateid, | 777 | status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, |
778 | RD_STATE, &read->rd_filp, &read->rd_tmp_file); | 778 | &read->rd_stateid, RD_STATE, |
779 | &read->rd_filp, &read->rd_tmp_file); | ||
779 | if (status) { | 780 | if (status) { |
780 | dprintk("NFSD: nfsd4_read: couldn't process stateid!\n"); | 781 | dprintk("NFSD: nfsd4_read: couldn't process stateid!\n"); |
781 | goto out; | 782 | goto out; |
@@ -921,7 +922,8 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
921 | 922 | ||
922 | if (setattr->sa_iattr.ia_valid & ATTR_SIZE) { | 923 | if (setattr->sa_iattr.ia_valid & ATTR_SIZE) { |
923 | status = nfs4_preprocess_stateid_op(rqstp, cstate, | 924 | status = nfs4_preprocess_stateid_op(rqstp, cstate, |
924 | &setattr->sa_stateid, WR_STATE, NULL, NULL); | 925 | &cstate->current_fh, &setattr->sa_stateid, |
926 | WR_STATE, NULL, NULL); | ||
925 | if (status) { | 927 | if (status) { |
926 | dprintk("NFSD: nfsd4_setattr: couldn't process stateid!\n"); | 928 | dprintk("NFSD: nfsd4_setattr: couldn't process stateid!\n"); |
927 | return status; | 929 | return status; |
@@ -985,8 +987,8 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
985 | if (write->wr_offset >= OFFSET_MAX) | 987 | if (write->wr_offset >= OFFSET_MAX) |
986 | return nfserr_inval; | 988 | return nfserr_inval; |
987 | 989 | ||
988 | status = nfs4_preprocess_stateid_op(rqstp, cstate, stateid, WR_STATE, | 990 | status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, |
989 | &filp, NULL); | 991 | stateid, WR_STATE, &filp, NULL); |
990 | if (status) { | 992 | if (status) { |
991 | dprintk("NFSD: nfsd4_write: couldn't process stateid!\n"); | 993 | dprintk("NFSD: nfsd4_write: couldn't process stateid!\n"); |
992 | return status; | 994 | return status; |
@@ -1016,7 +1018,7 @@ nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
1016 | __be32 status = nfserr_notsupp; | 1018 | __be32 status = nfserr_notsupp; |
1017 | struct file *file; | 1019 | struct file *file; |
1018 | 1020 | ||
1019 | status = nfs4_preprocess_stateid_op(rqstp, cstate, | 1021 | status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, |
1020 | &fallocate->falloc_stateid, | 1022 | &fallocate->falloc_stateid, |
1021 | WR_STATE, &file, NULL); | 1023 | WR_STATE, &file, NULL); |
1022 | if (status != nfs_ok) { | 1024 | if (status != nfs_ok) { |
@@ -1055,7 +1057,7 @@ nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
1055 | __be32 status; | 1057 | __be32 status; |
1056 | struct file *file; | 1058 | struct file *file; |
1057 | 1059 | ||
1058 | status = nfs4_preprocess_stateid_op(rqstp, cstate, | 1060 | status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, |
1059 | &seek->seek_stateid, | 1061 | &seek->seek_stateid, |
1060 | RD_STATE, &file, NULL); | 1062 | RD_STATE, &file, NULL); |
1061 | if (status) { | 1063 | if (status) { |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 6b800b5b8fed..df5dba687265 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -4797,10 +4797,9 @@ nfs4_check_file(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfs4_stid *s, | |||
4797 | */ | 4797 | */ |
4798 | __be32 | 4798 | __be32 |
4799 | nfs4_preprocess_stateid_op(struct svc_rqst *rqstp, | 4799 | nfs4_preprocess_stateid_op(struct svc_rqst *rqstp, |
4800 | struct nfsd4_compound_state *cstate, stateid_t *stateid, | 4800 | struct nfsd4_compound_state *cstate, struct svc_fh *fhp, |
4801 | int flags, struct file **filpp, bool *tmp_file) | 4801 | stateid_t *stateid, int flags, struct file **filpp, bool *tmp_file) |
4802 | { | 4802 | { |
4803 | struct svc_fh *fhp = &cstate->current_fh; | ||
4804 | struct inode *ino = d_inode(fhp->fh_dentry); | 4803 | struct inode *ino = d_inode(fhp->fh_dentry); |
4805 | struct net *net = SVC_NET(rqstp); | 4804 | struct net *net = SVC_NET(rqstp); |
4806 | struct nfsd_net *nn = net_generic(net, nfsd_net_id); | 4805 | struct nfsd_net *nn = net_generic(net, nfsd_net_id); |
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 77fdf4de91ba..99432b7ecb9c 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -578,8 +578,8 @@ struct nfsd4_compound_state; | |||
578 | struct nfsd_net; | 578 | struct nfsd_net; |
579 | 579 | ||
580 | extern __be32 nfs4_preprocess_stateid_op(struct svc_rqst *rqstp, | 580 | extern __be32 nfs4_preprocess_stateid_op(struct svc_rqst *rqstp, |
581 | struct nfsd4_compound_state *cstate, stateid_t *stateid, | 581 | struct nfsd4_compound_state *cstate, struct svc_fh *fhp, |
582 | int flags, struct file **filp, bool *tmp_file); | 582 | stateid_t *stateid, int flags, struct file **filp, bool *tmp_file); |
583 | __be32 nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate, | 583 | __be32 nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate, |
584 | stateid_t *stateid, unsigned char typemask, | 584 | stateid_t *stateid, unsigned char typemask, |
585 | struct nfs4_stid **s, struct nfsd_net *nn); | 585 | struct nfs4_stid **s, struct nfsd_net *nn); |