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

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
This commit is contained in:
Stefan Metzmacher 2014-01-21 14:34:48 +01:00 committed by Michael Adam
parent e93b85dbd8
commit 74b359c616
9 changed files with 3 additions and 35 deletions

View File

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

View File

@ -22,6 +22,7 @@
#ifdef HAVE_CTDB_H
#include <ctdb.h>
#define CLUSTER_SUPPORT 1
#endif
#ifdef HAVE_CTDB_PROTOCOL_H

View File

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

View File

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

View File

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

View File

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

View File

@ -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();

View File

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

View File

@ -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) { }',