1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-daemon: Remove struct ctdb_client_notify_deregister

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2015-10-28 17:47:03 +11:00 committed by Martin Schwenke
parent b936145951
commit 563f518283
4 changed files with 7 additions and 13 deletions

View File

@ -765,10 +765,6 @@ struct ctdb_notify_data_old {
uint8_t notify_data[1];
};
struct ctdb_client_notify_deregister {
uint64_t srvid;
};
/* table that contains a list of all dbids on a node
*/
struct ctdb_dbid_map {

View File

@ -634,7 +634,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
return ctdb_control_register_notify(ctdb, client_id, indata);
case CTDB_CONTROL_DEREGISTER_NOTIFY:
CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_client_notify_deregister));
CHECK_CONTROL_DATA_SIZE(sizeof(uint64_t));
return ctdb_control_deregister_notify(ctdb, client_id, indata);
case CTDB_CONTROL_GET_LOG:

View File

@ -1720,11 +1720,11 @@ int32_t ctdb_control_register_notify(struct ctdb_context *ctdb, uint32_t client_
int32_t ctdb_control_deregister_notify(struct ctdb_context *ctdb, uint32_t client_id, TDB_DATA indata)
{
struct ctdb_client_notify_deregister *notify = (struct ctdb_client_notify_deregister *)indata.dptr;
uint64_t srvid = *(uint64_t *)indata.dptr;
struct ctdb_client *client = reqid_find(ctdb->idr, client_id, struct ctdb_client);
struct ctdb_client_notify_list *nl;
DEBUG(DEBUG_INFO,("Deregister srvid %llu for client %d\n", (unsigned long long)notify->srvid, client_id));
DEBUG(DEBUG_INFO,("Deregister srvid %llu for client %d\n", (unsigned long long)srvid, client_id));
if (client == NULL) {
DEBUG(DEBUG_ERR,(__location__ " Could not find client parent structure. You can not send this control to a remote node\n"));
@ -1732,12 +1732,12 @@ int32_t ctdb_control_deregister_notify(struct ctdb_context *ctdb, uint32_t clien
}
for(nl=client->notify; nl; nl=nl->next) {
if (nl->srvid == notify->srvid) {
if (nl->srvid == srvid) {
break;
}
}
if (nl == NULL) {
DEBUG(DEBUG_ERR,(__location__ " No notification for srvid:%llu found for this client\n", (unsigned long long)notify->srvid));
DEBUG(DEBUG_ERR,(__location__ " No notification for srvid:%llu found for this client\n", (unsigned long long)srvid));
return -1;
}

View File

@ -1276,15 +1276,13 @@ int ctdb_watch_us(struct ctdbd_connection *conn)
int ctdb_unwatch(struct ctdbd_connection *conn)
{
struct ctdb_client_notify_deregister dereg_data;
uint64_t srvid = CTDB_SRVID_SAMBA_NOTIFY;
int ret;
int cstatus;
dereg_data.srvid = CTDB_SRVID_SAMBA_NOTIFY;
ret = ctdbd_control_local(
conn, CTDB_CONTROL_DEREGISTER_NOTIFY, conn->rand_srvid, 0,
make_tdb_data((uint8_t *)&dereg_data, sizeof(dereg_data)),
make_tdb_data((uint8_t *)&srvid, sizeof(srvid)),
NULL, NULL, &cstatus);
if (ret != 0) {
DEBUG(1, ("ctdbd_control_local failed: %s\n",