[openib-general] [PATCH 4/9] kDAPL: convert the pz list to linux native

Tom Duffy Tom.Duffy at Sun.COM
Mon Jun 13 17:18:08 PDT 2005


Signed-off-by: Tom Duffy <tduffy at sun.com>

diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll4/dat-provider/dapl.h linux-kernel-ll5/dat-provider/dapl.h
--- linux-kernel-ll4/dat-provider/dapl.h	2005-06-13 15:35:21.410008000 -0700
+++ linux-kernel-ll5/dat-provider/dapl.h	2005-06-13 15:46:07.858004000 -0700
@@ -157,7 +157,7 @@ struct dapl_ia {
 	struct list_head ep_list;	/* EP queue */
 	struct list_head lmr_list;	/* LMR queue */
 	struct list_head rmr_list;	/* RMR queue */
-	struct dapl_llist_entry *pz_list_head;	/* PZ queue */
+	struct list_head pz_list;	/* PZ queue */
 	struct dapl_llist_entry *evd_list_head;	/* EVD queue */
 	struct dapl_llist_entry *psp_list_head;	/* PSP queue */
 	struct dapl_llist_entry *rsp_list_head;	/* RSP queue */
@@ -244,6 +244,7 @@ struct dapl_srq {
 struct dapl_pz {
 	struct dat_pz pz;
 	struct dapl_common common;
+	struct list_head list;
 	struct ib_pd *pd;
 	atomic_t pz_ref_count;
 };
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll4/dat-provider/dapl_ia.c linux-kernel-ll5/dat-provider/dapl_ia.c
--- linux-kernel-ll4/dat-provider/dapl_ia.c	2005-06-13 15:38:50.547003000 -0700
+++ linux-kernel-ll5/dat-provider/dapl_ia.c	2005-06-13 15:48:31.170005000 -0700
@@ -66,7 +66,7 @@ struct dapl_ia *dapl_ia_alloc(struct dat
 	INIT_LIST_HEAD(&ia->ep_list);
 	INIT_LIST_HEAD(&ia->lmr_list);
 	INIT_LIST_HEAD(&ia->rmr_list);
-	dapl_llist_init_head(&ia->pz_list_head);
+	INIT_LIST_HEAD(&ia->pz_list);
 	dapl_llist_init_head(&ia->evd_list_head);
 	dapl_llist_init_head(&ia->rsp_list_head);
 	dapl_llist_init_head(&ia->psp_list_head);
@@ -107,7 +107,7 @@ u32 dapl_ia_abrupt_close(struct dapl_ia 
 	struct dapl_ep *ep;
 	struct dapl_lmr *lmr;
 	struct dapl_rmr *rmr;
-	struct dapl_pz *pz, *next_pz;
+	struct dapl_pz *pz;
 	struct dapl_evd *evd, *next_evd;
 	struct dapl_sp *sp, *next_sp;	/* for PSP and RSP queues */
 	struct dapl_cr *cr;
@@ -218,18 +218,12 @@ u32 dapl_ia_abrupt_close(struct dapl_ia 
 		sp = next_sp;
 	}
 
-	pz = (dapl_llist_is_empty(&ia->pz_list_head)
-		  ? NULL : dapl_llist_peek_head(&ia->pz_list_head));
-	while (pz != NULL) {
-		next_pz = dapl_llist_next_entry(&ia->pz_list_head,
-						    &pz->common.
-						    ia_list_entry);
+	list_for_each_entry(pz, &ia->pz_list, list) {
 		dat_status = dapl_pz_free((struct dat_pz *)pz);
 		if (dat_status != DAT_SUCCESS)
 			dapl_dbg_log(DAPL_DBG_TYPE_WARN,
 				     "ia_close(ABRUPT): pz_free(%p) returns %x\n",
 				     pz, dat_status);
-		pz = next_pz;
 	}
 
 	/*
@@ -311,7 +305,7 @@ u32 dapl_ia_graceful_close(struct dapl_i
 	    !list_empty(&ia->ep_list) ||
 	    !list_empty(&ia->lmr_list) ||
 	    !dapl_llist_is_empty(&ia->psp_list_head) ||
-	    !dapl_llist_is_empty(&ia->pz_list_head)) {
+	    !list_empty(&ia->pz_list)) {
 		dat_status =
 		    DAT_ERROR(DAT_INVALID_STATE, DAT_INVALID_STATE_IA_IN_USE);
 		goto bail;
@@ -502,8 +496,7 @@ void dapl_ia_unlink_rmr(struct dapl_ia *
 void dapl_ia_link_pz(struct dapl_ia *ia, struct dapl_pz *pz)
 {
 	spin_lock_irqsave(&ia->common.lock, ia->common.flags);
-	dapl_llist_add_head(&ia->pz_list_head,
-			    &pz->common.ia_list_entry, pz);
+	list_add(&pz->list, &ia->pz_list);
 	spin_unlock_irqrestore(&ia->common.lock, ia->common.flags);
 }
 
@@ -513,8 +506,7 @@ void dapl_ia_link_pz(struct dapl_ia *ia,
 void dapl_ia_unlink_pz(struct dapl_ia *ia, struct dapl_pz *pz)
 {
 	spin_lock_irqsave(&ia->common.lock, ia->common.flags);
-	dapl_llist_remove_entry(&ia->pz_list_head,
-				&pz->common.ia_list_entry);
+	list_del(&pz->list);
 	spin_unlock_irqrestore(&ia->common.lock, ia->common.flags);
 }
 




More information about the general mailing list