diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-05-29 16:37:44 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-05-31 20:30:39 -0400 |
commit | 6eccece90b6addf80ef9e6db79b0bc873301034b (patch) | |
tree | 89ca95d5ea308a87c0162fdc23950e1612f5b3d6 /fs | |
parent | b9831b59f31eca65e1beec01fadf02ca82485813 (diff) |
nfsd4: fix, consolidate client_has_state
Whoops: first, I reimplemented the already-existing has_resources
without noticing; second, I got the test backwards. I did pick a better
name, though. Combine the two....
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4state.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index c91e26d84f0..0a6901d4534 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1537,9 +1537,9 @@ static bool client_has_state(struct nfs4_client *clp) * * Also note we should probably be using this in 4.0 case too. */ - return list_empty(&clp->cl_openowners) - && list_empty(&clp->cl_delegations) - && list_empty(&clp->cl_sessions); + return !list_empty(&clp->cl_openowners) + || !list_empty(&clp->cl_delegations) + || !list_empty(&clp->cl_sessions); } __be32 @@ -2069,13 +2069,6 @@ out: return status; } -static inline bool has_resources(struct nfs4_client *clp) -{ - return !list_empty(&clp->cl_openowners) - || !list_empty(&clp->cl_delegations) - || !list_empty(&clp->cl_sessions); -} - __be32 nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_clientid *dc) { @@ -2089,7 +2082,7 @@ nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta if (conf) { clp = conf; - if (!is_client_expired(conf) && has_resources(conf)) { + if (!is_client_expired(conf) && client_has_state(conf)) { status = nfserr_clientid_busy; goto out; } |