ctdb_conn: Use messaging_ctdb_connection
authorVolker Lendecke <vl@samba.org>
Fri, 16 Jun 2017 11:00:59 +0000 (13:00 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 25 Jul 2017 15:43:18 +0000 (17:43 +0200)
Replace messaging_ctdbd_connection

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/lib/ctdb_dummy.c
source3/lib/dbwrap/dbwrap_ctdb.c
source3/lib/dbwrap/dbwrap_open.c
source3/lib/serverid.c
source3/smbd/notifyd/notifydd.c
source3/smbd/process.c
source3/smbd/server.c
source3/torture/test_dbwrap_ctdb.c
source3/wscript_build

index 891e7c33dc5824bb1da661818f8bf29fa05a7a4c..f301c1f5f1b8c5e5a75cd34ecacbe47fc05efa22 100644 (file)
@@ -135,7 +135,7 @@ struct messaging_ctdbd_fde *messaging_ctdbd_register_tevent_context(
        return NULL;
 }
 
-struct ctdbd_connection *messaging_ctdbd_connection(void)
+struct ctdbd_connection *messaging_ctdb_connection(void)
 {
        return NULL;
 }
index b81c1321d7259e2e50a35e4cdeaee05edb4a0fed..25db140583fe851bf8da74ca8f78291740aeefc7 100644 (file)
@@ -34,7 +34,7 @@
 #include "dbwrap/dbwrap_ctdb.h"
 #include "g_lock.h"
 #include "messages.h"
-#include "messages_ctdbd.h"
+#include "messages_ctdb.h"
 #include "lib/cluster_support.h"
 #include "lib/util/tevent_ntstatus.h"
 
@@ -821,7 +821,7 @@ static int db_ctdb_transaction_commit(struct db_context *db)
 
 again:
        /* tell ctdbd to commit to the other nodes */
-       ret = ctdbd_control_local(messaging_ctdbd_connection(),
+       ret = ctdbd_control_local(messaging_ctdb_connection(),
                                  CTDB_CONTROL_TRANS3_COMMIT,
                                  h->ctx->db_id, 0,
                                  db_ctdb_marshall_finish(h->m_write),
@@ -938,7 +938,7 @@ static NTSTATUS db_ctdb_send_schedule_for_deletion(struct db_record *rec)
        dd->keylen = rec->key.dsize;
        memcpy(dd->key, rec->key.dptr, rec->key.dsize);
 
-       ret = ctdbd_control_local(messaging_ctdbd_connection(),
+       ret = ctdbd_control_local(messaging_ctdb_connection(),
                                  CTDB_CONTROL_SCHEDULE_FOR_DELETION,
                                  crec->ctdb_ctx->db_id,
                                  CTDB_CTRL_FLAG_NOREPLY, /* flags */
@@ -1176,7 +1176,7 @@ again:
                           ((struct ctdb_ltdb_header *)ctdb_data.dptr)->flags : 0));
 
                GetTimeOfDay(&ctdb_start_time);
-               ret = ctdbd_migrate(messaging_ctdbd_connection(), ctx->db_id,
+               ret = ctdbd_migrate(messaging_ctdb_connection(), ctx->db_id,
                                    key);
                ctdb_time += timeval_elapsed(&ctdb_start_time);
 
@@ -1405,7 +1405,7 @@ static NTSTATUS db_ctdb_parse_record(struct db_context *db, TDB_DATA key,
                return status;
        }
 
-       ret = ctdbd_parse(messaging_ctdbd_connection(), ctx->db_id, key,
+       ret = ctdbd_parse(messaging_ctdb_connection(), ctx->db_id, key,
                          state.ask_for_readonly_copy, parser, private_data);
        if (ret != 0) {
                if (ret == ENOENT) {
@@ -1828,7 +1828,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
        db_ctdb->transaction = NULL;
        db_ctdb->db = result;
 
-       ret = ctdbd_db_attach(messaging_ctdbd_connection(), name,
+       ret = ctdbd_db_attach(messaging_ctdb_connection(), name,
                              &db_ctdb->db_id, persistent);
        if (ret != 0) {
                DEBUG(0, ("ctdbd_db_attach failed for %s: %s\n", name,
@@ -1841,7 +1841,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
                data.dptr = (uint8_t *)&db_ctdb->db_id;
                data.dsize = sizeof(db_ctdb->db_id);
 
-               ret = ctdbd_control_local(messaging_ctdbd_connection(),
+               ret = ctdbd_control_local(messaging_ctdb_connection(),
                                          CTDB_CONTROL_ENABLE_SEQNUM,
                                          0, 0, data,
                                          NULL, NULL, &cstatus);
@@ -1853,7 +1853,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
                }
        }
 
-       db_path = ctdbd_dbpath(messaging_ctdbd_connection(), db_ctdb,
+       db_path = ctdbd_dbpath(messaging_ctdb_connection(), db_ctdb,
                               db_ctdb->db_id);
 
        result->persistent = persistent;
@@ -1862,7 +1862,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
        data.dptr = (uint8_t *)&db_ctdb->db_id;
        data.dsize = sizeof(db_ctdb->db_id);
 
-       ret = ctdbd_control_local(messaging_ctdbd_connection(),
+       ret = ctdbd_control_local(messaging_ctdb_connection(),
                                  CTDB_CONTROL_DB_OPEN_FLAGS,
                                  0, 0, data, NULL, &data, &cstatus);
        if (ret != 0) {
@@ -1898,7 +1898,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
                                       sizeof(db_ctdb->db_id));
 
                ret = ctdbd_control_local(
-                       messaging_ctdbd_connection(),
+                       messaging_ctdb_connection(),
                        CTDB_CONTROL_SET_DB_READONLY, 0, 0,
                        indata, NULL, NULL, &cstatus);
                if ((ret != 0) || (cstatus != 0)) {
index 6ecf8565abd277c28c1046a1f9000c038530476e..a6bf30f0ae78bbd1086830c9f5cf6db708c291bd 100644 (file)
@@ -26,7 +26,7 @@
 #include "dbwrap/dbwrap_ctdb.h"
 #include "lib/param/param.h"
 #include "lib/cluster_support.h"
-#include "lib/messages_ctdbd.h"
+#include "lib/messages_ctdb.h"
 #include "util_tdb.h"
 #include "ctdbd_conn.h"
 #include "messages.h"
@@ -148,7 +148,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
                        struct messaging_context *msg_ctx;
                        struct ctdbd_connection *conn;
 
-                       conn = messaging_ctdbd_connection();
+                       conn = messaging_ctdb_connection();
                        if (conn == NULL) {
                                DBG_WARNING("No ctdb connection\n");
                                errno = EIO;
index fb32526fa6bc6838d19317110d1f572144fdf24a..ca4bb27180705321eb3a8ef94a434f6f394bcef5 100644 (file)
@@ -28,7 +28,7 @@
 #include "lib/param/param.h"
 #include "ctdbd_conn.h"
 #include "messages.h"
-#include "lib/messages_ctdbd.h"
+#include "lib/messages_ctdb.h"
 #include "lib/messages_dgm.h"
 
 struct serverid_key {
@@ -124,7 +124,7 @@ bool serverid_register(const struct server_id id, uint32_t msg_flags)
        }
 
        if (lp_clustering()) {
-               register_with_ctdbd(messaging_ctdbd_connection(), id.unique_id,
+               register_with_ctdbd(messaging_ctdb_connection(), id.unique_id,
                                    NULL, NULL);
        }
 
@@ -198,7 +198,7 @@ bool serverid_exists(const struct server_id *id)
        }
 
        if (lp_clustering()) {
-               return ctdbd_process_exists(messaging_ctdbd_connection(),
+               return ctdbd_process_exists(messaging_ctdb_connection(),
                                            id->vnn, id->pid);
        }
 
index ad3621a942c87bf0ce31a35064277599949668e5..faad4e73f3eaa8b7ab058bb554a3f8773ff2bd8c 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "replace.h"
 #include "notifyd.h"
-#include "lib/messages_ctdbd.h"
+#include "lib/messages_ctdb.h"
 #include <tevent.h>
 #include "lib/util/tevent_unix.h"
 
@@ -59,7 +59,7 @@ int main(int argc, const char *argv[])
                return 1;
        }
 
-       req = notifyd_send(ev, ev, msg, messaging_ctdbd_connection(),
+       req = notifyd_send(ev, ev, msg, messaging_ctdb_connection(),
                           NULL, NULL);
        if (req == NULL) {
                fprintf(stderr, "notifyd_send failed\n");
index 7de26f1388d433627eab54bf1ea8cac745780bd4..b65ae2c1b1c0e505813e01173a1e9d48ecadde71 100644 (file)
@@ -32,7 +32,7 @@
 #include "passdb.h"
 #include "auth.h"
 #include "messages.h"
-#include "lib/messages_ctdbd.h"
+#include "lib/messages_ctdb.h"
 #include "smbprofile.h"
 #include "rpc_server/spoolss/srv_spoolss_nt.h"
 #include "libsmb/libsmb.h"
@@ -2775,7 +2775,7 @@ static NTSTATUS smbd_register_ips(struct smbXsrv_connection *xconn,
        struct ctdbd_connection *cconn;
        int ret;
 
-       cconn = messaging_ctdbd_connection();
+       cconn = messaging_ctdb_connection();
        if (cconn == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
index 76c2d2af2852509c084701a499f3dfbc0c148aa2..916727635f942cbc95ef4237c81be5fc9f537785 100644 (file)
@@ -40,7 +40,7 @@
 #include "passdb.h"
 #include "auth.h"
 #include "messages.h"
-#include "messages_ctdbd.h"
+#include "messages_ctdb.h"
 #include "smbprofile.h"
 #include "lib/id_cache.h"
 #include "lib/param/param.h"
@@ -361,7 +361,7 @@ static struct tevent_req *notifyd_req(struct messaging_context *msg_ctx,
        }
 
        if (lp_clustering()) {
-               ctdbd_conn = messaging_ctdbd_connection();
+               ctdbd_conn = messaging_ctdb_connection();
        }
 
        req = notifyd_send(msg_ctx, ev, msg_ctx, ctdbd_conn,
@@ -1302,7 +1302,7 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
 
 #ifdef CLUSTER_SUPPORT
        if (lp_clustering()) {
-               struct ctdbd_connection *conn = messaging_ctdbd_connection();
+               struct ctdbd_connection *conn = messaging_ctdb_connection();
 
                register_with_ctdbd(conn, CTDB_SRVID_RECONFIGURE,
                                    smbd_parent_ctdb_reconfigured, msg_ctx);
index cc6fd0c1e99006d0ab4cd698fc90213901dddf17..1da5c94a5567dfb8871f800e4576d00244491d80 100644 (file)
@@ -23,7 +23,7 @@
 #include "lib/dbwrap/dbwrap.h"
 #include "lib/dbwrap/dbwrap_ctdb.h"
 #include "messages.h"
-#include "lib/messages_ctdbd.h"
+#include "lib/messages_ctdb.h"
 
 bool run_local_dbwrap_ctdb(int dummy)
 {
index bc8c59b85e8d28555f783db2a60ec9eeb0b61444..4230b6a37782043d570b1b029003d2cd40cfddcd 100644 (file)
@@ -322,7 +322,6 @@ if bld.env.with_ctdb:
     SAMBA_CLUSTER_SUPPORT_SOURCES='''
                      lib/cluster_support.c
                      lib/dbwrap/dbwrap_ctdb.c
-                     lib/messages_ctdbd.c
                      lib/messages_ctdb.c
                      lib/messages_ctdb_ref.c
                      lib/ctdbd_conn.c