mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
ctdb-daemon: Rename struct ctdb_control_transdb to ctdb_transdb
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
1278a5a4ed
commit
417077c8a7
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user