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:
parent
53f8492caa
commit
750f3938e4
@ -40,7 +40,8 @@
|
||||
|
||||
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);
|
||||
|
||||
@ -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)
|
||||
{
|
||||
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);
|
||||
|
||||
assert(cn!=NULL);
|
||||
@ -246,7 +248,7 @@ int ctdb_ibw_init(struct ctdb_context *ctdb)
|
||||
}
|
||||
|
||||
ctdb->methods = &ctdb_ibw_methods;
|
||||
ctdb->private_data = ictx;
|
||||
ctdb->transport_data = ictx;
|
||||
|
||||
DEBUG(DEBUG_DEBUG, ("ctdb_ibw_init succeeded.\n"));
|
||||
return 0;
|
||||
|
@ -286,7 +286,7 @@ struct ctdb_context {
|
||||
char *err_msg;
|
||||
const struct ctdb_methods *methods; /* transport methods */
|
||||
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 srvid_context *srv;
|
||||
struct srvid_context *tunnels;
|
||||
|
@ -277,7 +277,8 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
|
||||
uint16_t flags, void *private_data)
|
||||
{
|
||||
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;
|
||||
socklen_t len;
|
||||
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)
|
||||
{
|
||||
struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private_data,
|
||||
struct ctdb_tcp *ctcp = talloc_get_type(ctdb->transport_data,
|
||||
struct ctdb_tcp);
|
||||
ctdb_sock_addr sock;
|
||||
int lock_fd;
|
||||
@ -509,7 +510,7 @@ failed:
|
||||
*/
|
||||
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);
|
||||
ctdb_sock_addr sock;
|
||||
int sock_size;
|
||||
|
@ -135,12 +135,12 @@ static void ctdb_tcp_restart(struct ctdb_node *node)
|
||||
*/
|
||||
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);
|
||||
uint32_t i;
|
||||
|
||||
talloc_free(ctcp);
|
||||
ctdb->private_data = NULL;
|
||||
ctdb->transport_data = NULL;
|
||||
|
||||
for (i=0; i<ctdb->num_nodes; i++) {
|
||||
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)
|
||||
{
|
||||
ctcp->ctdb->private_data = NULL;
|
||||
ctcp->ctdb->transport_data = NULL;
|
||||
ctcp->ctdb->methods = NULL;
|
||||
|
||||
return 0;
|
||||
@ -209,7 +209,7 @@ int ctdb_tcp_init(struct ctdb_context *ctdb)
|
||||
|
||||
ctcp->listen_fd = -1;
|
||||
ctcp->ctdb = ctdb;
|
||||
ctdb->private_data = ctcp;
|
||||
ctdb->transport_data = ctcp;
|
||||
ctdb->methods = &ctdb_tcp_methods;
|
||||
|
||||
talloc_set_destructor(ctcp, tcp_ctcp_destructor);
|
||||
|
Loading…
Reference in New Issue
Block a user