From dc0bfcd7da32cc32162c46e58e03ad7501d01342 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Tue, 19 Jul 2016 17:34:03 +1000 Subject: [PATCH] ctdb-daemon: Remove implementation of SET/GET_DB_PRIORITY Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- ctdb/include/ctdb_private.h | 3 --- ctdb/server/ctdb_control.c | 15 +++------------ ctdb/server/ctdb_ltdb_server.c | 34 ---------------------------------- 3 files changed, 3 insertions(+), 49 deletions(-) diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index f2f5acf3342..b2e52029def 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -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); diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c index 5d924258ad8..5b3e7c2190b 100644 --- a/ctdb/server/ctdb_control.c +++ b/ctdb/server/ctdb_control.c @@ -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); diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c index 8724791349e..88d0bcee23f 100644 --- a/ctdb/server/ctdb_ltdb_server.c +++ b/ctdb/server/ctdb_ltdb_server.c @@ -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) {