mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-daemon: Remove implementation of SET/GET_DB_PRIORITY
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
70d10cea7b
commit
dc0bfcd7da
@ -806,9 +806,6 @@ int32_t ctdb_ltdb_update_seqnum(struct ctdb_context *ctdb, uint32_t db_id,
|
||||
uint32_t srcnode);
|
||||
int32_t ctdb_ltdb_enable_seqnum(struct ctdb_context *ctdb, uint32_t db_id);
|
||||
|
||||
int32_t ctdb_control_set_db_priority(struct ctdb_context *ctdb, TDB_DATA indata,
|
||||
uint32_t client_id);
|
||||
|
||||
int ctdb_set_db_sticky(struct ctdb_context *ctdb,
|
||||
struct ctdb_db_context *ctdb_db);
|
||||
|
||||
|
@ -569,19 +569,10 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
||||
return ctdb_control_get_ban_state(ctdb, outdata);
|
||||
|
||||
case CTDB_CONTROL_SET_DB_PRIORITY:
|
||||
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_db_priority));
|
||||
return ctdb_control_set_db_priority(ctdb, indata, client_id);
|
||||
return control_not_implemented("SET_DB_PRIORITY", "");
|
||||
|
||||
case CTDB_CONTROL_GET_DB_PRIORITY: {
|
||||
uint32_t db_id;
|
||||
struct ctdb_db_context *ctdb_db;
|
||||
|
||||
CHECK_CONTROL_DATA_SIZE(sizeof(db_id));
|
||||
db_id = *(uint32_t *)indata.dptr;
|
||||
ctdb_db = find_ctdb_db(ctdb, db_id);
|
||||
if (ctdb_db == NULL) return -1;
|
||||
return ctdb_db->priority;
|
||||
}
|
||||
case CTDB_CONTROL_GET_DB_PRIORITY:
|
||||
return control_not_implemented("GET_DB_PRIORITY", "");
|
||||
|
||||
case CTDB_CONTROL_TRANSACTION_CANCEL:
|
||||
CHECK_CONTROL_DATA_SIZE(0);
|
||||
|
@ -1572,40 +1572,6 @@ int32_t ctdb_ltdb_enable_seqnum(struct ctdb_context *ctdb, uint32_t db_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ctdb_control_set_db_priority(struct ctdb_context *ctdb, TDB_DATA indata,
|
||||
uint32_t client_id)
|
||||
{
|
||||
struct ctdb_db_priority *db_prio = (struct ctdb_db_priority *)indata.dptr;
|
||||
struct ctdb_db_context *ctdb_db;
|
||||
|
||||
ctdb_db = find_ctdb_db(ctdb, db_prio->db_id);
|
||||
if (!ctdb_db) {
|
||||
if (!(ctdb->nodes[ctdb->pnn]->flags & NODE_FLAGS_INACTIVE)) {
|
||||
DEBUG(DEBUG_ERR,("Unknown db_id 0x%x in ctdb_set_db_priority\n",
|
||||
db_prio->db_id));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((db_prio->priority<1) || (db_prio->priority>NUM_DB_PRIORITIES)) {
|
||||
DEBUG(DEBUG_ERR,("Trying to set invalid priority : %u\n", db_prio->priority));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctdb_db->priority = db_prio->priority;
|
||||
DEBUG(DEBUG_INFO,("Setting DB priority to %u for db 0x%08x\n", db_prio->priority, db_prio->db_id));
|
||||
|
||||
if (client_id != 0) {
|
||||
/* Broadcast the update to the rest of the cluster */
|
||||
ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, 0,
|
||||
CTDB_CONTROL_SET_DB_PRIORITY, 0,
|
||||
CTDB_CTRL_FLAG_NOREPLY, indata,
|
||||
NULL, NULL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int ctdb_set_db_sticky(struct ctdb_context *ctdb, struct ctdb_db_context *ctdb_db)
|
||||
{
|
||||
if (ctdb_db->sticky) {
|
||||
|
Loading…
Reference in New Issue
Block a user