diff options
author | Benny Halevy <bhalevy@tonian.com> | 2012-02-23 20:40:52 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-03-06 18:13:35 -0500 |
commit | 508dc6e110c6dbdc0bbe84298ccfe22de7538486 (patch) | |
tree | f55bd04f6a51fecb020a6b677935e232a3d9d709 /fs/nfsd/state.h | |
parent | e27f49c33b7410f4db065bc4382a8e03769eecc3 (diff) |
nfsd41: free_session/free_client must be called under the client_lock
The session client is manipulated under the client_lock hence
both free_session and nfsd4_del_conns must be called under this lock.
This patch adds a BUG_ON that checks this condition in the
respective functions and implements the missing locks.
nfsd4_{get,put}_session helpers were moved to the C file that uses them
so to prevent use from external files and an unlocked version of
nfsd4_put_session is provided for external use from nfs4xdr.c
Signed-off-by: Benny Halevy <bhalevy@tonian.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r-- | fs/nfsd/state.h | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index d8f52a0f4988..1e2b582bc9dc 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -198,18 +198,7 @@ struct nfsd4_session { | |||
198 | struct nfsd4_slot *se_slots[]; /* forward channel slots */ | 198 | struct nfsd4_slot *se_slots[]; /* forward channel slots */ |
199 | }; | 199 | }; |
200 | 200 | ||
201 | static inline void | 201 | extern void nfsd4_put_session(struct nfsd4_session *ses); |
202 | nfsd4_put_session(struct nfsd4_session *ses) | ||
203 | { | ||
204 | extern void free_session(struct kref *kref); | ||
205 | kref_put(&ses->se_ref, free_session); | ||
206 | } | ||
207 | |||
208 | static inline void | ||
209 | nfsd4_get_session(struct nfsd4_session *ses) | ||
210 | { | ||
211 | kref_get(&ses->se_ref); | ||
212 | } | ||
213 | 202 | ||
214 | /* formatted contents of nfs4_sessionid */ | 203 | /* formatted contents of nfs4_sessionid */ |
215 | struct nfsd4_sessionid { | 204 | struct nfsd4_sessionid { |