1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

ctdbd_conn: Pass "ev" through ctdb connection callbacks

This prepares the same logic we've implemented in messages_dgm for clustering
that is used in 6d3c064f1a: We need to reply for messages from ctdb in nested
event contexts properly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2017-06-01 17:45:47 +02:00 committed by Ralph Boehme
parent 35b4750ee3
commit 267645545f
7 changed files with 24 additions and 11 deletions

View File

@ -73,7 +73,8 @@ int ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id,
int ctdbd_register_ips(struct ctdbd_connection *conn,
const struct sockaddr_storage *server,
const struct sockaddr_storage *client,
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
int (*cb)(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data),
@ -89,7 +90,8 @@ int ctdb_unwatch(struct ctdbd_connection *conn);
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,
int (*cb)(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data),

View File

@ -38,7 +38,8 @@ int ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
}
int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
int (*cb)(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data),
@ -50,7 +51,8 @@ int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
int ctdbd_register_ips(struct ctdbd_connection *conn,
const struct sockaddr_storage *_server,
const struct sockaddr_storage *_client,
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
int (*cb)(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data),

View File

@ -41,7 +41,8 @@
struct ctdbd_srvid_cb {
uint64_t srvid;
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
int (*cb)(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data);
@ -143,7 +144,8 @@ static void ctdb_packet_dump(struct ctdb_req_header *hdr)
* Register a srvid with ctdbd
*/
int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
int (*cb)(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data),
@ -204,7 +206,8 @@ static int ctdbd_msg_call_back(struct ctdbd_connection *conn,
if ((cb->srvid == msg->srvid) && (cb->cb != NULL)) {
int ret;
ret = cb->cb(msg->hdr.srcnode, msg->hdr.destnode,
ret = cb->cb(NULL,
msg->hdr.srcnode, msg->hdr.destnode,
msg->srvid, msg->data, msg->datalen,
cb->private_data);
if (ret != 0) {
@ -1138,7 +1141,8 @@ static void smbd_ctdb_canonicalize_ip(const struct sockaddr_storage *in,
int ctdbd_register_ips(struct ctdbd_connection *conn,
const struct sockaddr_storage *_server,
const struct sockaddr_storage *_client,
int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
int (*cb)(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data),

View File

@ -109,6 +109,7 @@ static int messaging_ctdbd_destructor(struct messaging_ctdbd_context *ctx)
}
static int messaging_ctdb_recv(
struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn, uint64_t dst_srvid,
const uint8_t *msg, size_t msg_len, void *private_data)
{

View File

@ -179,7 +179,8 @@ static int sys_notify_watch_dummy(
#ifdef CLUSTER_SUPPORT
static void notifyd_broadcast_reclog_finished(struct tevent_req *subreq);
static void notifyd_clean_peers_finished(struct tevent_req *subreq);
static int notifyd_snoop_broadcast(uint32_t src_vnn, uint32_t dst_vnn,
static int notifyd_snoop_broadcast(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data);
@ -1387,7 +1388,8 @@ fail:
* broadcast, which will then trigger a fresh database pull.
*/
static int notifyd_snoop_broadcast(uint32_t src_vnn, uint32_t dst_vnn,
static int notifyd_snoop_broadcast(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data)

View File

@ -2695,7 +2695,8 @@ static void smbd_release_ip_immediate(struct tevent_context *ctx,
/****************************************************************************
received when we should release a specific IP
****************************************************************************/
static int release_ip(uint32_t src_vnn, uint32_t dst_vnn,
static int release_ip(struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn,
uint64_t dst_srvid,
const uint8_t *msg, size_t msglen,
void *private_data)

View File

@ -276,6 +276,7 @@ static void smbd_parent_id_cache_delete(struct messaging_context *ctx,
#ifdef CLUSTER_SUPPORT
static int smbd_parent_ctdb_reconfigured(
struct tevent_context *ev,
uint32_t src_vnn, uint32_t dst_vnn, uint64_t dst_srvid,
const uint8_t *msg, size_t msglen, void *private_data)
{