NFSD: Add documenting comment for nfsd4_release_lockowner()
[ Upstream commit 043862b09cc00273e35e6c3a6389957953a34207 ] And return explicit nfserr values that match what is documented in the new comment / API contract. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8b8f536a81
commit
bb58cbbf0a
1 changed files with 20 additions and 3 deletions
|
@ -7556,6 +7556,23 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nfsd4_release_lockowner - process NFSv4.0 RELEASE_LOCKOWNER operations
|
||||||
|
* @rqstp: RPC transaction
|
||||||
|
* @cstate: NFSv4 COMPOUND state
|
||||||
|
* @u: RELEASE_LOCKOWNER arguments
|
||||||
|
*
|
||||||
|
* The lockowner's so_count is bumped when a lock record is added
|
||||||
|
* or when copying a conflicting lock. The latter case is brief,
|
||||||
|
* but can lead to fleeting false positives when looking for
|
||||||
|
* locks-in-use.
|
||||||
|
*
|
||||||
|
* Return values:
|
||||||
|
* %nfs_ok: lockowner released or not found
|
||||||
|
* %nfserr_locks_held: lockowner still in use
|
||||||
|
* %nfserr_stale_clientid: clientid no longer active
|
||||||
|
* %nfserr_expired: clientid not recognized
|
||||||
|
*/
|
||||||
__be32
|
__be32
|
||||||
nfsd4_release_lockowner(struct svc_rqst *rqstp,
|
nfsd4_release_lockowner(struct svc_rqst *rqstp,
|
||||||
struct nfsd4_compound_state *cstate,
|
struct nfsd4_compound_state *cstate,
|
||||||
|
@ -7582,7 +7599,7 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,
|
||||||
lo = find_lockowner_str_locked(clp, &rlockowner->rl_owner);
|
lo = find_lockowner_str_locked(clp, &rlockowner->rl_owner);
|
||||||
if (!lo) {
|
if (!lo) {
|
||||||
spin_unlock(&clp->cl_lock);
|
spin_unlock(&clp->cl_lock);
|
||||||
return status;
|
return nfs_ok;
|
||||||
}
|
}
|
||||||
if (atomic_read(&lo->lo_owner.so_count) != 2) {
|
if (atomic_read(&lo->lo_owner.so_count) != 2) {
|
||||||
spin_unlock(&clp->cl_lock);
|
spin_unlock(&clp->cl_lock);
|
||||||
|
@ -7598,11 +7615,11 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,
|
||||||
put_ol_stateid_locked(stp, &reaplist);
|
put_ol_stateid_locked(stp, &reaplist);
|
||||||
}
|
}
|
||||||
spin_unlock(&clp->cl_lock);
|
spin_unlock(&clp->cl_lock);
|
||||||
|
|
||||||
free_ol_stateid_reaplist(&reaplist);
|
free_ol_stateid_reaplist(&reaplist);
|
||||||
remove_blocked_locks(lo);
|
remove_blocked_locks(lo);
|
||||||
nfs4_put_stateowner(&lo->lo_owner);
|
nfs4_put_stateowner(&lo->lo_owner);
|
||||||
|
return nfs_ok;
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct nfs4_client_reclaim *
|
static inline struct nfs4_client_reclaim *
|
||||||
|
|
Loading…
Add table
Reference in a new issue