diff options
author | J. Bruce Fields <bfields@redhat.com> | 2013-03-22 18:03:49 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-04-09 09:08:56 -0400 |
commit | bbc9c36c31fc5827c22359a8b0ba9dd71b5eecfc (patch) | |
tree | ad32781b3ab9ebb552bba91d67d83f0ac1195d7e /fs | |
parent | 3d74e6a5b6b0d1e4786d1596081bed6ab63a4cac (diff) |
nfsd4: more sessions/open-owner-replay cleanup
More logic that's unnecessary in the 4.1 case.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index c97bb424f55f..5dee81141ab7 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -191,9 +191,18 @@ static __be32 nfsd_check_obj_isreg(struct svc_fh *fh) | |||
191 | return nfserr_symlink; | 191 | return nfserr_symlink; |
192 | } | 192 | } |
193 | 193 | ||
194 | static void nfsd4_set_open_owner_reply_cache(struct nfsd4_compound_state *cstate, struct nfsd4_open *open, struct svc_fh *resfh) | ||
195 | { | ||
196 | if (nfsd4_has_session(cstate)) | ||
197 | return; | ||
198 | fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh, | ||
199 | &resfh->fh_handle); | ||
200 | } | ||
201 | |||
194 | static __be32 | 202 | static __be32 |
195 | do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open) | 203 | do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open) |
196 | { | 204 | { |
205 | struct svc_fh *current_fh = &cstate->current_fh; | ||
197 | struct svc_fh *resfh; | 206 | struct svc_fh *resfh; |
198 | int accmode; | 207 | int accmode; |
199 | __be32 status; | 208 | __be32 status; |
@@ -252,9 +261,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o | |||
252 | if (is_create_with_attrs(open) && open->op_acl != NULL) | 261 | if (is_create_with_attrs(open) && open->op_acl != NULL) |
253 | do_set_nfs4_acl(rqstp, resfh, open->op_acl, open->op_bmval); | 262 | do_set_nfs4_acl(rqstp, resfh, open->op_acl, open->op_bmval); |
254 | 263 | ||
255 | /* set reply cache */ | 264 | nfsd4_set_open_owner_reply_cache(cstate, open, resfh); |
256 | fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh, | ||
257 | &resfh->fh_handle); | ||
258 | accmode = NFSD_MAY_NOP; | 265 | accmode = NFSD_MAY_NOP; |
259 | if (open->op_created) | 266 | if (open->op_created) |
260 | accmode |= NFSD_MAY_OWNER_OVERRIDE; | 267 | accmode |= NFSD_MAY_OWNER_OVERRIDE; |
@@ -268,8 +275,9 @@ out: | |||
268 | } | 275 | } |
269 | 276 | ||
270 | static __be32 | 277 | static __be32 |
271 | do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open) | 278 | do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open) |
272 | { | 279 | { |
280 | struct svc_fh *current_fh = &cstate->current_fh; | ||
273 | __be32 status; | 281 | __be32 status; |
274 | 282 | ||
275 | /* We don't know the target directory, and therefore can not | 283 | /* We don't know the target directory, and therefore can not |
@@ -278,9 +286,7 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_ | |||
278 | 286 | ||
279 | memset(&open->op_cinfo, 0, sizeof(struct nfsd4_change_info)); | 287 | memset(&open->op_cinfo, 0, sizeof(struct nfsd4_change_info)); |
280 | 288 | ||
281 | /* set replay cache */ | 289 | nfsd4_set_open_owner_reply_cache(cstate, open, current_fh); |
282 | fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh, | ||
283 | ¤t_fh->fh_handle); | ||
284 | 290 | ||
285 | open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) && | 291 | open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) && |
286 | (open->op_iattr.ia_size == 0); | 292 | (open->op_iattr.ia_size == 0); |
@@ -372,8 +378,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
372 | switch (open->op_claim_type) { | 378 | switch (open->op_claim_type) { |
373 | case NFS4_OPEN_CLAIM_DELEGATE_CUR: | 379 | case NFS4_OPEN_CLAIM_DELEGATE_CUR: |
374 | case NFS4_OPEN_CLAIM_NULL: | 380 | case NFS4_OPEN_CLAIM_NULL: |
375 | status = do_open_lookup(rqstp, &cstate->current_fh, | 381 | status = do_open_lookup(rqstp, cstate, open); |
376 | open); | ||
377 | if (status) | 382 | if (status) |
378 | goto out; | 383 | goto out; |
379 | break; | 384 | break; |
@@ -386,8 +391,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
386 | goto out; | 391 | goto out; |
387 | case NFS4_OPEN_CLAIM_FH: | 392 | case NFS4_OPEN_CLAIM_FH: |
388 | case NFS4_OPEN_CLAIM_DELEG_CUR_FH: | 393 | case NFS4_OPEN_CLAIM_DELEG_CUR_FH: |
389 | status = do_open_fhandle(rqstp, &cstate->current_fh, | 394 | status = do_open_fhandle(rqstp, cstate, open); |
390 | open); | ||
391 | if (status) | 395 | if (status) |
392 | goto out; | 396 | goto out; |
393 | break; | 397 | break; |