ctdb-recoverd: Change signature of get_remote_nodemaps()
authorMartin Schwenke <martin@meltin.net>
Thu, 18 Jan 2018 05:41:19 +0000 (16:41 +1100)
committerStefan Metzmacher <metze@samba.org>
Thu, 27 Aug 2020 10:48:08 +0000 (10:48 +0000)
Change 1st argument to a rec context, since this will be needed later.
Drop the nodemap argument and access it via rec->nodemap instead.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 3324dd272c7dafa92cd9c3fd0af8f50084bcdaaa)

ctdb/server/ctdb_recoverd.c

index 5d6cfa2d0094056ad5543b43fac07e644d8235b9..b08950a17bc4b3cd5b2c3f4f7aae1b7aa1e7222e 100644 (file)
@@ -2241,15 +2241,15 @@ static void async_getnodemap_callback(struct ctdb_context *ctdb,
 
 }
 
-static int get_remote_nodemaps(struct ctdb_context *ctdb,
+static int get_remote_nodemaps(struct ctdb_recoverd *rec,
                               TALLOC_CTX *mem_ctx,
-                              struct ctdb_node_map_old *nodemap,
                               struct ctdb_node_map_old **remote_nodemaps)
 {
+       struct ctdb_context *ctdb = rec->ctdb;
        uint32_t *nodes;
        int ret;
 
-       nodes = list_of_active_nodes(ctdb, nodemap, mem_ctx, true);
+       nodes = list_of_active_nodes(ctdb, rec->nodemap, mem_ctx, true);
 
        ret = ctdb_client_async_control(ctdb,
                                        CTDB_CONTROL_GET_NODEMAP,
@@ -2592,10 +2592,11 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
        for(i=0; i<nodemap->num; i++) {
                remote_nodemaps[i] = NULL;
        }
-       if (get_remote_nodemaps(ctdb, mem_ctx, nodemap, remote_nodemaps) != 0) {
-               DEBUG(DEBUG_ERR,(__location__ " Failed to read remote nodemaps\n"));
+       ret = get_remote_nodemaps(rec, mem_ctx, remote_nodemaps);
+       if (ret != 0) {
+               DBG_ERR("Failed to read remote nodemaps\n");
                return;
-       } 
+       }
 
        /* verify that all other nodes have the same nodemap as we have
        */