mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-daemon: Rename struct ctdb_req_message to ctdb_req_message_old
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
296d9f4cda
commit
acf858defb
@ -195,7 +195,7 @@ static void ctdb_client_reply_call(struct ctdb_context *ctdb, struct ctdb_req_he
|
||||
void ctdb_request_message(struct ctdb_context *ctdb,
|
||||
struct ctdb_req_header *hdr)
|
||||
{
|
||||
struct ctdb_req_message *c = (struct ctdb_req_message *)hdr;
|
||||
struct ctdb_req_message_old *c = (struct ctdb_req_message_old *)hdr;
|
||||
TDB_DATA data;
|
||||
|
||||
data.dsize = c->datalen;
|
||||
@ -589,12 +589,12 @@ int ctdb_client_check_message_handlers(struct ctdb_context *ctdb, uint64_t *ids,
|
||||
int ctdb_client_send_message(struct ctdb_context *ctdb, uint32_t pnn,
|
||||
uint64_t srvid, TDB_DATA data)
|
||||
{
|
||||
struct ctdb_req_message *r;
|
||||
struct ctdb_req_message_old *r;
|
||||
int len, res;
|
||||
|
||||
len = offsetof(struct ctdb_req_message, data) + data.dsize;
|
||||
len = offsetof(struct ctdb_req_message_old, data) + data.dsize;
|
||||
r = ctdbd_allocate_pkt(ctdb, ctdb, CTDB_REQ_MESSAGE,
|
||||
len, struct ctdb_req_message);
|
||||
len, struct ctdb_req_message_old);
|
||||
CTDB_NO_MEMORY(ctdb, r);
|
||||
|
||||
r->hdr.destnode = pnn;
|
||||
|
@ -365,7 +365,7 @@ int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length)
|
||||
break;
|
||||
}
|
||||
case CTDB_REQ_MESSAGE: {
|
||||
struct ctdb_req_message *m = (struct ctdb_req_message *)hdr;
|
||||
struct ctdb_req_message_old *m = (struct ctdb_req_message_old *)hdr;
|
||||
talloc_set_name(pkt, "ctdb_queue_pkt: %s message srvid=%llu datalen=%u",
|
||||
queue->name, (unsigned long long)m->srvid, (unsigned)m->datalen);
|
||||
break;
|
||||
|
@ -473,7 +473,7 @@ struct ctdb_reply_dmaster_old {
|
||||
uint8_t data[1];
|
||||
};
|
||||
|
||||
struct ctdb_req_message {
|
||||
struct ctdb_req_message_old {
|
||||
struct ctdb_req_header hdr;
|
||||
uint64_t srvid;
|
||||
uint32_t datalen;
|
||||
|
@ -145,13 +145,13 @@ static void daemon_message_handler(uint64_t srvid, TDB_DATA data,
|
||||
void *private_data)
|
||||
{
|
||||
struct ctdb_client *client = talloc_get_type(private_data, struct ctdb_client);
|
||||
struct ctdb_req_message *r;
|
||||
struct ctdb_req_message_old *r;
|
||||
int len;
|
||||
|
||||
/* construct a message to send to the client containing the data */
|
||||
len = offsetof(struct ctdb_req_message, data) + data.dsize;
|
||||
len = offsetof(struct ctdb_req_message_old, data) + data.dsize;
|
||||
r = ctdbd_allocate_pkt(client->ctdb, client->ctdb, CTDB_REQ_MESSAGE,
|
||||
len, struct ctdb_req_message);
|
||||
len, struct ctdb_req_message_old);
|
||||
CTDB_NO_MEMORY_VOID(client->ctdb, r);
|
||||
|
||||
talloc_set_name_const(r, "req_message packet");
|
||||
@ -273,7 +273,7 @@ static int ctdb_client_destructor(struct ctdb_client *client)
|
||||
from a local client over the unix domain socket
|
||||
*/
|
||||
static void daemon_request_message_from_client(struct ctdb_client *client,
|
||||
struct ctdb_req_message *c)
|
||||
struct ctdb_req_message_old *c)
|
||||
{
|
||||
TDB_DATA data;
|
||||
int res;
|
||||
@ -845,7 +845,7 @@ static void daemon_incoming_packet(void *p, struct ctdb_req_header *hdr)
|
||||
|
||||
case CTDB_REQ_MESSAGE:
|
||||
CTDB_INCREMENT_STAT(ctdb, client.req_message);
|
||||
daemon_request_message_from_client(client, (struct ctdb_req_message *)hdr);
|
||||
daemon_request_message_from_client(client, (struct ctdb_req_message_old *)hdr);
|
||||
break;
|
||||
|
||||
case CTDB_REQ_CONTROL:
|
||||
@ -1616,7 +1616,7 @@ static int ctdb_local_message(struct ctdb_context *ctdb, uint64_t srvid, TDB_DAT
|
||||
int ctdb_daemon_send_message(struct ctdb_context *ctdb, uint32_t pnn,
|
||||
uint64_t srvid, TDB_DATA data)
|
||||
{
|
||||
struct ctdb_req_message *r;
|
||||
struct ctdb_req_message_old *r;
|
||||
int len;
|
||||
|
||||
if (ctdb->methods == NULL) {
|
||||
@ -1629,9 +1629,9 @@ int ctdb_daemon_send_message(struct ctdb_context *ctdb, uint32_t pnn,
|
||||
return ctdb_local_message(ctdb, srvid, data);
|
||||
}
|
||||
|
||||
len = offsetof(struct ctdb_req_message, data) + data.dsize;
|
||||
len = offsetof(struct ctdb_req_message_old, data) + data.dsize;
|
||||
r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REQ_MESSAGE, len,
|
||||
struct ctdb_req_message);
|
||||
struct ctdb_req_message_old);
|
||||
CTDB_NO_MEMORY(ctdb, r);
|
||||
|
||||
r->hdr.destnode = pnn;
|
||||
|
@ -84,7 +84,7 @@ int ctdbd_control_local(struct ctdbd_connection *conn, uint32_t opcode,
|
||||
int ctdb_watch_us(struct ctdbd_connection *conn);
|
||||
int ctdb_unwatch(struct ctdbd_connection *conn);
|
||||
|
||||
struct ctdb_req_message;
|
||||
struct ctdb_req_message_old;
|
||||
|
||||
int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
|
||||
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
|
||||
|
@ -135,18 +135,18 @@ int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
|
||||
}
|
||||
|
||||
static int ctdbd_msg_call_back(struct ctdbd_connection *conn,
|
||||
struct ctdb_req_message *msg)
|
||||
struct ctdb_req_message_old *msg)
|
||||
{
|
||||
size_t msg_len;
|
||||
size_t i, num_callbacks;
|
||||
|
||||
msg_len = msg->hdr.length;
|
||||
if (msg_len < offsetof(struct ctdb_req_message, data)) {
|
||||
if (msg_len < offsetof(struct ctdb_req_message_old, data)) {
|
||||
DEBUG(10, ("%s: len %u too small\n", __func__,
|
||||
(unsigned)msg_len));
|
||||
return 0;
|
||||
}
|
||||
msg_len -= offsetof(struct ctdb_req_message, data);
|
||||
msg_len -= offsetof(struct ctdb_req_message_old, data);
|
||||
|
||||
if (msg_len < msg->datalen) {
|
||||
DEBUG(10, ("%s: msg_len=%u < msg->datalen=%u\n", __func__,
|
||||
@ -370,7 +370,7 @@ static int ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid,
|
||||
ctdb_packet_dump(hdr);
|
||||
|
||||
if (hdr->operation == CTDB_REQ_MESSAGE) {
|
||||
struct ctdb_req_message *msg = (struct ctdb_req_message *)hdr;
|
||||
struct ctdb_req_message_old *msg = (struct ctdb_req_message_old *)hdr;
|
||||
|
||||
if (conn->msg_ctx == NULL) {
|
||||
DEBUG(1, ("Got a message without having a msg ctx, "
|
||||
@ -526,7 +526,7 @@ int ctdbd_conn_get_fd(struct ctdbd_connection *conn)
|
||||
static int ctdb_handle_message(struct ctdbd_connection *conn,
|
||||
struct ctdb_req_header *hdr)
|
||||
{
|
||||
struct ctdb_req_message *msg;
|
||||
struct ctdb_req_message_old *msg;
|
||||
|
||||
if (hdr->operation != CTDB_REQ_MESSAGE) {
|
||||
DEBUG(0, ("Received async msg of type %u, discarding\n",
|
||||
@ -534,7 +534,7 @@ static int ctdb_handle_message(struct ctdbd_connection *conn,
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
msg = (struct ctdb_req_message *)hdr;
|
||||
msg = (struct ctdb_req_message_old *)hdr;
|
||||
|
||||
ctdbd_msg_call_back(conn, msg);
|
||||
|
||||
@ -598,12 +598,12 @@ int ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
|
||||
uint32_t dst_vnn, uint64_t dst_srvid,
|
||||
const struct iovec *iov, int iovlen)
|
||||
{
|
||||
struct ctdb_req_message r;
|
||||
struct ctdb_req_message_old r;
|
||||
struct iovec iov2[iovlen+1];
|
||||
size_t buflen = iov_buflen(iov, iovlen);
|
||||
ssize_t nwritten;
|
||||
|
||||
r.hdr.length = offsetof(struct ctdb_req_message, data) + buflen;
|
||||
r.hdr.length = offsetof(struct ctdb_req_message_old, data) + buflen;
|
||||
r.hdr.ctdb_magic = CTDB_MAGIC;
|
||||
r.hdr.ctdb_version = CTDB_PROTOCOL;
|
||||
r.hdr.generation = 1;
|
||||
@ -618,7 +618,7 @@ int ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
|
||||
ctdb_packet_dump(&r.hdr);
|
||||
|
||||
iov2[0].iov_base = &r;
|
||||
iov2[0].iov_len = offsetof(struct ctdb_req_message, data);
|
||||
iov2[0].iov_len = offsetof(struct ctdb_req_message_old, data);
|
||||
memcpy(&iov2[1], iov, iovlen * sizeof(struct iovec));
|
||||
|
||||
nwritten = write_data_iov(conn->fd, iov2, iovlen+1);
|
||||
@ -1093,7 +1093,7 @@ int ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id,
|
||||
|
||||
while (True) {
|
||||
struct ctdb_req_header *hdr = NULL;
|
||||
struct ctdb_req_message *m;
|
||||
struct ctdb_req_message_old *m;
|
||||
struct ctdb_rec_data *d;
|
||||
|
||||
ret = ctdb_read_packet(conn->fd, conn->timeout, conn, &hdr);
|
||||
@ -1110,7 +1110,7 @@ int ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id,
|
||||
return EIO;
|
||||
}
|
||||
|
||||
m = (struct ctdb_req_message *)hdr;
|
||||
m = (struct ctdb_req_message_old *)hdr;
|
||||
d = (struct ctdb_rec_data *)&m->data[0];
|
||||
if (m->datalen < sizeof(uint32_t) || m->datalen != d->length) {
|
||||
DEBUG(0, ("Got invalid traverse data of length %d\n",
|
||||
|
Loading…
Reference in New Issue
Block a user