[openib-general] [PATCH 9/9] kDAPL: remove all vestiges of dapls linked list implementation
Tom Duffy
Tom.Duffy at Sun.COM
Mon Jun 13 17:18:10 PDT 2005
Signed-off-by: Tom Duffy <tduffy at sun.com>
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_cno_util.c linux-kernel-ll10/dat-provider/dapl_cno_util.c
--- linux-kernel-ll9/dat-provider/dapl_cno_util.c 2005-06-02 13:23:50.481015000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_cno_util.c 2005-06-13 17:02:22.166004000 -0700
@@ -54,7 +54,6 @@ struct dapl_cno *dapl_cno_alloc(struct d
cno_ptr->common.owner_ia = ia_ptr;
cno_ptr->common.user_context.as_64 = 0;
cno_ptr->common.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&cno_ptr->common.ia_list_entry);
spin_lock_init(&cno_ptr->common.lock);
/*
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_cr.c linux-kernel-ll10/dat-provider/dapl_cr.c
--- linux-kernel-ll9/dat-provider/dapl_cr.c 2005-06-10 16:13:19.912031000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_cr.c 2005-06-13 17:02:01.638003000 -0700
@@ -54,7 +54,6 @@ struct dapl_cr *dapl_cr_alloc(struct dap
cr->cr.common.provider = ia->ia.common.provider;
cr->common.owner_ia = ia;
- dapl_llist_init_entry(&cr->common.ia_list_entry);
spin_lock_init(&cr->common.lock);
return cr;
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_ep.c linux-kernel-ll10/dat-provider/dapl_ep.c
--- linux-kernel-ll9/dat-provider/dapl_ep.c 2005-06-10 16:13:19.878004000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_ep.c 2005-06-13 17:02:26.352003000 -0700
@@ -70,7 +70,6 @@ struct dapl_ep *dapl_ep_alloc(struct dap
ep_ptr->ep.common.provider = ia_ptr->ia.common.provider;
ep_ptr->common.owner_ia = ia_ptr;
- dapl_llist_init_entry(&ep_ptr->common.ia_list_entry);
spin_lock_init(&ep_ptr->common.lock);
/*
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_ep_util.c linux-kernel-ll10/dat-provider/dapl_ep_util.c
--- linux-kernel-ll9/dat-provider/dapl_ep_util.c 2005-06-03 09:38:29.715962000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_ep_util.c 2005-06-13 17:02:29.294000000 -0700
@@ -67,7 +67,6 @@ struct dapl_ep *dapl_ep_alloc(struct dap
ep_ptr->common.owner_ia = ia_ptr;
ep_ptr->common.user_context.as_64 = 0;
ep_ptr->common.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&ep_ptr->common.ia_list_entry);
spin_lock_init(&ep_ptr->common.lock);
/*
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_evd.c linux-kernel-ll10/dat-provider/dapl_evd.c
--- linux-kernel-ll9/dat-provider/dapl_evd.c 2005-06-10 16:16:31.918002000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_evd.c 2005-06-13 17:02:34.929003000 -0700
@@ -159,7 +159,6 @@ struct dapl_evd *dapl_evd_alloc(struct d
evd->evd.common.provider = ia->ia.common.provider;
evd->common.owner_ia = ia;
- dapl_llist_init_entry(&evd->common.ia_list_entry);
spin_lock_init(&evd->common.lock);
/*
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_evd_util.c linux-kernel-ll10/dat-provider/dapl_evd_util.c
--- linux-kernel-ll9/dat-provider/dapl_evd_util.c 2005-06-02 13:48:19.237003000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_evd_util.c 2005-06-13 17:02:37.774000000 -0700
@@ -135,7 +135,6 @@ struct dapl_evd *dapl_evd_alloc(struct d
evd_ptr->common.owner_ia = ia_ptr;
evd_ptr->common.user_context.as_64 = 0;
evd_ptr->common.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&evd_ptr->common.ia_list_entry);
spin_lock_init(&evd_ptr->common.lock);
/*
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl.h linux-kernel-ll10/dat-provider/dapl.h
--- linux-kernel-ll9/dat-provider/dapl.h 2005-06-13 16:53:00.300010000 -0700
+++ linux-kernel-ll10/dat-provider/dapl.h 2005-06-13 17:01:22.766003000 -0700
@@ -92,13 +92,6 @@ typedef void *DAPL_HASH_DATA;
* *
*********************************************************************/
-struct dapl_llist_entry {
- struct dapl_llist_entry *flink;
- struct dapl_llist_entry *blink;
- void *data;
- struct dapl_llist_entry **list_head; /* for consistency checking */
-};
-
struct dapl_ring_buffer {
void **base; /* base of element array */
int lim; /* mask, number of entries - 1 */
@@ -141,7 +134,6 @@ struct dapl_hca {
/* DAPL Objects always have the following items */
struct dapl_common {
struct dapl_ia *owner_ia;
- struct dapl_llist_entry ia_list_entry;
spinlock_t lock;
unsigned long flags; /* saved lock flag values */
};
@@ -614,39 +606,4 @@ extern u32 dapl_srq_resize(struct dat_sr
extern u32 dapl_srq_set_lw(struct dat_srq *srq, int low_watermark);
-/*
- * DAPL internal utility function prototypes
- */
-
-extern void dapl_llist_init_head(struct dapl_llist_entry **head);
-
-extern void dapl_llist_init_entry(struct dapl_llist_entry *entry);
-
-extern boolean_t dapl_llist_is_empty(struct dapl_llist_entry **head);
-
-extern void dapl_llist_add_head(struct dapl_llist_entry **head,
- struct dapl_llist_entry *entry, void *data);
-
-extern void dapl_llist_add_tail(struct dapl_llist_entry **head,
- struct dapl_llist_entry *entry, void *data);
-
-extern void dapl_llist_add_entry(struct dapl_llist_entry **head,
- struct dapl_llist_entry *entry,
- struct dapl_llist_entry *new_entry,
- void *data);
-
-extern void *dapl_llist_remove_head(struct dapl_llist_entry **head);
-
-extern void *dapl_llist_remove_tail(struct dapl_llist_entry **head);
-
-extern void *dapl_llist_remove_entry(struct dapl_llist_entry **head,
- struct dapl_llist_entry *entry);
-
-extern void *dapl_llist_peek_head(struct dapl_llist_entry **head);
-
-extern void *dapl_llist_next_entry(struct dapl_llist_entry **head,
- struct dapl_llist_entry *cur_ent);
-
-extern void dapl_llist_debug_print_list(struct dapl_llist_entry **head);
-
#endif
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_ia.c linux-kernel-ll10/dat-provider/dapl_ia.c
--- linux-kernel-ll9/dat-provider/dapl_ia.c 2005-06-13 16:56:10.004000000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_ia.c 2005-06-13 17:02:40.414002000 -0700
@@ -53,7 +53,6 @@ struct dapl_ia *dapl_ia_alloc(struct dat
ia->ia.common.provider = provider;
ia->common.owner_ia = ia;
- dapl_llist_init_entry(&ia->common.ia_list_entry);
spin_lock_init(&ia->common.lock);
/*
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_llist.c linux-kernel-ll10/dat-provider/dapl_llist.c
--- linux-kernel-ll9/dat-provider/dapl_llist.c 2005-05-20 22:44:36.215051000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_llist.c 1969-12-31 16:00:00.000000000 -0800
@@ -1,321 +0,0 @@
-/*
- * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved.
- *
- * This Software is licensed under one of the following licenses:
- *
- * 1) under the terms of the "Common Public License 1.0" a copy of which is
- * available from the Open Source Initiative, see
- * http://www.opensource.org/licenses/cpl.php.
- *
- * 2) under the terms of the "The BSD License" a copy of which is
- * available from the Open Source Initiative, see
- * http://www.opensource.org/licenses/bsd-license.php.
- *
- * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
- * copy of which is available from the Open Source Initiative, see
- * http://www.opensource.org/licenses/gpl-license.php.
- *
- * Licensee has the right to choose one of the above licenses.
- *
- * Redistributions of source code must retain the above copyright
- * notice and one of the license notices.
- *
- * Redistributions in binary form must reproduce both the above copyright
- * notice, one of the license notices in the documentation
- * and/or other materials provided with the distribution.
- */
-
-/*
- * A link list head points to the first member of a linked list, but
- * is itself not a member of the list.
- *
- * +---------------------------------------------+
- * | entry entry entry |
- * HEAD -> | +-------+ +-------+ +-------+ |
- * +--> | flink | --> | flink | --> | flink | >--+
- * | data | | data | | data |
- * +--< | blink | <-- | blink | <-- | blink | <--|
- * | +-------+ +-------+ +-------+ |
- * | |
- * +---------------------------------------------+
- *
- * Note: Each of the remove functions takes an assertion failure if
- * an element cannot be removed from the list.
- *
- * $Id: dapl_llist.c 2433 2005-05-21 04:11:03Z jlentini $
- */
-
-#include "dapl.h"
-
-/*
- * dapl_llist_init_head()
- *
- * Purpose: initialize a linked list head
- */
-void dapl_llist_init_head(struct dapl_llist_entry **head)
-{
- *head = NULL;
-}
-
-/*
- * dapl_llist_init_entry()
- *
- * Purpose: initialize a linked list entry
- */
-void dapl_llist_init_entry(struct dapl_llist_entry *entry)
-{
- entry->blink = NULL;
- entry->flink = NULL;
- entry->data = NULL;
- entry->list_head = NULL;
-}
-
-/*
- * dapl_llist_is_empty()
- *
- * Purpose: returns TRUE if the linked list is empty
- */
-boolean_t dapl_llist_is_empty(struct dapl_llist_entry **head)
-{
- return (*head == NULL);
-}
-
-/*
- * dapl_llist_add_head()
- *
- * Purpose: Add an entry to the head of a linked list
- */
-void
-dapl_llist_add_head(struct dapl_llist_entry **head,
- struct dapl_llist_entry *entry, void *data)
-{
- struct dapl_llist_entry *first;
-
- /* deal with empty list */
- if (dapl_llist_is_empty(head)) {
- entry->flink = entry;
- entry->blink = entry;
- } else {
- first = *head;
- entry->flink = first;
- entry->blink = first->blink;
- first->blink->flink = entry;
- first->blink = entry;
- }
-
- *head = entry;
- entry->data = data;
- entry->list_head = head;
-}
-
-/*
- * dapl_llist_add_tail()
- *
- * Purpose: Add an entry to the tail of a linked list
- */
-void
-dapl_llist_add_tail(struct dapl_llist_entry **head,
- struct dapl_llist_entry *entry, void *data)
-{
- struct dapl_llist_entry *last;
-
- /* deal with empty list */
- if (dapl_llist_is_empty(head)) {
- *head = entry;
- entry->flink = entry;
- entry->blink = entry;
- } else {
- last = (*head)->blink;
- entry->flink = last->flink;
- entry->blink = last;
- last->flink->blink = entry;
- last->flink = entry;
- }
- entry->data = data;
- entry->list_head = head;
-}
-
-/*
- * dapl_llist_add_entry()
- *
- * Purpose: Add an entry before an element in the list. Does
- * not verify the list or the validity of the entries passed in.
- */
-void
-dapl_llist_add_entry(struct dapl_llist_entry **head,
- struct dapl_llist_entry *entry,
- struct dapl_llist_entry *new_entry, void *data)
-{
- struct dapl_llist_entry *first;
- struct dapl_llist_entry *prev;
-
- /* get the head pointer */
- first = *head;
-
- /* link the entry into the queue */
- prev = entry->blink;
- entry->blink = new_entry;
- prev->flink = new_entry;
-
- new_entry->flink = entry;
- new_entry->blink = prev;
-
- new_entry->data = data;
- new_entry->list_head = head;
-
- /* If the old entry was the head of the list, adjust */
- if (first == entry) {
- (*head) = new_entry;
- }
-
-}
-
-/*
- * dapl_llist_remove_head()
- *
- * Purpose: Remove the first entry of a linked list
- */
-void *dapl_llist_remove_head(struct dapl_llist_entry **head)
-{
- struct dapl_llist_entry *first;
-
- dapl_os_assert(!dapl_llist_is_empty(head));
- first = *head;
- *head = first->flink;
-
- first->flink->blink = first->blink;
- first->blink->flink = first->flink;
-
- if (first->flink == first) {
- *head = NULL;
- }
- /* clean up the links for good measure */
- first->flink = NULL;
- first->blink = NULL;
- first->list_head = NULL;
- return first->data;
-}
-
-/*
- * dapl_llist_remove_tail()
- *
- * Purpose: Remove the last entry of a linked list
- */
-void *dapl_llist_remove_tail(struct dapl_llist_entry **head)
-{
- struct dapl_llist_entry *last;
-
- dapl_os_assert(!dapl_llist_is_empty(head));
- last = (*head)->blink;
-
- last->blink->flink = last->flink;
- last->flink->blink = last->blink;
-
- if (last->flink == last) {
- *head = NULL;
- }
- /* clean up the links for good measure */
- last->flink = NULL;
- last->blink = NULL;
- last->list_head = NULL;
-
- return last->data;
-}
-
-/*
- * dapl_llist_remove_entry()
- *
- * Purpose: Remove the specified entry from a linked list
- */
-void *dapl_llist_remove_entry(struct dapl_llist_entry **head,
- struct dapl_llist_entry *entry)
-{
- struct dapl_llist_entry *first;
-
- dapl_os_assert(!dapl_llist_is_empty(head));
- first = *head;
-
- /* if it's the first entry, pull it off */
- if (first == entry) {
- (*head) = first->flink;
- /* if it was the only entry, kill the list */
- if (first->flink == first) {
- (*head) = NULL;
- }
- }
-
- dapl_os_assert(entry->list_head == head);
- entry->list_head = NULL;
-
- entry->flink->blink = entry->blink;
- entry->blink->flink = entry->flink;
- entry->flink = NULL;
- entry->blink = NULL;
-
- return entry->data;
-}
-
-/*
- * dapl_llist_peek_head
- */
-
-void *dapl_llist_peek_head(struct dapl_llist_entry **head)
-{
- struct dapl_llist_entry *first;
-
- dapl_os_assert(!dapl_llist_is_empty(head));
- first = *head;
- return first->data;
-}
-
-/*
- * dapl_llist_next_entry
- *
- * Obtain the next entry in the list, return NULL when we get to the
- * head
- */
-
-void *dapl_llist_next_entry(struct dapl_llist_entry **head,
- struct dapl_llist_entry *cur_ent)
-{
- struct dapl_llist_entry *next;
-
- dapl_os_assert(!dapl_llist_is_empty(head));
- if (cur_ent == NULL) {
- next = *head;
- } else {
- next = cur_ent->flink;
- if (next == *head) {
- return NULL;
- }
- }
- return next->data;
-}
-
-#ifdef DAPL_DBG
-/*
- * dapl_llist_debug_print_list()
- *
- * Purpose: Prints the linked list for debugging
- */
-void dapl_llist_debug_print_list(struct dapl_llist_entry **head)
-{
- struct dapl_llist_entry *entry;
- struct dapl_llist_entry *first;
- first = *head;
- if (!first) {
- dapl_dbg_log(DAPL_DBG_TYPE_UTIL, "EMPTY_LIST\n");
- return;
- }
- dapl_dbg_log(DAPL_DBG_TYPE_UTIL, "HEAD %p\n", *head);
- dapl_dbg_log(DAPL_DBG_TYPE_UTIL, "Entry %p %p %p %p\n",
- first, first->flink, first->blink, first->data);
- entry = first->flink;
- while (entry != first) {
- dapl_dbg_log(DAPL_DBG_TYPE_UTIL, "Entry %p %p %p %p\n",
- entry, entry->flink, entry->blink, entry->data);
- entry = entry->flink;
- }
-}
-
-#endif /* DAPL_DBG */
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_lmr.c linux-kernel-ll10/dat-provider/dapl_lmr.c
--- linux-kernel-ll9/dat-provider/dapl_lmr.c 2005-06-10 16:13:19.666059000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_lmr.c 2005-06-13 17:02:49.115001000 -0700
@@ -51,7 +51,6 @@ static struct dapl_lmr *dapl_lmr_alloc(s
lmr->lmr.common.provider = ia->ia.common.provider;
lmr->common.owner_ia = ia;
- dapl_llist_init_entry(&lmr->common.ia_list_entry);
dapl_ia_link_lmr(ia, lmr);
spin_lock_init(&lmr->common.lock);
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_pz.c linux-kernel-ll10/dat-provider/dapl_pz.c
--- linux-kernel-ll9/dat-provider/dapl_pz.c 2005-06-10 16:13:19.546018000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_pz.c 2005-06-13 17:02:54.055003000 -0700
@@ -46,7 +46,6 @@ static struct dapl_pz *dapl_pz_alloc(str
pz->pz.common.provider = ia->ia.common.provider;
pz->common.owner_ia = ia;
- dapl_llist_init_entry(&pz->common.ia_list_entry);
dapl_ia_link_pz(ia, pz);
spin_lock_init(&pz->common.lock);
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_rmr.c linux-kernel-ll10/dat-provider/dapl_rmr.c
--- linux-kernel-ll9/dat-provider/dapl_rmr.c 2005-06-10 16:13:19.832021000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_rmr.c 2005-06-13 17:02:57.553009000 -0700
@@ -63,7 +63,6 @@ static struct dapl_rmr *dapl_rmr_alloc(s
rmr->rmr.common.provider = pz->pz.common.provider;
rmr->common.owner_ia = pz->common.owner_ia;
- dapl_llist_init_entry(&rmr->common.ia_list_entry);
dapl_ia_link_rmr(rmr->common.owner_ia, rmr);
spin_lock_init(&rmr->common.lock);
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_sp.c linux-kernel-ll10/dat-provider/dapl_sp.c
--- linux-kernel-ll9/dat-provider/dapl_sp.c 2005-06-13 14:52:58.454000000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_sp.c 2005-06-13 17:03:00.514002000 -0700
@@ -54,7 +54,6 @@ struct dapl_sp *dapl_sp_alloc(struct dap
else
sp->sp.type = DAT_SP_TYPE_RSP;
sp->common.owner_ia = ia;
- dapl_llist_init_entry(&sp->common.ia_list_entry);
spin_lock_init(&sp->common.lock);
INIT_LIST_HEAD(&sp->cr_list);
diff -Nurp -X /home/tduffy/dontdiff linux-kernel-ll9/dat-provider/dapl_srq.c linux-kernel-ll10/dat-provider/dapl_srq.c
--- linux-kernel-ll9/dat-provider/dapl_srq.c 2005-06-10 10:49:26.886965000 -0700
+++ linux-kernel-ll10/dat-provider/dapl_srq.c 2005-06-13 17:03:05.631006000 -0700
@@ -90,8 +90,6 @@ static struct dapl_srq *dapl_srq_alloc(s
srq_ptr->srq.common.provider = ia_ptr->ia.common.provider;
srq_ptr->common.owner_ia = ia_ptr;
atomic_set(&srq_ptr->srq_ref_count, 0);
-
- dapl_llist_init_entry(&srq_ptr->common.ia_list_entry);
spin_lock_init(&srq_ptr->common.lock);
/*
Index: linux-kernel-ll10/dat-provider/Makefile
===================================================================
--- linux-kernel-ll10/dat-provider/Makefile (revision 2595)
+++ linux-kernel-ll10/dat-provider/Makefile (working copy)
@@ -24,7 +24,6 @@ PROVIDER_MODULES := \
dapl_hash \
dapl_hca_util \
dapl_ia \
- dapl_llist \
dapl_lmr \
dapl_mr_util \
dapl_provider \
More information about the general
mailing list