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
#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;
#ifdef HAVE_CTDB_H
#include <ctdb.h>
+#define CLUSTER_SUPPORT 1
#endif
#ifdef HAVE_CTDB_PROTOCOL_H
bool db_is_local(const char *name)
{
-#ifdef CLUSTER_SUPPORT
const char *sockname = lp_ctdbd_socket();
if (lp_clustering() && socket_exist(sockname)) {
return false;
}
}
-#endif
+
return true;
}
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;
}
}
-#ifdef CLUSTER_SUPPORT
sockname = lp_ctdbd_socket();
if (lp_clustering()) {
}
}
-#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,
return NULL;
}
-#ifdef CLUSTER_SUPPORT
if (lp_clustering()) {
status = messaging_ctdbd_init(ctx, ctx, &ctx->remote);
}
}
ctx->id.vnn = get_my_vnn();
-#endif
messaging_register(ctx, NULL, MSG_PING, ping_message);
return status;
}
-#ifdef CLUSTER_SUPPORT
TALLOC_FREE(msg_ctx->remote);
if (lp_clustering()) {
}
}
-#endif
-
return NT_STATUS_OK;
}
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;
remote_num += 1;
}
-#ifdef CLUSTER_SUPPORT
if (remote_num != 0 &&
ctdb_serverids_exist_supported(messaging_ctdbd_connection()))
{
results[idx] = todo_results[t];
}
}
-#endif
if (remote_num != 0) {
todo_num = 0;
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];
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;
}
}
}
-#ifdef CLUSTER_SUPPORT
-
struct smbd_release_ip_state {
struct smbd_server_connection *sconn;
struct tevent_immediate *im;
}
return 0;
}
-#endif
static void msg_kill_client_ip(struct messaging_context *msg_ctx,
void *private_data, uint32_t msg_type,
exit(1);
}
-#ifdef CLUSTER_SUPPORT
-
if (lp_clustering()) {
/*
* We need to tell ctdb about our client's TCP
}
}
-#endif
-
sconn->nbt.got_session = false;
tmp = lp_max_xmit();
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,
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:
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) { }',