Commit 5ab55ff4 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd4: move seqid decrement on reclaim to separate function

Move seqid decrement on reclaim to separate function
Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1ea5482b
......@@ -1275,6 +1275,20 @@ nfs4_check_open(struct nfs4_file *fp, struct nfs4_stateowner *sop, struct nfsd4_
return status;
}
/* decrement seqid on successful reclaim, it will be bumped in encode_open */
static void
nfs4_set_claim_prev(struct nfsd4_open *open, int *status)
{
if (open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) {
if (*status)
*status = nfserr_reclaim_bad;
else {
open->op_stateowner->so_confirmed = 1;
open->op_stateowner->so_seqid--;
}
}
}
/*
* called with nfs4_lock_state() held.
*/
......@@ -1370,17 +1384,8 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
if (fp && list_empty(&fp->fi_perfile))
release_file(fp);
if (open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) {
if (status)
status = nfserr_reclaim_bad;
else {
/* successful reclaim. so_seqid is decremented because
* it will be bumped in encode_open
*/
open->op_stateowner->so_confirmed = 1;
open->op_stateowner->so_seqid--;
}
}
/* CLAIM_PREVIOUS has different error returns */
nfs4_set_claim_prev(open, &status);
/*
* To finish the open response, we just need to set the rflags.
*/
......
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