aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4proc.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-07-30 23:33:59 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-09-07 09:45:49 -0400
commitfe0750e5c43189adb6e6fc59837af7d5a588f413 (patch)
tree88c5afe7a955f1e55e305639a4d6031237542b8d /fs/nfsd/nfs4proc.c
parentf4dee24cca98739a4190a00fa014cd1b7e2581a4 (diff)
nfsd4: split stateowners into open and lockowners
The stateowner has some fields that only make sense for openowners, and some that only make sense for lockowners, and I find it a lot clearer if those are separated out. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r--fs/nfsd/nfs4proc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index ce151f0ed4b9..460eeb329d81 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -250,7 +250,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
250 fh_dup2(current_fh, &resfh); 250 fh_dup2(current_fh, &resfh);
251 251
252 /* set reply cache */ 252 /* set reply cache */
253 fh_copy_shallow(&open->op_stateowner->so_replay.rp_openfh, 253 fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh,
254 &resfh.fh_handle); 254 &resfh.fh_handle);
255 if (!created) 255 if (!created)
256 status = do_open_permission(rqstp, current_fh, open, 256 status = do_open_permission(rqstp, current_fh, open,
@@ -277,7 +277,7 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
277 memset(&open->op_cinfo, 0, sizeof(struct nfsd4_change_info)); 277 memset(&open->op_cinfo, 0, sizeof(struct nfsd4_change_info));
278 278
279 /* set replay cache */ 279 /* set replay cache */
280 fh_copy_shallow(&open->op_stateowner->so_replay.rp_openfh, 280 fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh,
281 &current_fh->fh_handle); 281 &current_fh->fh_handle);
282 282
283 open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) && 283 open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) &&
@@ -306,9 +306,9 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
306 __be32 status; 306 __be32 status;
307 struct nfsd4_compoundres *resp; 307 struct nfsd4_compoundres *resp;
308 308
309 dprintk("NFSD: nfsd4_open filename %.*s op_stateowner %p\n", 309 dprintk("NFSD: nfsd4_open filename %.*s op_openowner %p\n",
310 (int)open->op_fname.len, open->op_fname.data, 310 (int)open->op_fname.len, open->op_fname.data,
311 open->op_stateowner); 311 open->op_openowner);
312 312
313 /* This check required by spec. */ 313 /* This check required by spec. */
314 if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) 314 if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL)
@@ -332,7 +332,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
332 resp = rqstp->rq_resp; 332 resp = rqstp->rq_resp;
333 status = nfsd4_process_open1(&resp->cstate, open); 333 status = nfsd4_process_open1(&resp->cstate, open);
334 if (status == nfserr_replay_me) { 334 if (status == nfserr_replay_me) {
335 struct nfs4_replay *rp = &open->op_stateowner->so_replay; 335 struct nfs4_replay *rp = &open->op_openowner->oo_owner.so_replay;
336 fh_put(&cstate->current_fh); 336 fh_put(&cstate->current_fh);
337 fh_copy_shallow(&cstate->current_fh.fh_handle, 337 fh_copy_shallow(&cstate->current_fh.fh_handle,
338 &rp->rp_openfh); 338 &rp->rp_openfh);
@@ -374,7 +374,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
374 goto out; 374 goto out;
375 break; 375 break;
376 case NFS4_OPEN_CLAIM_PREVIOUS: 376 case NFS4_OPEN_CLAIM_PREVIOUS:
377 open->op_stateowner->so_confirmed = 1; 377 open->op_openowner->oo_confirmed = 1;
378 /* 378 /*
379 * The CURRENT_FH is already set to the file being 379 * The CURRENT_FH is already set to the file being
380 * opened. (1) set open->op_cinfo, (2) set 380 * opened. (1) set open->op_cinfo, (2) set
@@ -387,7 +387,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
387 goto out; 387 goto out;
388 break; 388 break;
389 case NFS4_OPEN_CLAIM_DELEGATE_PREV: 389 case NFS4_OPEN_CLAIM_DELEGATE_PREV:
390 open->op_stateowner->so_confirmed = 1; 390 open->op_openowner->oo_confirmed = 1;
391 dprintk("NFSD: unsupported OPEN claim type %d\n", 391 dprintk("NFSD: unsupported OPEN claim type %d\n",
392 open->op_claim_type); 392 open->op_claim_type);
393 status = nfserr_notsupp; 393 status = nfserr_notsupp;
@@ -405,8 +405,8 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
405 */ 405 */
406 status = nfsd4_process_open2(rqstp, &cstate->current_fh, open); 406 status = nfsd4_process_open2(rqstp, &cstate->current_fh, open);
407out: 407out:
408 if (open->op_stateowner) 408 if (open->op_openowner)
409 cstate->replay_owner = open->op_stateowner; 409 cstate->replay_owner = &open->op_openowner->oo_owner;
410 else 410 else
411 nfs4_unlock_state(); 411 nfs4_unlock_state();
412 return status; 412 return status;