mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-daemon: Drop the implementation of CHECK_SRVIDS control
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Mon Aug 14 13:00:16 CEST 2017 on sn-devel-144
This commit is contained in:
parent
0772cf45b4
commit
df41818bef
@ -551,8 +551,6 @@ int daemon_register_message_handler(struct ctdb_context *ctdb,
|
||||
uint32_t client_id, uint64_t srvid);
|
||||
int daemon_deregister_message_handler(struct ctdb_context *ctdb,
|
||||
uint32_t client_id, uint64_t srvid);
|
||||
int daemon_check_srvids(struct ctdb_context *ctdb, TDB_DATA indata,
|
||||
TDB_DATA *outdata);
|
||||
|
||||
int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork);
|
||||
|
||||
|
@ -311,7 +311,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
||||
return daemon_deregister_message_handler(ctdb, client_id, srvid);
|
||||
|
||||
case CTDB_CONTROL_CHECK_SRVIDS:
|
||||
return daemon_check_srvids(ctdb, indata, outdata);
|
||||
return control_not_implemented("CHECK_SRVIDS", NULL);
|
||||
|
||||
case CTDB_CONTROL_ENABLE_SEQNUM:
|
||||
CHECK_CONTROL_DATA_SIZE(sizeof(uint32_t));
|
||||
|
@ -208,37 +208,6 @@ int daemon_deregister_message_handler(struct ctdb_context *ctdb, uint32_t client
|
||||
return srvid_deregister(ctdb->srv, srvid, client);
|
||||
}
|
||||
|
||||
int daemon_check_srvids(struct ctdb_context *ctdb, TDB_DATA indata,
|
||||
TDB_DATA *outdata)
|
||||
{
|
||||
uint64_t *ids;
|
||||
int i, num_ids;
|
||||
uint8_t *results;
|
||||
|
||||
if ((indata.dsize % sizeof(uint64_t)) != 0) {
|
||||
DEBUG(DEBUG_ERR, ("Bad indata in daemon_check_srvids, "
|
||||
"size=%d\n", (int)indata.dsize));
|
||||
return -1;
|
||||
}
|
||||
|
||||
ids = (uint64_t *)indata.dptr;
|
||||
num_ids = indata.dsize / 8;
|
||||
|
||||
results = talloc_zero_array(outdata, uint8_t, (num_ids+7)/8);
|
||||
if (results == NULL) {
|
||||
DEBUG(DEBUG_ERR, ("talloc failed in daemon_check_srvids\n"));
|
||||
return -1;
|
||||
}
|
||||
for (i=0; i<num_ids; i++) {
|
||||
if (srvid_exists(ctdb->srv, ids[i]) == 0) {
|
||||
results[i/8] |= (1 << (i%8));
|
||||
}
|
||||
}
|
||||
outdata->dptr = (uint8_t *)results;
|
||||
outdata->dsize = talloc_get_size(results);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
destroy a ctdb_client
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user