[ofw] [PATCH] Cleanup CEPs after all child objects have been destroyed

Fab Tillier ftillier at windows.microsoft.com
Wed Jul 2 10:17:10 PDT 2008


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 <ftillier at microsoft.com>

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\al.c trunk\core\al\al.c
--- old\core\al\al.c    Tue Jul 01 10:36:06 2008
+++ trunk\core\al\al.c  Wed Jul 02 10:14:04 2008
@@ -116,11 +116,16 @@ 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
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\al.h trunk\core\al\al.h
--- old\core\al\al.h    Tue Jul 01 10:36:06 2008
+++ trunk\core\al\al.h  Wed Jul 02 10:14:04 2008
@@ -109,6 +109,11 @@ destroying_al(


 void
+cleanup_al(
+       IN                              al_obj_t                                        *p_obj );
+
+
+void
 free_al(
        IN                              al_obj_t                                        *p_obj );

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\kernel\al_mgr.c trunk\core\al\kernel\al_mgr.c
--- old\core\al\kernel\al_mgr.c Tue Jul 01 10:36:03 2008
+++ trunk\core\al\kernel\al_mgr.c       Wed Jul 02 10:14:04 2008
@@ -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 );
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cep_cleanup.patch
Type: application/octet-stream
Size: 1320 bytes
Desc: cep_cleanup.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080702/73d0483e/attachment.obj>


More information about the ofw mailing list