summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-21 14:34:48 +0100
committerMichael Adam <obnox@samba.org>2014-03-24 19:08:44 +0100
commit74b359c61686c1a940ec76ad4459fabc403a8715 (patch)
treef5db71b9c25ef2e8e75c569b72441a57cd396df0 /source3/lib
parente93b85dbd871d5d56a7bc13235820c488a41266f (diff)
downloadsamba-74b359c61686c1a940ec76ad4459fabc403a8715.tar.gz
samba-74b359c61686c1a940ec76ad4459fabc403a8715.tar.xz
samba-74b359c61686c1a940ec76ad4459fabc403a8715.zip
s3:build: remove global CLUSTER_SUPPORT define
All ctdb specific code is isolated in samba-cluster-support.so now. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Mon Mar 24 19:08:44 CET 2014 on sn-devel-104
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/cluster_support.c1
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c8
-rw-r--r--source3/lib/messages.c7
-rw-r--r--source3/lib/serverid.c4
-rw-r--r--source3/lib/smbconf/smbconf_reg.c3
5 files changed, 3 insertions, 20 deletions
diff --git a/source3/lib/cluster_support.c b/source3/lib/cluster_support.c
index 464236748b4..d6605fd3e21 100644
--- a/source3/lib/cluster_support.c
+++ b/source3/lib/cluster_support.c
@@ -22,6 +22,7 @@
#ifdef HAVE_CTDB_H
#include <ctdb.h>
+#define CLUSTER_SUPPORT 1
#endif
#ifdef HAVE_CTDB_PROTOCOL_H
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 021ebc3980f..81f20b048d5 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -30,7 +30,6 @@
bool db_is_local(const char *name)
{
-#ifdef CLUSTER_SUPPORT
const char *sockname = lp_ctdbd_socket();
if (lp_clustering() && socket_exist(sockname)) {
@@ -47,7 +46,7 @@ bool db_is_local(const char *name)
return false;
}
}
-#endif
+
return true;
}
@@ -62,9 +61,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
uint64_t dbwrap_flags)
{
struct db_context *result = NULL;
-#ifdef CLUSTER_SUPPORT
const char *sockname;
-#endif
if (!DBWRAP_LOCK_ORDER_VALID(lock_order)) {
errno = EINVAL;
@@ -96,7 +93,6 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
}
}
-#ifdef CLUSTER_SUPPORT
sockname = lp_ctdbd_socket();
if (lp_clustering()) {
@@ -131,8 +127,6 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
}
}
-#endif
-
if (result == NULL) {
struct loadparm_context *lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_helpers());
result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 58f45d3b1cf..96b6b88a808 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -206,7 +206,6 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
return NULL;
}
-#ifdef CLUSTER_SUPPORT
if (lp_clustering()) {
status = messaging_ctdbd_init(ctx, ctx, &ctx->remote);
@@ -218,7 +217,6 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
}
}
ctx->id.vnn = get_my_vnn();
-#endif
messaging_register(ctx, NULL, MSG_PING, ping_message);
@@ -254,7 +252,6 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
return status;
}
-#ifdef CLUSTER_SUPPORT
TALLOC_FREE(msg_ctx->remote);
if (lp_clustering()) {
@@ -268,8 +265,6 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
}
}
-#endif
-
return NT_STATUS_OK;
}
@@ -365,13 +360,11 @@ NTSTATUS messaging_send(struct messaging_context *msg_ctx,
return NT_STATUS_INVALID_PARAMETER_MIX;
}
-#ifdef CLUSTER_SUPPORT
if (!procid_is_local(&server)) {
return msg_ctx->remote->send_fn(msg_ctx, server,
msg_type, data,
msg_ctx->remote);
}
-#endif
if (server_id_equal(&msg_ctx->id, &server)) {
struct messaging_selfsend_state *state;
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index b69671e4221..5d5981825d0 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -343,7 +343,6 @@ bool serverids_exist(const struct server_id *ids, int num_ids, bool *results)
remote_num += 1;
}
-#ifdef CLUSTER_SUPPORT
if (remote_num != 0 &&
ctdb_serverids_exist_supported(messaging_ctdbd_connection()))
{
@@ -388,7 +387,6 @@ bool serverids_exist(const struct server_id *ids, int num_ids, bool *results)
results[idx] = todo_results[t];
}
}
-#endif
if (remote_num != 0) {
todo_num = 0;
@@ -401,13 +399,11 @@ bool serverids_exist(const struct server_id *ids, int num_ids, bool *results)
todo_num += 1;
}
-#ifdef CLUSTER_SUPPORT
if (!ctdb_processes_exist(messaging_ctdbd_connection(),
todo_ids, todo_num,
todo_results)) {
goto fail;
}
-#endif
for (t=0; t<todo_num; t++) {
idx = todo_idx[t];
diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c
index ac6b84d1f58..bc878cc5d21 100644
--- a/source3/lib/smbconf/smbconf_reg.c
+++ b/source3/lib/smbconf/smbconf_reg.c
@@ -657,11 +657,10 @@ static int smbconf_reg_shutdown(struct smbconf_ctx *ctx)
static bool smbconf_reg_requires_messaging(struct smbconf_ctx *ctx)
{
-#ifdef CLUSTER_SUPPORT
if (lp_clustering() && lp_parm_bool(-1, "ctdb", "registry.tdb", true)) {
return true;
}
-#endif
+
return false;
}