예제 #1
0
/**
 * Reply to a waiter for db freeze
 */
static int ctdb_db_freeze_waiter_destructor(struct ctdb_db_freeze_waiter *w)
{
    /* 'c' pointer is talloc_memdup(), so cannot use talloc_get_type */
    struct ctdb_req_control_old *c =
        (struct ctdb_req_control_old *)w->private_data;

    ctdb_request_control_reply(w->ctdb, c, NULL, w->status, NULL);
    return 0;
}
예제 #2
0
/*
  called when a CTDB_REQ_CONTROL packet comes in
*/
void ctdb_request_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
{
	struct ctdb_req_control_old *c = (struct ctdb_req_control_old *)hdr;
	TDB_DATA data, *outdata;
	int32_t status;
	bool async_reply = false;
	const char *errormsg = NULL;

	data.dptr = &c->data[0];
	data.dsize = c->datalen;

	outdata = talloc_zero(c, TDB_DATA);

	status = ctdb_control_dispatch(ctdb, c, data, outdata, hdr->srcnode, 
				       &errormsg, &async_reply);

	if (!async_reply) {
		ctdb_request_control_reply(ctdb, c, outdata, status, errormsg);
	}
}
예제 #3
0
/*
  destroy a waiter for a freeze mode change
 */
static int ctdb_freeze_waiter_destructor(struct ctdb_freeze_waiter *w)
{
    ctdb_request_control_reply(w->ctdb, w->c, NULL, w->status, NULL);
    return 0;
}