aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-09-12 12:24:13 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-09-16 17:44:16 -0400
commitdad1c067eb42ec8bedadd64f681056914547d22e (patch)
treee4f8408fe930975491df079943d37ae9df274c25 /fs/nfsd/nfs4state.c
parent58e7b33a58d0cd07c9294d5161553b204c75662d (diff)
nfsd4: replace oo_confirmed by flag bit
I want at least one more bit here. So, let's haul out the caps lock key and add a flags field. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index e7f83bd9b4a8..59b70afdc884 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2322,7 +2322,7 @@ alloc_init_open_stateowner(unsigned int strhashval, struct nfs4_client *clp, str
2322 return NULL; 2322 return NULL;
2323 oo->oo_owner.so_is_open_owner = 1; 2323 oo->oo_owner.so_is_open_owner = 1;
2324 oo->oo_owner.so_seqid = open->op_seqid; 2324 oo->oo_owner.so_seqid = open->op_seqid;
2325 oo->oo_confirmed = 0; 2325 oo->oo_flags = 0;
2326 oo->oo_time = 0; 2326 oo->oo_time = 0;
2327 INIT_LIST_HEAD(&oo->oo_close_lru); 2327 INIT_LIST_HEAD(&oo->oo_close_lru);
2328 hash_openowner(oo, clp, strhashval); 2328 hash_openowner(oo, clp, strhashval);
@@ -2549,7 +2549,7 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate,
2549 return nfserr_expired; 2549 return nfserr_expired;
2550 goto renew; 2550 goto renew;
2551 } 2551 }
2552 if (!oo->oo_confirmed) { 2552 if (!(oo->oo_flags & NFS4_OO_CONFIRMED)) {
2553 /* Replace unconfirmed owners without checking for replay. */ 2553 /* Replace unconfirmed owners without checking for replay. */
2554 clp = oo->oo_owner.so_client; 2554 clp = oo->oo_owner.so_client;
2555 release_openowner(oo); 2555 release_openowner(oo);
@@ -2616,7 +2616,7 @@ out:
2616 return nfs_ok; 2616 return nfs_ok;
2617 if (status) 2617 if (status)
2618 return status; 2618 return status;
2619 open->op_openowner->oo_confirmed = 1; 2619 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
2620 return nfs_ok; 2620 return nfs_ok;
2621} 2621}
2622 2622
@@ -2749,7 +2749,7 @@ nfs4_upgrade_open(struct svc_rqst *rqstp, struct nfs4_file *fp, struct svc_fh *c
2749static void 2749static void
2750nfs4_set_claim_prev(struct nfsd4_open *open) 2750nfs4_set_claim_prev(struct nfsd4_open *open)
2751{ 2751{
2752 open->op_openowner->oo_confirmed = 1; 2752 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
2753 open->op_openowner->oo_owner.so_client->cl_firststate = 1; 2753 open->op_openowner->oo_owner.so_client->cl_firststate = 1;
2754} 2754}
2755 2755
@@ -2853,7 +2853,7 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_ol_
2853 * had the chance to reclaim theirs.... */ 2853 * had the chance to reclaim theirs.... */
2854 if (locks_in_grace()) 2854 if (locks_in_grace())
2855 goto out; 2855 goto out;
2856 if (!cb_up || !oo->oo_confirmed) 2856 if (!cb_up || !(oo->oo_flags & NFS4_OO_CONFIRMED))
2857 goto out; 2857 goto out;
2858 if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE) 2858 if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)
2859 flag = NFS4_OPEN_DELEGATE_WRITE; 2859 flag = NFS4_OPEN_DELEGATE_WRITE;
@@ -2952,7 +2952,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
2952 memcpy(&open->op_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t)); 2952 memcpy(&open->op_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t));
2953 2953
2954 if (nfsd4_has_session(&resp->cstate)) 2954 if (nfsd4_has_session(&resp->cstate))
2955 open->op_openowner->oo_confirmed = 1; 2955 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
2956 2956
2957 /* 2957 /*
2958 * Attempt to hand out a delegation. No error return, because the 2958 * Attempt to hand out a delegation. No error return, because the
@@ -2973,7 +2973,7 @@ out:
2973 * To finish the open response, we just need to set the rflags. 2973 * To finish the open response, we just need to set the rflags.
2974 */ 2974 */
2975 open->op_rflags = NFS4_OPEN_RESULT_LOCKTYPE_POSIX; 2975 open->op_rflags = NFS4_OPEN_RESULT_LOCKTYPE_POSIX;
2976 if (!open->op_openowner->oo_confirmed && 2976 if (!(open->op_openowner->oo_flags & NFS4_OO_CONFIRMED) &&
2977 !nfsd4_has_session(&resp->cstate)) 2977 !nfsd4_has_session(&resp->cstate))
2978 open->op_rflags |= NFS4_OPEN_RESULT_CONFIRM; 2978 open->op_rflags |= NFS4_OPEN_RESULT_CONFIRM;
2979 2979
@@ -3264,7 +3264,7 @@ __be32 nfs4_validate_stateid(stateid_t *stateid, bool has_session)
3264 return nfs_ok; 3264 return nfs_ok;
3265 ols = openlockstateid(s); 3265 ols = openlockstateid(s);
3266 if (ols->st_stateowner->so_is_open_owner 3266 if (ols->st_stateowner->so_is_open_owner
3267 && !openowner(ols->st_stateowner)->oo_confirmed) 3267 && !(openowner(ols->st_stateowner)->oo_flags & NFS4_OO_CONFIRMED))
3268 return nfserr_bad_stateid; 3268 return nfserr_bad_stateid;
3269 return nfs_ok; 3269 return nfs_ok;
3270} 3270}
@@ -3323,7 +3323,7 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
3323 if (nfs4_check_fh(current_fh, stp)) 3323 if (nfs4_check_fh(current_fh, stp))
3324 goto out; 3324 goto out;
3325 if (stp->st_stateowner->so_is_open_owner 3325 if (stp->st_stateowner->so_is_open_owner
3326 && !openowner(stp->st_stateowner)->oo_confirmed) 3326 && !(openowner(stp->st_stateowner)->oo_flags & NFS4_OO_CONFIRMED))
3327 goto out; 3327 goto out;
3328 status = nfs4_check_openmode(stp, flags); 3328 status = nfs4_check_openmode(stp, flags);
3329 if (status) 3329 if (status)
@@ -3476,7 +3476,7 @@ static __be32 nfs4_preprocess_confirmed_seqid_op(struct nfsd4_compound_state *cs
3476 if (status) 3476 if (status)
3477 return status; 3477 return status;
3478 oo = openowner((*stpp)->st_stateowner); 3478 oo = openowner((*stpp)->st_stateowner);
3479 if (!oo->oo_confirmed) 3479 if (!(oo->oo_flags & NFS4_OO_CONFIRMED))
3480 return nfserr_bad_stateid; 3480 return nfserr_bad_stateid;
3481 return nfs_ok; 3481 return nfs_ok;
3482} 3482}
@@ -3506,9 +3506,9 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
3506 goto out; 3506 goto out;
3507 oo = openowner(stp->st_stateowner); 3507 oo = openowner(stp->st_stateowner);
3508 status = nfserr_bad_stateid; 3508 status = nfserr_bad_stateid;
3509 if (oo->oo_confirmed) 3509 if (oo->oo_flags & NFS4_OO_CONFIRMED)
3510 goto out; 3510 goto out;
3511 oo->oo_confirmed = 1; 3511 oo->oo_flags |= NFS4_OO_CONFIRMED;
3512 update_stateid(&stp->st_stid.sc_stateid); 3512 update_stateid(&stp->st_stid.sc_stateid);
3513 memcpy(&oc->oc_resp_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t)); 3513 memcpy(&oc->oc_resp_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t));
3514 dprintk("NFSD: %s: success, seqid=%d stateid=" STATEID_FMT "\n", 3514 dprintk("NFSD: %s: success, seqid=%d stateid=" STATEID_FMT "\n",