From f2ef23cd5f227d2da2f032a2a56fbdd4d105b137 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Wed, 28 May 2014 10:40:29 +1000 Subject: ctdb-ib: Make infiniband transport compile again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update included header files and fix compilation warnings. ib/ibwrapper.c: In function ‘ibw_stop’: ib/ibwrapper.c:1015:17: warning: comparison between ‘enum ibw_state_ctx’ and ‘enum ibw_state_conn’ [-Wenum-compare] if (ctx->state==IBWC_ERROR || ctx->state==IBWC_CONNECTED) { ^ ib/ibwrapper.c:1015:43: warning: comparison between ‘enum ibw_state_ctx’ and ‘enum ibw_state_conn’ [-Wenum-compare] if (ctx->state==IBWC_ERROR || ctx->state==IBWC_CONNECTED) { The current logic just seems wrong. The context of this line and the error checking in ibw_disconnect() suggest that these comparisons should use p->state rather than ctx->state, so do that. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- ctdb/Makefile.in | 12 +++++++----- ctdb/ib/config.m4 | 2 +- ctdb/ib/ibw_ctdb_init.c | 3 ++- ctdb/ib/ibwrapper.c | 3 +-- ctdb/ib/ibwrapper_test.c | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) (limited to 'ctdb') diff --git a/ctdb/Makefile.in b/ctdb/Makefile.in index f3cd70c3bdb..0843a9653b8 100755 --- a/ctdb/Makefile.in +++ b/ctdb/Makefile.in @@ -92,6 +92,8 @@ CTDB_COMMON_OBJ = common/ctdb_io.o common/ctdb_util.o \ CTDB_TCP_OBJ = tcp/tcp_connect.o tcp/tcp_io.o tcp/tcp_init.o +CTDB_IB_OBJ = @INFINIBAND_WRAPPER_OBJ@ + CTDB_EXTERNAL_OBJ = $(POPT_OBJ) $(TALLOC_OBJ) $(TDB_OBJ) \ $(REPLACE_OBJ) $(EXTRA_OBJ) $(TEVENT_OBJ) $(SOCKET_WRAPPER_OBJ) @@ -107,7 +109,7 @@ CTDB_SERVER_OBJ = server/ctdbd.o server/ctdb_daemon.o \ server/ctdb_keepalive.o server/ctdb_logging.o server/ctdb_uptime.o \ server/ctdb_vacuum.o server/ctdb_banning.o server/ctdb_statistics.o \ server/ctdb_update_record.o server/ctdb_lock.o \ - $(CTDB_CLIENT_OBJ) $(CTDB_TCP_OBJ) @INFINIBAND_WRAPPER_OBJ@ + $(CTDB_CLIENT_OBJ) $(CTDB_TCP_OBJ) $(CTDB_IB_OBJ) TEST_BINS=tests/bin/ctdb_bench tests/bin/ctdb_fetch tests/bin/ctdb_fetch_one \ tests/bin/ctdb_fetch_readonly_once tests/bin/ctdb_fetch_readonly_loop \ @@ -282,9 +284,9 @@ CTDB_TEST_OBJ = $(TALLOC_OBJ) $(TDB_OBJ) \ tests/src/ctdb_takeover_tests.o: tests/src/ctdb_takeover_tests.c $(CTDBD_TEST_C) -tests/bin/ctdb_takeover_tests: $(CTDB_TEST_OBJ) tests/src/ctdb_takeover_tests.o +tests/bin/ctdb_takeover_tests: $(CTDB_TEST_OBJ) tests/src/ctdb_takeover_tests.o $(CTDB_IB_OBJ) @echo Linking $@ - $(WRAPPER) $(CC) $(CFLAGS) -o $@ tests/src/ctdb_takeover_tests.o $(CTDB_TEST_OBJ) $(LIB_FLAGS) + $(WRAPPER) $(CC) $(CFLAGS) -o $@ tests/src/ctdb_takeover_tests.o $(CTDB_IB_OBJ) $(CTDB_TEST_OBJ) $(LIB_FLAGS) tests/src/ctdb_functest.o: tests/src/ctdb_functest.c tests/src/ctdb_test.c $(CTDB_TEST_C) @@ -302,9 +304,9 @@ tests/bin/ctdb_lock_tdb: tests/src/ctdb_lock_tdb.o $(CTDB_CLIENT_OBJ) @echo Linking $@ $(WRAPPER) $(CC) $(CFLAGS) -o $@ $^ $(LIB_FLAGS) -tests/bin/ibwrapper_test: $(CTDB_CLIENT_OBJ) ib/ibwrapper_test.o +tests/bin/ibwrapper_test: $(CTDB_CLIENT_OBJ) ib/ibwrapper_test.o $(CTDB_IB_OBJ) @echo Linking $@ - $(WRAPPER) $(CC) $(CFLAGS) -o $@ ib/ibwrapper_test.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS) + $(WRAPPER) $(CC) $(CFLAGS) -o $@ ib/ibwrapper_test.o $(CTDB_CLIENT_OBJ) $(CTDB_IB_OBJ) $(LIB_FLAGS) manpages: $(MAKE) -C doc diff --git a/ctdb/ib/config.m4 b/ctdb/ib/config.m4 index 47d6facd34f..6c626bdc7fe 100644 --- a/ctdb/ib/config.m4 +++ b/ctdb/ib/config.m4 @@ -1,4 +1,4 @@ -AC_ARG_ENABLE(--enable-infiniband, +AC_ARG_ENABLE(infiniband, [ --enable-infiniband Turn on infiniband support (default=no)]) HAVE_INFINIBAND=no diff --git a/ctdb/ib/ibw_ctdb_init.c b/ctdb/ib/ibw_ctdb_init.c index 066814d12ff..63deff28430 100644 --- a/ctdb/ib/ibw_ctdb_init.c +++ b/ctdb/ib/ibw_ctdb_init.c @@ -26,6 +26,7 @@ #include "ctdb_private.h" #include "ibwrapper.h" #include "ibw_ctdb.h" +#include "lib/util/dlinklist.h" static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog) { @@ -99,7 +100,7 @@ static int ctdb_ibw_initialise(struct ctdb_context *ctdb) */ static int ctdb_ibw_start(struct ctdb_context *ctdb) { - int i, ret; + int i; /* everything async here */ for (i=0;inum_nodes;i++) { diff --git a/ctdb/ib/ibwrapper.c b/ctdb/ib/ibwrapper.c index f6e71687f32..3daab3e3c72 100644 --- a/ctdb/ib/ibwrapper.c +++ b/ctdb/ib/ibwrapper.c @@ -34,7 +34,6 @@ #include #include "includes.h" -#include "lib/events/events.h" #include "ibwrapper.h" #include @@ -1013,7 +1012,7 @@ int ibw_stop(struct ibw_ctx *ctx) DEBUG(DEBUG_DEBUG, ("ibw_stop\n")); for(p=ctx->conn_list; p!=NULL; p=p->next) { - if (ctx->state==IBWC_ERROR || ctx->state==IBWC_CONNECTED) { + if (p->state==IBWC_ERROR || p->state==IBWC_CONNECTED) { if (ibw_disconnect(p)) return -1; } diff --git a/ctdb/ib/ibwrapper_test.c b/ctdb/ib/ibwrapper_test.c index ba54286ace6..48162c328a6 100644 --- a/ctdb/ib/ibwrapper_test.c +++ b/ctdb/ib/ibwrapper_test.c @@ -325,7 +325,7 @@ int ibwtest_receive_handler(struct ibw_conn *conn, void *buf, int n) n - sizeof(uint32_t) - 2); DEBUG(DEBUG_DEBUG, ("[%d]msg varsize %u/sum %u from %s\n", op, - n - sizeof(uint32_t) - 2, + (uint32_t)(n - sizeof(uint32_t) - 2), (uint32_t)sum, tconn->id ? tconn->id : "NULL")); if (sum!=((unsigned char *)buf)[n-1]) { -- cgit