]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Using samba DLIST helper macro set.
authorPeter Somogyi <psomogyi@gamax.hu>
Tue, 5 Dec 2006 12:09:48 +0000 (13:09 +0100)
committerPeter Somogyi <psomogyi@gamax.hu>
Tue, 5 Dec 2006 12:09:48 +0000 (13:09 +0100)
(This used to be ctdb commit 1ed174dd02428748b8273a91c8d0d335795f12c3)

1  2 
ctdb/ib/ibwrapper.c
ctdb/ib/ibwrapper.h

index 9778b4e04196e43a7ab8f7d0bff848152586abd3,9778b4e04196e43a7ab8f7d0bff848152586abd3..338afb1096d7e6542221b882075b003a90524e28
@@@ -37,7 -37,7 +37,7 @@@
  #include "lib/events/events.h"
  
  #include "ibwrapper_internal.h"
--
++#include "lib/util/dlinklist.h"
  
  #define IBW_LASTERR_BUFSIZE 512
  static char ibw_lasterr[IBW_LASTERR_BUFSIZE];
@@@ -93,23 -93,23 +93,7 @@@ static int ibw_conn_destruct(void *ptr
        ctx = ibw_conn->ctx;
        assert(ctx!=NULL);
  
--      /* unhook conn from ctx's linked list */
--      assert(ctx->first_conn!=NULL);
--      assert(ctx->last_conn!=NULL);
--
--      if (conn->prev==NULL) {
--              assert(ctx->first_conn==conn);
--              ctx->first_conn = conn->next;
--      } else {
--              conn->prev->next = conn->next;
--      }
--
--      if (conn->next==NULL) {
--              assert(ctx->last_conn==conn);
--              ctx->last_conn = conn->prev;
--      } else {
--              conn->next->prev = conn->prev;
--      }
++      DLIST_REMOVE(ctx->conn_list, conn);
        return 0;
  }
  
@@@ -128,15 -128,15 +112,7 @@@ static ibw_conn *ibw_new_conn(ibw_ctx *
  
        conn->ctx = ctx;
  
--      /* append conn to the end of ctx's linked list */
--      conn->prev = ctx->last_conn;
--      conn->next = NULL;
--      if (ctx->first_conn) {
--              assert(ctx->last_conn!=NULL);
--              conn->prev->next = conn;
--      } else {
--              ctx->first_conn = ctx->last_conn = conn;
--      }
++      DLIST_ADD(ctx->conn_list, conn);
  
        return conn;
  }
index c5ca0272cc9bed998e71a87949eb240727c6ce4b,c5ca0272cc9bed998e71a87949eb240727c6ce4b..6f646a4a08ea5e8f9903ffd077d88025725e695e
@@@ -38,7 -38,7 +38,7 @@@ typedef struct _ibw_ctx 
        ibw_state_ctx state;
        void *internal;
  
--      ibw_conn *first_conn, *last_conn;
++      ibw_conn *conn_list; /* 1st elem of double linked list */
  } ibw_ctx;
  
  typedef enum {