From b45a4228bfda550a1a0d737891f930ae34d9c0d0 Mon Sep 17 00:00:00 2001 From: leonidk Date: Wed, 2 Jul 2008 17:53:15 +0000 Subject: [PATCH] [IBAL] IBAL currently blows away all CEPs from its 'destroying' callback. This patch moves this so that any left over CEPs are cleaned up in the 'cleanup' callback, so that objects that 'own' a CEP have a chance to clean themselves up first. Signed-off-by: Fab Tillier git-svn-id: svn://openib.tc.cornell.edu/gen1@1328 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/core/al/al.c | 9 +++++++-- trunk/core/al/al.h | 5 +++++ trunk/core/al/kernel/al_mgr.c | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/trunk/core/al/al.c b/trunk/core/al/al.c index f1e648fe..db8c0e2e 100644 --- a/trunk/core/al/al.c +++ b/trunk/core/al/al.c @@ -116,13 +116,18 @@ destroying_al( } cl_spinlock_release( &p_obj->lock ); +} + +void +cleanup_al( + IN al_obj_t *p_obj ) +{ /* Cleanup any left-over connections. */ - al_cep_cleanup_al( h_al ); + al_cep_cleanup_al( PARENT_STRUCT( p_obj, ib_al_t, obj ) ); } - static void __free_mads( IN const ib_al_handle_t h_al ) diff --git a/trunk/core/al/al.h b/trunk/core/al/al.h index 07e402d9..58da6212 100644 --- a/trunk/core/al/al.h +++ b/trunk/core/al/al.h @@ -108,6 +108,11 @@ destroying_al( IN al_obj_t *p_obj ); +void +cleanup_al( + IN al_obj_t *p_obj ); + + void free_al( IN al_obj_t *p_obj ); diff --git a/trunk/core/al/kernel/al_mgr.c b/trunk/core/al/kernel/al_mgr.c index 1c7ab569..885ead6b 100644 --- a/trunk/core/al/kernel/al_mgr.c +++ b/trunk/core/al/kernel/al_mgr.c @@ -414,7 +414,7 @@ ib_open_al( /* Initialize the base object. */ status = init_al_obj( &h_al->obj, NULL, FALSE, - destroying_al, NULL, free_al ); + destroying_al, cleanup_al, free_al ); if( status != IB_SUCCESS ) { free_al( &h_al->obj ); -- 2.46.0