From: Volker Lendecke Date: Tue, 25 Jul 2017 15:10:27 +0000 (+0200) Subject: messaging: Always register CTDB_SRVID_SAMBA_PROCESS X-Git-Tag: talloc-2.1.11~294 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2fdde4a07a4e7f28cd9cbd0ac9a0bae3fa748522;p=thirdparty%2Fsamba.git messaging: Always register CTDB_SRVID_SAMBA_PROCESS This will be used to broadcast to all processes, avoiding the costly traverse of serverid.tdb. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/include/ctdb_srvids.h b/source3/include/ctdb_srvids.h index 500b5069e67..b51a4585060 100644 --- a/source3/include/ctdb_srvids.h +++ b/source3/include/ctdb_srvids.h @@ -38,3 +38,9 @@ * locally according to the non-clustered local notify.tdb */ #define CTDB_SRVID_SAMBA_NOTIFY_PROXY 0xFE00000000000001LL + +/* + * SRVID for all processes that come from Samba. Used to be + * MSG_SRVID_SAMBA in the past. Now used for message_send_all. + */ +#define CTDB_SRVID_SAMBA_PROCESS 0xFE00000000000002LL diff --git a/source3/lib/messages_ctdb.c b/source3/lib/messages_ctdb.c index a2a7c215f23..66b9f55d256 100644 --- a/source3/lib/messages_ctdb.c +++ b/source3/lib/messages_ctdb.c @@ -26,6 +26,7 @@ #include "lib/messages_util.h" #include "ctdbd_conn.h" #include "lib/cluster_support.h" +#include "ctdb_srvids.h" struct messaging_ctdb_context; @@ -111,6 +112,14 @@ int messaging_ctdb_init(const char *sockname, int timeout, uint64_t unique_id, goto fail; } + ret = register_with_ctdbd(ctx->conn, CTDB_SRVID_SAMBA_PROCESS, + messaging_ctdb_recv, ctx); + if (ret != 0) { + DBG_DEBUG("register_with_ctdbd returned %s (%d)\n", + strerror(ret), ret); + goto fail; + } + ret = register_with_ctdbd(ctx->conn, unique_id, NULL, NULL); if (ret != 0) { DBG_DEBUG("register_with_ctdbd returned %s (%d)\n",