{
struct ctdb_client_control_state *state;
size_t len;
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
int ret;
if (errormsg) {
talloc_set_destructor(state, ctdb_client_control_destructor);
- len = offsetof(struct ctdb_req_control, data) + data.dsize;
+ len = offsetof(struct ctdb_req_control_old, data) + data.dsize;
c = ctdbd_allocate_pkt(ctdb, state, CTDB_REQ_CONTROL,
- len, struct ctdb_req_control);
+ len, struct ctdb_req_control_old);
state->c = c;
CTDB_NO_MEMORY_NULL(ctdb, c);
c->hdr.reqid = state->reqid;
if (queue->ctdb->tunable.verbose_memory_names != 0) {
switch (hdr->operation) {
case CTDB_REQ_CONTROL: {
- struct ctdb_req_control *c = (struct ctdb_req_control *)hdr;
+ struct ctdb_req_control_old *c = (struct ctdb_req_control_old *)hdr;
talloc_set_name(pkt, "ctdb_queue_pkt: %s control opcode=%u srvid=%llu datalen=%u",
queue->name, (unsigned)c->opcode, (unsigned long long)c->srvid, (unsigned)c->datalen);
break;
TDB_DATA outdata;
enum control_state state;
char *errormsg;
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
/* if we have a callback registered for the completion (or failure) of
this control
int32_t ctdb_dump_memory(struct ctdb_context *ctdb, TDB_DATA *outdata);
void ctdb_request_control_reply(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA *outdata, int32_t status,
const char *errormsg);
/* from server/ctdb_freeze.c */
int32_t ctdb_control_db_freeze(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
uint32_t db_id, bool *async_reply);
int32_t ctdb_control_db_thaw(struct ctdb_context *ctdb, uint32_t db_id);
int32_t ctdb_control_freeze(struct ctdb_context *ctdb,
- struct ctdb_req_control *c, bool *async_reply);
+ struct ctdb_req_control_old *c, bool *async_reply);
int32_t ctdb_control_thaw(struct ctdb_context *ctdb, uint32_t priority,
bool check_recmode);
int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
TDB_DATA *outdata, uint64_t tdb_flags,
bool persistent, uint32_t client_id,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
bool *async_reply);
int32_t ctdb_control_db_detach(struct ctdb_context *ctdb, TDB_DATA indata,
uint32_t client_id);
void ctdb_persistent_finish_trans3_commits(struct ctdb_context *ctdb);
int32_t ctdb_control_trans3_commit(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA recdata, bool *async_reply);
int32_t ctdb_control_start_persistent_update(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA recdata);
int32_t ctdb_control_cancel_persistent_update(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA recdata);
int32_t ctdb_control_get_db_seqnum(struct ctdb_context *ctdb,
int ctdb_deferred_drop_all_ips(struct ctdb_context *ctdb);
int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata, bool *async_reply,
const char **errormsg);
void ctdb_recovery_unlock(struct ctdb_context *ctdb);
int32_t ctdb_control_end_recovery(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
bool *async_reply);
int32_t ctdb_control_start_recovery(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
bool *async_reply);
int32_t ctdb_control_try_delete_records(struct ctdb_context *ctdb,
int ctdb_statistics_init(struct ctdb_context *ctdb);
int32_t ctdb_control_get_stat_history(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA *outdata);
/* from ctdb_takeover.c */
int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata,
bool *async_reply);
int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata,
bool *async_reply);
int32_t ctdb_control_ipreallocated(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
bool *async_reply);
int ctdb_set_public_addresses(struct ctdb_context *ctdb, bool check_addresses);
void ctdb_release_all_ips(struct ctdb_context *ctdb);
int32_t ctdb_control_get_public_ips(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA *outdata);
int32_t ctdb_control_get_public_ip_info(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata, TDB_DATA *outdata);
int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA *outdata);
int32_t ctdb_control_set_iface_link(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata);
int32_t ctdb_control_kill_tcp(struct ctdb_context *ctdb, TDB_DATA indata);
int32_t ctdb_control_add_public_address(struct ctdb_context *ctdb,
TDB_DATA indata);
int32_t ctdb_control_del_public_address(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA recdata, bool *async_reply);
int verify_remote_ip_allocation(struct ctdb_context *ctdb,
void clear_ip_assignment_tree(struct ctdb_context *ctdb);
int32_t ctdb_control_reload_public_ips(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
bool *async_reply);
/* from ctdb_traverse.c */
/* from ctdb_update_record.c */
int32_t ctdb_control_update_record(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA recdata, bool *async_reply);
/* from ctdb_uptime.c */
enum ctdb_event call);
int32_t ctdb_run_eventscripts(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA data, bool *async_reply);
int32_t ctdb_control_enable_script(struct ctdb_context *ctdb, TDB_DATA indata);
uint8_t data[1];
};
-struct ctdb_req_control {
+struct ctdb_req_control_old {
struct ctdb_req_header hdr;
uint32_t opcode;
uint32_t pad;
process a control request
*/
static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata,
TDB_DATA *outdata, uint32_t srcnode,
const char **errormsg,
/*
send a reply for a ctdb control
*/
-void ctdb_request_control_reply(struct ctdb_context *ctdb, struct ctdb_req_control *c,
+void ctdb_request_control_reply(struct ctdb_context *ctdb, struct ctdb_req_control_old *c,
TDB_DATA *outdata, int32_t status, const char *errormsg)
{
struct ctdb_reply_control *r;
*/
void ctdb_request_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
{
- struct ctdb_req_control *c = (struct ctdb_req_control *)hdr;
+ struct ctdb_req_control_old *c = (struct ctdb_req_control_old *)hdr;
TDB_DATA data, *outdata;
int32_t status;
bool async_reply = false;
ctdb_control_callback_fn_t callback,
void *private_data)
{
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
struct ctdb_control_state *state;
size_t len;
talloc_set_destructor(state, ctdb_control_destructor);
- len = offsetof(struct ctdb_req_control, data) + data.dsize;
+ len = offsetof(struct ctdb_req_control_old, data) + data.dsize;
c = ctdb_transport_allocate(ctdb, state, CTDB_REQ_CONTROL, len,
- struct ctdb_req_control);
+ struct ctdb_req_control_old);
CTDB_NO_MEMORY(ctdb, c);
talloc_set_name_const(c, "ctdb_req_control packet");
static void daemon_request_control_from_client(struct ctdb_client *client,
- struct ctdb_req_control *c);
+ struct ctdb_req_control_old *c);
/* data contains a packet from the client */
static void daemon_incoming_packet(void *p, struct ctdb_req_header *hdr)
case CTDB_REQ_CONTROL:
CTDB_INCREMENT_STAT(ctdb, client.req_control);
- daemon_request_control_from_client(client, (struct ctdb_req_control *)hdr);
+ daemon_request_control_from_client(client, (struct ctdb_req_control_old *)hdr);
break;
default:
struct daemon_control_state {
struct daemon_control_state *next, *prev;
struct ctdb_client *client;
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
uint32_t reqid;
struct ctdb_node *node;
};
from a local client over the unix domain socket
*/
static void daemon_request_control_from_client(struct ctdb_client *client,
- struct ctdb_req_control *c)
+ struct ctdb_req_control_old *c)
{
TDB_DATA data;
int res;
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 *c =
- (struct ctdb_req_control *)w->private_data;
+ 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;
* freeze a database
*/
int32_t ctdb_control_db_freeze(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
uint32_t db_id,
bool *async_reply)
{
struct ctdb_freeze_waiter {
struct ctdb_freeze_waiter *next, *prev;
struct ctdb_context *ctdb;
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
uint32_t priority;
int32_t status;
};
/*
freeze the databases
*/
-int32_t ctdb_control_freeze(struct ctdb_context *ctdb, struct ctdb_req_control *c, bool *async_reply)
+int32_t ctdb_control_freeze(struct ctdb_context *ctdb, struct ctdb_req_control_old *c, bool *async_reply)
{
struct ctdb_freeze_waiter *w;
uint32_t priority;
struct ctdb_deferred_attach_context {
struct ctdb_deferred_attach_context *next, *prev;
struct ctdb_context *ctdb;
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
};
int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
TDB_DATA *outdata, uint64_t tdb_flags,
bool persistent, uint32_t client_id,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
bool *async_reply)
{
const char *db_name = (const char *)indata.dptr;
struct ctdb_context *ctdb;
struct ctdb_db_context *ctdb_db; /* used by trans3_commit */
struct ctdb_client *client; /* used by trans3_commit */
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
const char *errormsg;
uint32_t num_pending;
int32_t status;
* This is used to roll out a transaction to all nodes.
*/
int32_t ctdb_control_trans3_commit(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA recdata, bool *async_reply)
{
struct ctdb_client *client;
for now we ignore the recdata that the client has passed to us.
*/
int32_t ctdb_control_start_persistent_update(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA recdata)
{
struct ctdb_client *client = reqid_find(ctdb->idr, c->client_id, struct ctdb_client);
called to tell ctdbd that it is no longer doing a persistent update
*/
int32_t ctdb_control_cancel_persistent_update(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA recdata)
{
struct ctdb_client *client = reqid_find(ctdb->idr, c->client_id, struct ctdb_client);
struct ctdb_set_recmode_state {
struct ctdb_context *ctdb;
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
uint32_t recmode;
int fd[2];
struct tevent_timer *te;
set the recovery mode
*/
int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata, bool *async_reply,
const char **errormsg)
{
struct recovery_callback_state {
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
};
recovery has finished
*/
int32_t ctdb_control_end_recovery(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
bool *async_reply)
{
int ret;
run the startrecovery eventscript
*/
int32_t ctdb_control_start_recovery(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
bool *async_reply)
{
int ret;
int32_t ctdb_control_get_stat_history(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA *outdata)
{
int len;
}
struct takeover_callback_state {
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
ctdb_sock_addr *addr;
struct ctdb_vnn *vnn;
};
struct ctdb_do_takeip_state {
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
struct ctdb_vnn *vnn;
};
take over an ip address
*/
static int32_t ctdb_do_takeip(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
struct ctdb_vnn *vnn)
{
int ret;
}
struct ctdb_do_updateip_state {
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
struct ctdb_iface *old;
struct ctdb_vnn *vnn;
};
update (move) an ip address
*/
static int32_t ctdb_do_updateip(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
struct ctdb_vnn *vnn)
{
int ret;
take over an ip address
*/
int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata,
bool *async_reply)
{
release an ip address
*/
int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata,
bool *async_reply)
{
get list of public IPs
*/
int32_t ctdb_control_get_public_ips(struct ctdb_context *ctdb,
- struct ctdb_req_control *c, TDB_DATA *outdata)
+ struct ctdb_req_control_old *c, TDB_DATA *outdata)
{
int i, num, len;
struct ctdb_all_public_ips *ips;
int32_t ctdb_control_get_public_ip_info(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata,
TDB_DATA *outdata)
{
}
int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA *outdata)
{
int i, num, len;
}
int32_t ctdb_control_set_iface_link(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata)
{
struct ctdb_control_iface_info *info;
}
struct delete_ip_callback_state {
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
};
/*
}
int32_t ctdb_control_del_public_address(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata, bool *async_reply)
{
struct ctdb_control_ip_iface *pub = (struct ctdb_control_ip_iface *)indata.dptr;
struct ipreallocated_callback_state {
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
};
static void ctdb_ipreallocated_callback(struct ctdb_context *ctdb,
/* A control to run the ipreallocated event */
int32_t ctdb_control_ipreallocated(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
bool *async_reply)
{
int ret;
struct ctdb_reloadips_handle {
struct ctdb_context *ctdb;
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
int status;
int fd[2];
pid_t child;
and drop any addresses we should nnot longer host, and add new addresses
that we are now able to host
*/
-int32_t ctdb_control_reload_public_ips(struct ctdb_context *ctdb, struct ctdb_req_control *c, bool *async_reply)
+int32_t ctdb_control_reload_public_ips(struct ctdb_context *ctdb, struct ctdb_req_control_old *c, bool *async_reply)
{
struct ctdb_reloadips_handle *h;
pid_t parent = getpid();
struct ctdb_persistent_write_state {
struct ctdb_db_context *ctdb_db;
struct ctdb_marshall_buffer *m;
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
uint32_t flags;
};
current record
*/
int32_t ctdb_control_update_record(struct ctdb_context *ctdb,
- struct ctdb_req_control *c, TDB_DATA recdata,
+ struct ctdb_req_control_old *c, TDB_DATA recdata,
bool *async_reply)
{
struct ctdb_db_context *ctdb_db;
}
struct eventscript_callback_state {
- struct ctdb_req_control *c;
+ struct ctdb_req_control_old *c;
};
/*
A control to force running of the eventscripts from the ctdb client tool
*/
int32_t ctdb_run_eventscripts(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA indata, bool *async_reply)
{
int ret;
/* From ctdb_takeover.c */
int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb,
- struct ctdb_req_control *c,
+ struct ctdb_req_control_old *c,
TDB_DATA *outdata)
{
int i, num, len;
TALLOC_CTX *mem_ctx, TDB_DATA *outdata,
int *cstatus)
{
- struct ctdb_req_control req;
+ struct ctdb_req_control_old req;
struct ctdb_req_header *hdr;
struct ctdb_reply_control *reply = NULL;
struct iovec iov[2];
int ret;
ZERO_STRUCT(req);
- req.hdr.length = offsetof(struct ctdb_req_control, data) + data.dsize;
+ req.hdr.length = offsetof(struct ctdb_req_control_old, data) + data.dsize;
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_PROTOCOL;
req.hdr.operation = CTDB_REQ_CONTROL;
ctdb_packet_dump(&req.hdr);
iov[0].iov_base = &req;
- iov[0].iov_len = offsetof(struct ctdb_req_control, data);
+ iov[0].iov_len = offsetof(struct ctdb_req_control_old, data);
iov[1].iov_base = data.dptr;
iov[1].iov_len = data.dsize;
}
for (i=0; i<num_pids; i++) {
- struct ctdb_req_control req;
+ struct ctdb_req_control_old req;
pid_t pid;
struct iovec iov[2];
ssize_t nwritten;
(int)pids[i].vnn, (int)pid,
(int)reqids[i]));
- req.hdr.length = offsetof(struct ctdb_req_control, data);
+ req.hdr.length = offsetof(struct ctdb_req_control_old, data);
req.hdr.length += sizeof(pid);
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_PROTOCOL;
ctdb_packet_dump(&req.hdr);
iov[0].iov_base = &req;
- iov[0].iov_len = offsetof(struct ctdb_req_control, data);
+ iov[0].iov_len = offsetof(struct ctdb_req_control_old, data);
iov[1].iov_base = &pid;
iov[1].iov_len = sizeof(pid);