[openib-general] [PATCH][kdapl] Integrate dapl_hca_link_ia/dapl_hca_unlink_ia into dapl_ia.c

Itamar Rabenstein itamar at mellanox.co.il
Mon Jun 20 01:47:56 PDT 2005


Integrate dapl_hca_link_ia/dapl_hca_unlink_ia into dapl_ia.c
(no need for functions that just call LIST_ADD and LIST_DEL)

Signed-off-by: Itamar Rabenstein <itamar at mellanox.co.il>

diff -Nurp -X dontdiff dat-provider_simp/dapl_hca_util.c dat-provider/dapl_hca_util.c
--- dat-provider_simp/dapl_hca_util.c	Sun Jun 19 18:36:31 2005
+++ dat-provider/dapl_hca_util.c	Sun Jun 19 18:38:33 2005
@@ -88,49 +88,3 @@ void dapl_hca_free(struct dapl_hca *hca)
 {
 	kfree(hca);
 }
-
-/*
- * dapl_hca_link_ia
- *
- * Add an ia to the HCA structure
- *
- * Input:
- *	hca
- *	ia_ptr
- *
- * Output:
- * 	none
- *
- * Returns:
- * 	none
- *
- */
-void dapl_hca_link_ia(struct dapl_hca *hca, struct dapl_ia *ia_ptr)
-{
-	spin_lock_irqsave(&hca->lock, hca->flags);
-	list_add(&ia_ptr->list, &hca->ia_list);
-	spin_unlock_irqrestore(&hca->lock, hca->flags);
-}
-
-/*
- * dapl_hca_unlink_ia
- *
- * Remove an ia from the hca info structure
- *
- * Input:
- *	hca
- *	ia_ptr
- *
- * Output:
- * 	none
- *
- * Returns:
- * 	none
- *
- */
-void dapl_hca_unlink_ia(struct dapl_hca *hca, struct dapl_ia *ia)
-{
-	spin_lock_irqsave(&hca->lock, hca->flags);
-	list_del(&ia->list);
-	spin_unlock_irqrestore(&hca->lock, hca->flags);
-}
diff -Nurp -X dontdiff dat-provider_simp/dapl_hca_util.h dat-provider/dapl_hca_util.h
--- dat-provider_simp/dapl_hca_util.h	Sun Jun 19 18:36:31 2005
+++ dat-provider/dapl_hca_util.h	Sun Jun 19 18:36:45 2005
@@ -39,8 +39,4 @@ struct dapl_hca *dapl_hca_alloc(char *na
 
 void dapl_hca_free(struct dapl_hca *hca);
 
-void dapl_hca_link_ia(struct dapl_hca *hca, struct dapl_ia *ia);
-
-void dapl_hca_unlink_ia(struct dapl_hca *hca, struct dapl_ia *ia);
-
 #endif
diff -Nurp -X dontdiff dat-provider_simp/dapl_ia.c dat-provider/dapl_ia.c
--- dat-provider_simp/dapl_ia.c	Sun Jun 19 18:36:31 2005
+++ dat-provider/dapl_ia.c	Sun Jun 19 18:39:03 2005
@@ -34,7 +34,6 @@
 #include "dapl_ia.h"
 #include "dapl_provider.h"
 #include "dapl_evd.h"
-#include "dapl_hca_util.h"
 #include "dapl_openib_util.h"
 #include "dapl_sp.h"
 #include "dapl_cr.h"
@@ -71,7 +70,9 @@ static struct dapl_ia *dapl_ia_alloc(str
 	INIT_LIST_HEAD(&ia->psp_list);
 	INIT_LIST_HEAD(&ia->srq_list);
 
-	dapl_hca_link_ia(hca, ia);
+	spin_lock_irqsave(&hca->lock, hca->flags);
+	list_add(&ia->list, &hca->ia_list);
+	spin_unlock_irqrestore(&hca->lock, hca->flags);
 
 	return ia;
 }
@@ -379,7 +380,9 @@ void dapl_ia_free(struct dapl_ia *ia)
 	dapl_os_assert(list_empty(&ia->psp_list));
 	dapl_os_assert(list_empty(&ia->rsp_list));
 
-	dapl_hca_unlink_ia(ia->hca, ia);
+	spin_lock_irqsave(&ia->hca->lock, ia->hca->flags);
+	list_del(&ia->list);
+	spin_unlock_irqrestore(&ia->hca->lock, ia->hca->flags);
 	/* no need to destroy ia->common.lock */
 
 	kfree(ia);
-- 
Itamar



More information about the general mailing list