1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-daemon: Rename ctdb_context 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:
Martin Schwenke 2019-11-12 12:12:46 +11:00 committed by Amitay Isaacs
parent 53f8492caa
commit 750f3938e4
4 changed files with 14 additions and 11 deletions

View File

@ -40,7 +40,8 @@
static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog) static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog)
{ {
struct ibw_ctx *ictx = talloc_get_type(ctdb->private_data, struct ibw_ctx); struct ibw_ctx *ictx = talloc_get_type(ctdb->transport_data,
struct ibw_ctx);
assert(ictx!=NULL); assert(ictx!=NULL);
@ -62,7 +63,8 @@ static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog)
*/ */
static int ctdb_ibw_add_node(struct ctdb_node *node) static int ctdb_ibw_add_node(struct ctdb_node *node)
{ {
struct ibw_ctx *ictx = talloc_get_type(node->ctdb->private_data, struct ibw_ctx); struct ibw_ctx *ictx = talloc_get_type(node->ctdb->transport_data,
struct ibw_ctx);
struct ctdb_ibw_node *cn = talloc_zero(node, struct ctdb_ibw_node); struct ctdb_ibw_node *cn = talloc_zero(node, struct ctdb_ibw_node);
assert(cn!=NULL); assert(cn!=NULL);
@ -246,7 +248,7 @@ int ctdb_ibw_init(struct ctdb_context *ctdb)
} }
ctdb->methods = &ctdb_ibw_methods; ctdb->methods = &ctdb_ibw_methods;
ctdb->private_data = ictx; ctdb->transport_data = ictx;
DEBUG(DEBUG_DEBUG, ("ctdb_ibw_init succeeded.\n")); DEBUG(DEBUG_DEBUG, ("ctdb_ibw_init succeeded.\n"));
return 0; return 0;

View File

@ -286,7 +286,7 @@ struct ctdb_context {
char *err_msg; char *err_msg;
const struct ctdb_methods *methods; /* transport methods */ const struct ctdb_methods *methods; /* transport methods */
const struct ctdb_upcalls *upcalls; /* transport upcalls */ const struct ctdb_upcalls *upcalls; /* transport upcalls */
void *private_data; /* private to transport */ void *transport_data; /* private to transport */
struct ctdb_db_context *db_list; struct ctdb_db_context *db_list;
struct srvid_context *srv; struct srvid_context *srv;
struct srvid_context *tunnels; struct srvid_context *tunnels;

View File

@ -277,7 +277,8 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
uint16_t flags, void *private_data) uint16_t flags, void *private_data)
{ {
struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context); struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private_data, struct ctdb_tcp); struct ctdb_tcp *ctcp = talloc_get_type(ctdb->transport_data,
struct ctdb_tcp);
ctdb_sock_addr addr; ctdb_sock_addr addr;
socklen_t len; socklen_t len;
int fd; int fd;
@ -368,7 +369,7 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
*/ */
static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb) static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
{ {
struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private_data, struct ctdb_tcp *ctcp = talloc_get_type(ctdb->transport_data,
struct ctdb_tcp); struct ctdb_tcp);
ctdb_sock_addr sock; ctdb_sock_addr sock;
int lock_fd; int lock_fd;
@ -509,7 +510,7 @@ failed:
*/ */
int ctdb_tcp_listen(struct ctdb_context *ctdb) int ctdb_tcp_listen(struct ctdb_context *ctdb)
{ {
struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private_data, struct ctdb_tcp *ctcp = talloc_get_type(ctdb->transport_data,
struct ctdb_tcp); struct ctdb_tcp);
ctdb_sock_addr sock; ctdb_sock_addr sock;
int sock_size; int sock_size;

View File

@ -135,12 +135,12 @@ static void ctdb_tcp_restart(struct ctdb_node *node)
*/ */
static void ctdb_tcp_shutdown(struct ctdb_context *ctdb) static void ctdb_tcp_shutdown(struct ctdb_context *ctdb)
{ {
struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private_data, struct ctdb_tcp *ctcp = talloc_get_type(ctdb->transport_data,
struct ctdb_tcp); struct ctdb_tcp);
uint32_t i; uint32_t i;
talloc_free(ctcp); talloc_free(ctcp);
ctdb->private_data = NULL; ctdb->transport_data = NULL;
for (i=0; i<ctdb->num_nodes; i++) { for (i=0; i<ctdb->num_nodes; i++) {
TALLOC_FREE(ctdb->nodes[i]->transport_data); TALLOC_FREE(ctdb->nodes[i]->transport_data);
@ -191,7 +191,7 @@ static const struct ctdb_methods ctdb_tcp_methods = {
static int tcp_ctcp_destructor(struct ctdb_tcp *ctcp) static int tcp_ctcp_destructor(struct ctdb_tcp *ctcp)
{ {
ctcp->ctdb->private_data = NULL; ctcp->ctdb->transport_data = NULL;
ctcp->ctdb->methods = NULL; ctcp->ctdb->methods = NULL;
return 0; return 0;
@ -209,7 +209,7 @@ int ctdb_tcp_init(struct ctdb_context *ctdb)
ctcp->listen_fd = -1; ctcp->listen_fd = -1;
ctcp->ctdb = ctdb; ctcp->ctdb = ctdb;
ctdb->private_data = ctcp; ctdb->transport_data = ctcp;
ctdb->methods = &ctdb_tcp_methods; ctdb->methods = &ctdb_tcp_methods;
talloc_set_destructor(ctcp, tcp_ctcp_destructor); talloc_set_destructor(ctcp, tcp_ctcp_destructor);