From 74b359c61686c1a940ec76ad4459fabc403a8715 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 21 Jan 2014 14:34:48 +0100 Subject: [PATCH] s3:build: remove global CLUSTER_SUPPORT define All ctdb specific code is isolated in samba-cluster-support.so now. Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Mon Mar 24 19:08:44 CET 2014 on sn-devel-104 --- source3/include/messages.h | 4 ---- source3/lib/cluster_support.c | 1 + source3/lib/dbwrap/dbwrap_open.c | 8 +------- source3/lib/messages.c | 7 ------- source3/lib/serverid.c | 4 ---- source3/lib/smbconf/smbconf_reg.c | 3 +-- source3/smbd/process.c | 7 ------- source3/smbd/server.c | 2 -- source3/wscript | 2 -- 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 +#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; tnbt.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) { }',