diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-06-06 16:01:37 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-06-20 08:59:42 -0400 |
commit | e1aaa8916f19d23d39d88e985bc6933a74159e91 (patch) | |
tree | 762d505166c522d7de5b679b899e4addd9fb6383 | |
parent | 9068bed1a35da413df8751b8b1b845a04f62b9fd (diff) |
nfsd4: nfsd4_lock() cleanup
Share a little common logic. And note the comments here are a little
out of date (e.g. we don't always create new state in the "new" case any
more.)
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4state.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 59b9efc9d69b..de8f7e45102d 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -4059,11 +4059,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
4059 | nfs4_lock_state(); | 4059 | nfs4_lock_state(); |
4060 | 4060 | ||
4061 | if (lock->lk_is_new) { | 4061 | if (lock->lk_is_new) { |
4062 | /* | ||
4063 | * Client indicates that this is a new lockowner. | ||
4064 | * Use open owner and open stateid to create lock owner and | ||
4065 | * lock stateid. | ||
4066 | */ | ||
4067 | struct nfs4_ol_stateid *open_stp = NULL; | 4062 | struct nfs4_ol_stateid *open_stp = NULL; |
4068 | 4063 | ||
4069 | if (nfsd4_has_session(cstate)) | 4064 | if (nfsd4_has_session(cstate)) |
@@ -4090,17 +4085,13 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
4090 | goto out; | 4085 | goto out; |
4091 | status = lookup_or_create_lock_state(cstate, open_stp, lock, | 4086 | status = lookup_or_create_lock_state(cstate, open_stp, lock, |
4092 | &lock_stp, &new_state); | 4087 | &lock_stp, &new_state); |
4093 | if (status) | 4088 | } else |
4094 | goto out; | ||
4095 | } else { | ||
4096 | /* lock (lock owner + lock stateid) already exists */ | ||
4097 | status = nfs4_preprocess_seqid_op(cstate, | 4089 | status = nfs4_preprocess_seqid_op(cstate, |
4098 | lock->lk_old_lock_seqid, | 4090 | lock->lk_old_lock_seqid, |
4099 | &lock->lk_old_lock_stateid, | 4091 | &lock->lk_old_lock_stateid, |
4100 | NFS4_LOCK_STID, &lock_stp); | 4092 | NFS4_LOCK_STID, &lock_stp); |
4101 | if (status) | 4093 | if (status) |
4102 | goto out; | 4094 | goto out; |
4103 | } | ||
4104 | lock_sop = lockowner(lock_stp->st_stateowner); | 4095 | lock_sop = lockowner(lock_stp->st_stateowner); |
4105 | 4096 | ||
4106 | lkflg = setlkflg(lock->lk_type); | 4097 | lkflg = setlkflg(lock->lk_type); |