mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-daemon: Rename ctdb_node private_data to transport_data
This gives a casual reader a useful clue. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
a6d99d9e5c
commit
53f8492caa
@ -55,7 +55,8 @@ int ctdb_ibw_get_address(struct ctdb_context *ctdb,
|
|||||||
|
|
||||||
int ctdb_ibw_node_connect(struct ctdb_node *node)
|
int ctdb_ibw_node_connect(struct ctdb_node *node)
|
||||||
{
|
{
|
||||||
struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
|
struct ctdb_ibw_node *cn = talloc_get_type(node->transport_data,
|
||||||
|
struct ctdb_ibw_node);
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
assert(cn!=NULL);
|
assert(cn!=NULL);
|
||||||
@ -118,7 +119,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
|
|||||||
case IBWC_CONNECTED: { /* after ibw_accept or ibw_connect */
|
case IBWC_CONNECTED: { /* after ibw_accept or ibw_connect */
|
||||||
struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
|
struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
|
||||||
if (node!=NULL) { /* after ibw_connect */
|
if (node!=NULL) { /* after ibw_connect */
|
||||||
struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
|
struct ctdb_ibw_node *cn = talloc_get_type(
|
||||||
|
node->transport_data,
|
||||||
|
struct ctdb_ibw_node);
|
||||||
|
|
||||||
node->ctdb->upcalls->node_connected(node);
|
node->ctdb->upcalls->node_connected(node);
|
||||||
ctdb_flush_cn_queue(cn);
|
ctdb_flush_cn_queue(cn);
|
||||||
@ -136,7 +139,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
|
|||||||
case IBWC_ERROR: {
|
case IBWC_ERROR: {
|
||||||
struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
|
struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
|
||||||
if (node!=NULL) {
|
if (node!=NULL) {
|
||||||
struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
|
struct ctdb_ibw_node *cn = talloc_get_type(
|
||||||
|
node->transport_data,
|
||||||
|
struct ctdb_ibw_node);
|
||||||
struct ibw_ctx *ictx = cn->conn->ctx;
|
struct ibw_ctx *ictx = cn->conn->ctx;
|
||||||
|
|
||||||
DEBUG(DEBUG_DEBUG, ("IBWC_ERROR, reconnecting...\n"));
|
DEBUG(DEBUG_DEBUG, ("IBWC_ERROR, reconnecting...\n"));
|
||||||
|
@ -67,7 +67,7 @@ static int ctdb_ibw_add_node(struct ctdb_node *node)
|
|||||||
|
|
||||||
assert(cn!=NULL);
|
assert(cn!=NULL);
|
||||||
cn->conn = ibw_conn_new(ictx, node);
|
cn->conn = ibw_conn_new(ictx, node);
|
||||||
node->private_data = (void *)cn;
|
node->transport_data = (void *)cn;
|
||||||
|
|
||||||
return (cn->conn!=NULL ? 0 : -1);
|
return (cn->conn!=NULL ? 0 : -1);
|
||||||
}
|
}
|
||||||
@ -153,7 +153,8 @@ int ctdb_flush_cn_queue(struct ctdb_ibw_node *cn)
|
|||||||
|
|
||||||
static int ctdb_ibw_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
|
static int ctdb_ibw_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
|
||||||
{
|
{
|
||||||
struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
|
struct ctdb_ibw_node *cn = talloc_get_type(node->transport_data,
|
||||||
|
struct ctdb_ibw_node);
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
assert(length>=sizeof(uint32_t));
|
assert(length>=sizeof(uint32_t));
|
||||||
|
@ -74,7 +74,7 @@ struct ctdb_node {
|
|||||||
struct ctdb_context *ctdb;
|
struct ctdb_context *ctdb;
|
||||||
ctdb_sock_addr address;
|
ctdb_sock_addr address;
|
||||||
const char *name; /* for debug messages */
|
const char *name; /* for debug messages */
|
||||||
void *private_data; /* private to transport */
|
void *transport_data; /* private to transport */
|
||||||
uint32_t pnn;
|
uint32_t pnn;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
void ctdb_tcp_stop_connection(struct ctdb_node *node)
|
void ctdb_tcp_stop_connection(struct ctdb_node *node)
|
||||||
{
|
{
|
||||||
struct ctdb_tcp_node *tnode = talloc_get_type(
|
struct ctdb_tcp_node *tnode = talloc_get_type(
|
||||||
node->private_data, struct ctdb_tcp_node);
|
node->transport_data, struct ctdb_tcp_node);
|
||||||
|
|
||||||
TALLOC_FREE(tnode->out_queue);
|
TALLOC_FREE(tnode->out_queue);
|
||||||
TALLOC_FREE(tnode->connect_te);
|
TALLOC_FREE(tnode->connect_te);
|
||||||
@ -63,7 +63,7 @@ void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data)
|
|||||||
{
|
{
|
||||||
struct ctdb_node *node = talloc_get_type(private_data, struct ctdb_node);
|
struct ctdb_node *node = talloc_get_type(private_data, struct ctdb_node);
|
||||||
struct ctdb_tcp_node *tnode = talloc_get_type(
|
struct ctdb_tcp_node *tnode = talloc_get_type(
|
||||||
node->private_data, struct ctdb_tcp_node);
|
node->transport_data, struct ctdb_tcp_node);
|
||||||
|
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
node->ctdb->upcalls->node_dead(node);
|
node->ctdb->upcalls->node_dead(node);
|
||||||
@ -85,7 +85,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev,
|
|||||||
{
|
{
|
||||||
struct ctdb_node *node = talloc_get_type(private_data,
|
struct ctdb_node *node = talloc_get_type(private_data,
|
||||||
struct ctdb_node);
|
struct ctdb_node);
|
||||||
struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data,
|
struct ctdb_tcp_node *tnode = talloc_get_type(node->transport_data,
|
||||||
struct ctdb_tcp_node);
|
struct ctdb_tcp_node);
|
||||||
struct ctdb_context *ctdb = node->ctdb;
|
struct ctdb_context *ctdb = node->ctdb;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
@ -165,7 +165,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
|
|||||||
{
|
{
|
||||||
struct ctdb_node *node = talloc_get_type(private_data,
|
struct ctdb_node *node = talloc_get_type(private_data,
|
||||||
struct ctdb_node);
|
struct ctdb_node);
|
||||||
struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data,
|
struct ctdb_tcp_node *tnode = talloc_get_type(node->transport_data,
|
||||||
struct ctdb_tcp_node);
|
struct ctdb_tcp_node);
|
||||||
struct ctdb_context *ctdb = node->ctdb;
|
struct ctdb_context *ctdb = node->ctdb;
|
||||||
ctdb_sock_addr sock_in;
|
ctdb_sock_addr sock_in;
|
||||||
@ -300,7 +300,7 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tnode = talloc_get_type_abort(node->private_data,
|
tnode = talloc_get_type_abort(node->transport_data,
|
||||||
struct ctdb_tcp_node);
|
struct ctdb_tcp_node);
|
||||||
if (tnode == NULL) {
|
if (tnode == NULL) {
|
||||||
/* This can't happen - see ctdb_tcp_initialise() */
|
/* This can't happen - see ctdb_tcp_initialise() */
|
||||||
|
@ -58,7 +58,7 @@ static int ctdb_tcp_add_node(struct ctdb_node *node)
|
|||||||
tnode->out_fd = -1;
|
tnode->out_fd = -1;
|
||||||
tnode->ctdb = node->ctdb;
|
tnode->ctdb = node->ctdb;
|
||||||
|
|
||||||
node->private_data = tnode;
|
node->transport_data = tnode;
|
||||||
talloc_set_destructor(tnode, tnode_destructor);
|
talloc_set_destructor(tnode, tnode_destructor);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -97,7 +97,7 @@ static int ctdb_tcp_connect_node(struct ctdb_node *node)
|
|||||||
{
|
{
|
||||||
struct ctdb_context *ctdb = node->ctdb;
|
struct ctdb_context *ctdb = node->ctdb;
|
||||||
struct ctdb_tcp_node *tnode = talloc_get_type(
|
struct ctdb_tcp_node *tnode = talloc_get_type(
|
||||||
node->private_data, struct ctdb_tcp_node);
|
node->transport_data, struct ctdb_tcp_node);
|
||||||
|
|
||||||
/* startup connection to the other server - will happen on
|
/* startup connection to the other server - will happen on
|
||||||
next event loop */
|
next event loop */
|
||||||
@ -118,7 +118,7 @@ static int ctdb_tcp_connect_node(struct ctdb_node *node)
|
|||||||
static void ctdb_tcp_restart(struct ctdb_node *node)
|
static void ctdb_tcp_restart(struct ctdb_node *node)
|
||||||
{
|
{
|
||||||
struct ctdb_tcp_node *tnode = talloc_get_type(
|
struct ctdb_tcp_node *tnode = talloc_get_type(
|
||||||
node->private_data, struct ctdb_tcp_node);
|
node->transport_data, struct ctdb_tcp_node);
|
||||||
|
|
||||||
DEBUG(DEBUG_NOTICE,("Tearing down connection to dead node :%d\n", node->pnn));
|
DEBUG(DEBUG_NOTICE,("Tearing down connection to dead node :%d\n", node->pnn));
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ static void ctdb_tcp_shutdown(struct ctdb_context *ctdb)
|
|||||||
ctdb->private_data = NULL;
|
ctdb->private_data = NULL;
|
||||||
|
|
||||||
for (i=0; i<ctdb->num_nodes; i++) {
|
for (i=0; i<ctdb->num_nodes; i++) {
|
||||||
TALLOC_FREE(ctdb->nodes[i]->private_data);
|
TALLOC_FREE(ctdb->nodes[i]->transport_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
|
|||||||
{
|
{
|
||||||
struct ctdb_node *node = talloc_get_type_abort(args, struct ctdb_node);
|
struct ctdb_node *node = talloc_get_type_abort(args, struct ctdb_node);
|
||||||
struct ctdb_tcp_node *tnode = talloc_get_type_abort(
|
struct ctdb_tcp_node *tnode = talloc_get_type_abort(
|
||||||
node->private_data, struct ctdb_tcp_node);
|
node->transport_data, struct ctdb_tcp_node);
|
||||||
struct ctdb_req_header *hdr = (struct ctdb_req_header *)data;
|
struct ctdb_req_header *hdr = (struct ctdb_req_header *)data;
|
||||||
|
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
@ -86,7 +86,7 @@ failed:
|
|||||||
*/
|
*/
|
||||||
int ctdb_tcp_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
|
int ctdb_tcp_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
|
||||||
{
|
{
|
||||||
struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data,
|
struct ctdb_tcp_node *tnode = talloc_get_type(node->transport_data,
|
||||||
struct ctdb_tcp_node);
|
struct ctdb_tcp_node);
|
||||||
if (tnode->out_queue == NULL) {
|
if (tnode->out_queue == NULL) {
|
||||||
DBG_DEBUG("No outgoing connection, dropping packet\n");
|
DBG_DEBUG("No outgoing connection, dropping packet\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user