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:
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"));
}
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;
}
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",