1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-ib: Make infiniband transport compile again

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 <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2014-05-28 10:40:29 +10:00 committed by Amitay Isaacs
parent a27e59e8ec
commit f2ef23cd5f
5 changed files with 12 additions and 10 deletions

View File

@ -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

View File

@ -1,4 +1,4 @@
AC_ARG_ENABLE(--enable-infiniband,
AC_ARG_ENABLE(infiniband,
[ --enable-infiniband Turn on infiniband support (default=no)])
HAVE_INFINIBAND=no

View File

@ -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;i<ctdb->num_nodes;i++) {

View File

@ -34,7 +34,6 @@
#include <unistd.h>
#include "includes.h"
#include "lib/events/events.h"
#include "ibwrapper.h"
#include <infiniband/kern-abi.h>
@ -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;
}

View File

@ -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]) {