From 417077c8a722b628d4db17f0f1799c70639d5d17 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Wed, 28 Oct 2015 19:22:23 +1100 Subject: [PATCH] ctdb-daemon: Rename struct ctdb_control_transdb to ctdb_transdb Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- ctdb/include/ctdb_protocol.h | 4 ++-- ctdb/server/ctdb_control.c | 6 +++--- ctdb/server/ctdb_freeze.c | 18 +++++++++--------- ctdb/server/ctdb_recoverd.c | 4 ++-- ctdb/tools/ctdb.c | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h index 7da0f33876b..a850e5c6850 100644 --- a/ctdb/include/ctdb_protocol.h +++ b/ctdb/include/ctdb_protocol.h @@ -981,9 +981,9 @@ struct ctdb_control_list_tunable { }; -struct ctdb_control_transdb { +struct ctdb_transdb { uint32_t db_id; - uint32_t transaction_id; + uint32_t tid; }; #define CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE 0x00010000 diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c index 284cbecac61..3b0c24794fc 100644 --- a/ctdb/server/ctdb_control.c +++ b/ctdb/server/ctdb_control.c @@ -453,7 +453,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb, return ctdb_control_transaction_commit(ctdb, *(uint32_t *)indata.dptr); case CTDB_CONTROL_WIPE_DATABASE: - CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_control_transdb)); + CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_transdb)); return ctdb_control_wipe_database(ctdb, indata); case CTDB_CONTROL_UPTIME: @@ -704,11 +704,11 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb, return ctdb_control_db_thaw(ctdb, *(uint32_t *)indata.dptr); case CTDB_CONTROL_DB_TRANSACTION_START: - CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_control_transdb)); + CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_transdb)); return ctdb_control_db_transaction_start(ctdb, indata); case CTDB_CONTROL_DB_TRANSACTION_COMMIT: - CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_control_transdb)); + CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_transdb)); return ctdb_control_db_transaction_commit(ctdb, indata); case CTDB_CONTROL_DB_TRANSACTION_CANCEL: diff --git a/ctdb/server/ctdb_freeze.c b/ctdb/server/ctdb_freeze.c index 94c070077ea..8aa0f9fb1f4 100644 --- a/ctdb/server/ctdb_freeze.c +++ b/ctdb/server/ctdb_freeze.c @@ -781,8 +781,8 @@ static int db_commit_transaction(struct ctdb_db_context *ctdb_db, int32_t ctdb_control_db_transaction_start(struct ctdb_context *ctdb, TDB_DATA indata) { - struct ctdb_control_transdb *w = - (struct ctdb_control_transdb *)indata.dptr; + struct ctdb_transdb *w = + (struct ctdb_transdb *)indata.dptr; struct ctdb_db_context *ctdb_db; struct db_start_transaction_state state; @@ -794,7 +794,7 @@ int32_t ctdb_control_db_transaction_start(struct ctdb_context *ctdb, return -1; } - state.transaction_id = w->transaction_id; + state.transaction_id = w->tid; state.transaction_started = true; return db_start_transaction(ctdb_db, &state); @@ -828,8 +828,8 @@ int32_t ctdb_control_db_transaction_cancel(struct ctdb_context *ctdb, int32_t ctdb_control_db_transaction_commit(struct ctdb_context *ctdb, TDB_DATA indata) { - struct ctdb_control_transdb *w = - (struct ctdb_control_transdb *)indata.dptr; + struct ctdb_transdb *w = + (struct ctdb_transdb *)indata.dptr; struct ctdb_db_context *ctdb_db; struct db_commit_transaction_state state; int healthy_nodes, i; @@ -849,7 +849,7 @@ int32_t ctdb_control_db_transaction_commit(struct ctdb_context *ctdb, } } - state.transaction_id = w->transaction_id; + state.transaction_id = w->tid; state.healthy_nodes = healthy_nodes; return db_commit_transaction(ctdb_db, &state); @@ -960,7 +960,7 @@ fail: */ int32_t ctdb_control_wipe_database(struct ctdb_context *ctdb, TDB_DATA indata) { - struct ctdb_control_transdb w = *(struct ctdb_control_transdb *)indata.dptr; + struct ctdb_transdb w = *(struct ctdb_transdb *)indata.dptr; struct ctdb_db_context *ctdb_db; ctdb_db = find_ctdb_db(ctdb, w.db_id); @@ -979,8 +979,8 @@ int32_t ctdb_control_wipe_database(struct ctdb_context *ctdb, TDB_DATA indata) return -1; } - if (w.transaction_id != ctdb_db->freeze_transaction_id) { - DEBUG(DEBUG_ERR,(__location__ " incorrect transaction id 0x%x in commit\n", w.transaction_id)); + if (w.tid != ctdb_db->freeze_transaction_id) { + DEBUG(DEBUG_ERR,(__location__ " incorrect transaction id 0x%x in commit\n", w.tid)); return -1; } diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 3c8e5d87cce..fcfc04ec15b 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -1515,7 +1515,7 @@ static int recover_database(struct ctdb_recoverd *rec, int ret; struct ctdb_context *ctdb = rec->ctdb; TDB_DATA data; - struct ctdb_control_transdb w; + struct ctdb_transdb w; uint32_t *nodes; recdb = create_recdb(ctdb, mem_ctx); @@ -1534,7 +1534,7 @@ static int recover_database(struct ctdb_recoverd *rec, /* wipe all the remote databases. This is safe as we are in a transaction */ w.db_id = dbid; - w.transaction_id = transaction_id; + w.tid = transaction_id; data.dptr = (void *)&w; data.dsize = sizeof(w); diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index f53d5bb0db8..9788d29d886 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -5600,7 +5600,7 @@ static int control_restoredb(struct ctdb_context *ctdb, int argc, const char **a struct ctdb_node_map_old *nodemap=NULL; struct ctdb_vnn_map *vnnmap=NULL; int i, fh; - struct ctdb_control_transdb w; + struct ctdb_transdb w; uint32_t *nodes; uint32_t generation; struct tm *tm; @@ -5706,7 +5706,7 @@ static int control_restoredb(struct ctdb_context *ctdb, int argc, const char **a w.db_id = ctdb_db->db_id; - w.transaction_id = generation; + w.tid = generation; data.dptr = (void *)&w; data.dsize = sizeof(w); @@ -5881,7 +5881,7 @@ static int control_wipedb(struct ctdb_context *ctdb, int argc, struct ctdb_node_map_old *nodemap = NULL; struct ctdb_vnn_map *vnnmap = NULL; int i; - struct ctdb_control_transdb w; + struct ctdb_transdb w; uint32_t *nodes; uint32_t generation; uint8_t flags; @@ -5959,7 +5959,7 @@ static int control_wipedb(struct ctdb_context *ctdb, int argc, } w.db_id = ctdb_db->db_id; - w.transaction_id = generation; + w.tid = generation; data.dptr = (void *)&w; data.dsize = sizeof(w); -- 2.34.1