diff options
-rw-r--r-- | fs/nfs/nfs4client.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4session.c | 25 | ||||
-rw-r--r-- | fs/nfs/nfs4session.h | 2 |
3 files changed, 22 insertions, 7 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index dbb3e1f30c68..860ad26a5590 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c | |||
@@ -170,7 +170,7 @@ void nfs41_shutdown_client(struct nfs_client *clp) | |||
170 | void nfs40_shutdown_client(struct nfs_client *clp) | 170 | void nfs40_shutdown_client(struct nfs_client *clp) |
171 | { | 171 | { |
172 | if (clp->cl_slot_tbl) { | 172 | if (clp->cl_slot_tbl) { |
173 | nfs4_release_slot_table(clp->cl_slot_tbl); | 173 | nfs4_shutdown_slot_table(clp->cl_slot_tbl); |
174 | kfree(clp->cl_slot_tbl); | 174 | kfree(clp->cl_slot_tbl); |
175 | } | 175 | } |
176 | } | 176 | } |
diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c index cf883c7ae053..e799dc3c3b1d 100644 --- a/fs/nfs/nfs4session.c +++ b/fs/nfs/nfs4session.c | |||
@@ -231,14 +231,23 @@ out: | |||
231 | return ret; | 231 | return ret; |
232 | } | 232 | } |
233 | 233 | ||
234 | /* | ||
235 | * nfs4_release_slot_table - release all slot table entries | ||
236 | */ | ||
237 | static void nfs4_release_slot_table(struct nfs4_slot_table *tbl) | ||
238 | { | ||
239 | nfs4_shrink_slot_table(tbl, 0); | ||
240 | } | ||
241 | |||
234 | /** | 242 | /** |
235 | * nfs4_release_slot_table - release resources attached to a slot table | 243 | * nfs4_shutdown_slot_table - release resources attached to a slot table |
236 | * @tbl: slot table to shut down | 244 | * @tbl: slot table to shut down |
237 | * | 245 | * |
238 | */ | 246 | */ |
239 | void nfs4_release_slot_table(struct nfs4_slot_table *tbl) | 247 | void nfs4_shutdown_slot_table(struct nfs4_slot_table *tbl) |
240 | { | 248 | { |
241 | nfs4_shrink_slot_table(tbl, 0); | 249 | nfs4_release_slot_table(tbl); |
250 | rpc_destroy_wait_queue(&tbl->slot_tbl_waitq); | ||
242 | } | 251 | } |
243 | 252 | ||
244 | /** | 253 | /** |
@@ -422,7 +431,7 @@ void nfs41_update_target_slotid(struct nfs4_slot_table *tbl, | |||
422 | spin_unlock(&tbl->slot_tbl_lock); | 431 | spin_unlock(&tbl->slot_tbl_lock); |
423 | } | 432 | } |
424 | 433 | ||
425 | static void nfs4_destroy_session_slot_tables(struct nfs4_session *session) | 434 | static void nfs4_release_session_slot_tables(struct nfs4_session *session) |
426 | { | 435 | { |
427 | nfs4_release_slot_table(&session->fc_slot_table); | 436 | nfs4_release_slot_table(&session->fc_slot_table); |
428 | nfs4_release_slot_table(&session->bc_slot_table); | 437 | nfs4_release_slot_table(&session->bc_slot_table); |
@@ -450,7 +459,7 @@ int nfs4_setup_session_slot_tables(struct nfs4_session *ses) | |||
450 | if (status && tbl->slots == NULL) | 459 | if (status && tbl->slots == NULL) |
451 | /* Fore and back channel share a connection so get | 460 | /* Fore and back channel share a connection so get |
452 | * both slot tables or neither */ | 461 | * both slot tables or neither */ |
453 | nfs4_destroy_session_slot_tables(ses); | 462 | nfs4_release_session_slot_tables(ses); |
454 | return status; | 463 | return status; |
455 | } | 464 | } |
456 | 465 | ||
@@ -470,6 +479,12 @@ struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp) | |||
470 | return session; | 479 | return session; |
471 | } | 480 | } |
472 | 481 | ||
482 | static void nfs4_destroy_session_slot_tables(struct nfs4_session *session) | ||
483 | { | ||
484 | nfs4_shutdown_slot_table(&session->fc_slot_table); | ||
485 | nfs4_shutdown_slot_table(&session->bc_slot_table); | ||
486 | } | ||
487 | |||
473 | void nfs4_destroy_session(struct nfs4_session *session) | 488 | void nfs4_destroy_session(struct nfs4_session *session) |
474 | { | 489 | { |
475 | struct rpc_xprt *xprt; | 490 | struct rpc_xprt *xprt; |
diff --git a/fs/nfs/nfs4session.h b/fs/nfs/nfs4session.h index 232306100651..b34ada9bc6a2 100644 --- a/fs/nfs/nfs4session.h +++ b/fs/nfs/nfs4session.h | |||
@@ -74,7 +74,7 @@ enum nfs4_session_state { | |||
74 | 74 | ||
75 | extern int nfs4_setup_slot_table(struct nfs4_slot_table *tbl, | 75 | extern int nfs4_setup_slot_table(struct nfs4_slot_table *tbl, |
76 | unsigned int max_reqs, const char *queue); | 76 | unsigned int max_reqs, const char *queue); |
77 | extern void nfs4_release_slot_table(struct nfs4_slot_table *tbl); | 77 | extern void nfs4_shutdown_slot_table(struct nfs4_slot_table *tbl); |
78 | extern struct nfs4_slot *nfs4_alloc_slot(struct nfs4_slot_table *tbl); | 78 | extern struct nfs4_slot *nfs4_alloc_slot(struct nfs4_slot_table *tbl); |
79 | extern void nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot); | 79 | extern void nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot); |
80 | extern void nfs4_slot_tbl_drain_complete(struct nfs4_slot_table *tbl); | 80 | extern void nfs4_slot_tbl_drain_complete(struct nfs4_slot_table *tbl); |