diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-08-22 11:39:07 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-08-27 14:21:27 -0400 |
commit | 9afb978400e65ea6a3200b3e163606ce86e13c25 (patch) | |
tree | e0c30b6f859ae37b519c6914d7485ab7969e46a5 /fs/nfsd | |
parent | a9004abc34239705840eaf6fe3d6cc9cb7656cba (diff) |
nfsd4: simplify lock openmode check
Note that the special handling for the lock stateid case is already done
by nfs4_check_openmode() (as of 02921914170e3b7fea1cd82dac9713685d2de5e2
"nfsd4: fix openmode checking on IO using lock stateid") so we no longer
need these two cases in the caller.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 14c8dd64e136..aafc41a0a8d0 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -3453,16 +3453,11 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid, | |||
3453 | if (!nfsd4_has_session(cstate) && | 3453 | if (!nfsd4_has_session(cstate) && |
3454 | !same_clid(&clp->cl_clientid, lockclid)) | 3454 | !same_clid(&clp->cl_clientid, lockclid)) |
3455 | return nfserr_bad_stateid; | 3455 | return nfserr_bad_stateid; |
3456 | /* stp is the open stateid */ | 3456 | } |
3457 | status = nfs4_check_openmode(stp, lkflg); | 3457 | /* stp is the open stateid */ |
3458 | if (status) | 3458 | status = nfs4_check_openmode(stp, lkflg); |
3459 | return status; | 3459 | if (status) |
3460 | } else { | 3460 | return status; |
3461 | /* stp is the lock stateid */ | ||
3462 | status = nfs4_check_openmode(stp->st_openstp, lkflg); | ||
3463 | if (status) | ||
3464 | return status; | ||
3465 | } | ||
3466 | } | 3461 | } |
3467 | 3462 | ||
3468 | if (nfs4_check_fh(current_fh, stp)) { | 3463 | if (nfs4_check_fh(current_fh, stp)) { |