summaryrefslogtreecommitdiff
path: root/source3
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
parente93b85dbd871d5d56a7bc13235820c488a41266f (diff)
downloadsamba-74b359c61686c1a940ec76ad4459fabc403a8715.tar.gz
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')
-rw-r--r--source3/include/messages.h4
-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
-rw-r--r--source3/smbd/process.c7
-rw-r--r--source3/smbd/server.c2
-rw-r--r--source3/wscript2
9 files changed, 3 insertions, 35 deletions
diff --git a/source3/include/messages.h b/source3/include/messages.h
index 566691157b8..d7a28538cdd 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -60,11 +60,7 @@
#include "librpc/gen_ndr/server_id.h"
-#ifdef CLUSTER_SUPPORT
#define MSG_BROADCAST_PID_STR "0:0"
-#else
-#define MSG_BROADCAST_PID_STR "0"
-#endif
struct messaging_context;
struct messaging_rec;
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;
}
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 9457000f405..df64c8270cb 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2499,8 +2499,6 @@ static void smbd_server_echo_handler(struct tevent_context *ev,
}
}
-#ifdef CLUSTER_SUPPORT
-
struct smbd_release_ip_state {
struct smbd_server_connection *sconn;
struct tevent_immediate *im;
@@ -2627,7 +2625,6 @@ static int client_get_tcp_info(int sock, struct sockaddr_storage *server,
}
return 0;
}
-#endif
static void msg_kill_client_ip(struct messaging_context *msg_ctx,
void *private_data, uint32_t msg_type,
@@ -3661,8 +3658,6 @@ void smbd_process(struct tevent_context *ev_ctx,
exit(1);
}
-#ifdef CLUSTER_SUPPORT
-
if (lp_clustering()) {
/*
* We need to tell ctdb about our client's TCP
@@ -3689,8 +3684,6 @@ void smbd_process(struct tevent_context *ev_ctx,
}
}
-#endif
-
sconn->nbt.got_session = false;
tmp = lp_max_xmit();
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 61ea17c825f..9d6a250752b 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -912,11 +912,9 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
messaging_register(msg_ctx, NULL,
ID_CACHE_KILL, smbd_parent_id_cache_kill);
-#ifdef CLUSTER_SUPPORT
if (lp_clustering()) {
ctdbd_register_reconfigure(messaging_ctdbd_connection());
}
-#endif
#ifdef DEVELOPER
messaging_register(msg_ctx, NULL, MSG_SMB_INJECT_FAULT,
diff --git a/source3/wscript b/source3/wscript
index e6d2bb32357..4fe49fabb76 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1713,7 +1713,6 @@ main() {
conf.undefine('HAVE_CTDB_CHECK_CODE')
if have_cluster_support:
Logs.info("building with cluster support")
- conf.DEFINE('CLUSTER_SUPPORT', 1);
conf.env['CTDB_CFLAGS'] = CTDB_CFLAGS
else:
if Options.options.with_cluster_support == False:
@@ -1724,7 +1723,6 @@ main() {
else:
Logs.info("building without cluster support: " + ctdb_broken)
conf.env['CTDB_CFLAGS'] = ''
- conf.undefine('CLUSTER_SUPPORT')
conf.CHECK_CODE('__attribute__((destructor)) static void cleanup(void) { }',