mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-daemon: Rename struct ctdb_reply_control to ctdb_reply_control_old
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
e1fed53e2a
commit
1c828b4ed6
@ -990,7 +990,7 @@ static void invoke_control_callback(struct tevent_context *ev,
|
|||||||
static void ctdb_client_reply_control(struct ctdb_context *ctdb,
|
static void ctdb_client_reply_control(struct ctdb_context *ctdb,
|
||||||
struct ctdb_req_header *hdr)
|
struct ctdb_req_header *hdr)
|
||||||
{
|
{
|
||||||
struct ctdb_reply_control *c = (struct ctdb_reply_control *)hdr;
|
struct ctdb_reply_control_old *c = (struct ctdb_reply_control_old *)hdr;
|
||||||
struct ctdb_client_control_state *state;
|
struct ctdb_client_control_state *state;
|
||||||
|
|
||||||
state = reqid_find(ctdb->idr, hdr->reqid, struct ctdb_client_control_state);
|
state = reqid_find(ctdb->idr, hdr->reqid, struct ctdb_client_control_state);
|
||||||
|
@ -493,7 +493,7 @@ struct ctdb_req_control_old {
|
|||||||
uint8_t data[1];
|
uint8_t data[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ctdb_reply_control {
|
struct ctdb_reply_control_old {
|
||||||
struct ctdb_req_header hdr;
|
struct ctdb_req_header hdr;
|
||||||
int32_t status;
|
int32_t status;
|
||||||
uint32_t datalen;
|
uint32_t datalen;
|
||||||
|
@ -727,7 +727,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
|||||||
void ctdb_request_control_reply(struct ctdb_context *ctdb, struct ctdb_req_control_old *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)
|
TDB_DATA *outdata, int32_t status, const char *errormsg)
|
||||||
{
|
{
|
||||||
struct ctdb_reply_control *r;
|
struct ctdb_reply_control_old *r;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
/* some controls send no reply */
|
/* some controls send no reply */
|
||||||
@ -735,11 +735,11 @@ void ctdb_request_control_reply(struct ctdb_context *ctdb, struct ctdb_req_contr
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = offsetof(struct ctdb_reply_control, data) + (outdata?outdata->dsize:0);
|
len = offsetof(struct ctdb_reply_control_old, data) + (outdata?outdata->dsize:0);
|
||||||
if (errormsg) {
|
if (errormsg) {
|
||||||
len += strlen(errormsg);
|
len += strlen(errormsg);
|
||||||
}
|
}
|
||||||
r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REPLY_CONTROL, len, struct ctdb_reply_control);
|
r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REPLY_CONTROL, len, struct ctdb_reply_control_old);
|
||||||
if (r == NULL) {
|
if (r == NULL) {
|
||||||
DEBUG(DEBUG_ERR,(__location__ "Unable to allocate transport - OOM or transport is down\n"));
|
DEBUG(DEBUG_ERR,(__location__ "Unable to allocate transport - OOM or transport is down\n"));
|
||||||
return;
|
return;
|
||||||
@ -791,7 +791,7 @@ void ctdb_request_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
|
|||||||
*/
|
*/
|
||||||
void ctdb_reply_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
void ctdb_reply_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
||||||
{
|
{
|
||||||
struct ctdb_reply_control *c = (struct ctdb_reply_control *)hdr;
|
struct ctdb_reply_control_old *c = (struct ctdb_reply_control_old *)hdr;
|
||||||
TDB_DATA data;
|
TDB_DATA data;
|
||||||
struct ctdb_control_state *state;
|
struct ctdb_control_state *state;
|
||||||
const char *errormsg = NULL;
|
const char *errormsg = NULL;
|
||||||
|
@ -1440,17 +1440,17 @@ static void daemon_control_callback(struct ctdb_context *ctdb,
|
|||||||
struct daemon_control_state *state = talloc_get_type(private_data,
|
struct daemon_control_state *state = talloc_get_type(private_data,
|
||||||
struct daemon_control_state);
|
struct daemon_control_state);
|
||||||
struct ctdb_client *client = state->client;
|
struct ctdb_client *client = state->client;
|
||||||
struct ctdb_reply_control *r;
|
struct ctdb_reply_control_old *r;
|
||||||
size_t len;
|
size_t len;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* construct a message to send to the client containing the data */
|
/* construct a message to send to the client containing the data */
|
||||||
len = offsetof(struct ctdb_reply_control, data) + data.dsize;
|
len = offsetof(struct ctdb_reply_control_old, data) + data.dsize;
|
||||||
if (errormsg) {
|
if (errormsg) {
|
||||||
len += strlen(errormsg);
|
len += strlen(errormsg);
|
||||||
}
|
}
|
||||||
r = ctdbd_allocate_pkt(ctdb, state, CTDB_REPLY_CONTROL, len,
|
r = ctdbd_allocate_pkt(ctdb, state, CTDB_REPLY_CONTROL, len,
|
||||||
struct ctdb_reply_control);
|
struct ctdb_reply_control_old);
|
||||||
CTDB_NO_MEMORY_VOID(ctdb, r);
|
CTDB_NO_MEMORY_VOID(ctdb, r);
|
||||||
|
|
||||||
r->hdr.reqid = state->reqid;
|
r->hdr.reqid = state->reqid;
|
||||||
|
@ -642,7 +642,7 @@ static int ctdbd_control(struct ctdbd_connection *conn,
|
|||||||
{
|
{
|
||||||
struct ctdb_req_control_old req;
|
struct ctdb_req_control_old req;
|
||||||
struct ctdb_req_header *hdr;
|
struct ctdb_req_header *hdr;
|
||||||
struct ctdb_reply_control *reply = NULL;
|
struct ctdb_reply_control_old *reply = NULL;
|
||||||
struct iovec iov[2];
|
struct iovec iov[2];
|
||||||
ssize_t nwritten;
|
ssize_t nwritten;
|
||||||
int ret;
|
int ret;
|
||||||
@ -691,7 +691,7 @@ static int ctdbd_control(struct ctdbd_connection *conn,
|
|||||||
TALLOC_FREE(hdr);
|
TALLOC_FREE(hdr);
|
||||||
return EIO;
|
return EIO;
|
||||||
}
|
}
|
||||||
reply = (struct ctdb_reply_control *)hdr;
|
reply = (struct ctdb_reply_control_old *)hdr;
|
||||||
|
|
||||||
if (outdata) {
|
if (outdata) {
|
||||||
if (!(outdata->dptr = (uint8_t *)talloc_memdup(
|
if (!(outdata->dptr = (uint8_t *)talloc_memdup(
|
||||||
@ -794,7 +794,7 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
|
|||||||
|
|
||||||
while (num_received < num_pids) {
|
while (num_received < num_pids) {
|
||||||
struct ctdb_req_header *hdr;
|
struct ctdb_req_header *hdr;
|
||||||
struct ctdb_reply_control *reply;
|
struct ctdb_reply_control_old *reply;
|
||||||
uint32_t reqid;
|
uint32_t reqid;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -809,7 +809,7 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
|
|||||||
DEBUG(10, ("Received invalid reply\n"));
|
DEBUG(10, ("Received invalid reply\n"));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
reply = (struct ctdb_reply_control *)hdr;
|
reply = (struct ctdb_reply_control_old *)hdr;
|
||||||
|
|
||||||
reqid = reply->hdr.reqid;
|
reqid = reply->hdr.reqid;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user