mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-recovery: Drop unnecessary database push wrapper
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
225a699633
commit
f4e2206e88
@ -1195,67 +1195,6 @@ static bool push_database_new_recv(struct tevent_req *req, int *perr)
|
||||
return generic_recv(req, perr);
|
||||
}
|
||||
|
||||
/*
|
||||
* wrapper for push_database_new
|
||||
*/
|
||||
|
||||
struct push_database_state {
|
||||
};
|
||||
|
||||
static void push_database_new_done(struct tevent_req *subreq);
|
||||
|
||||
static struct tevent_req *push_database_send(
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
struct ctdb_client_context *client,
|
||||
struct node_list *nlist,
|
||||
struct ctdb_tunable_list *tun_list,
|
||||
struct recdb_context *recdb)
|
||||
{
|
||||
struct tevent_req *req, *subreq;
|
||||
struct push_database_state *state;
|
||||
|
||||
req = tevent_req_create(mem_ctx, &state, struct push_database_state);
|
||||
if (req == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
subreq = push_database_new_send(state,
|
||||
ev,
|
||||
client,
|
||||
nlist->pnn_list,
|
||||
nlist->count,
|
||||
recdb,
|
||||
tun_list->rec_buffer_size_limit);
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
tevent_req_set_callback(subreq, push_database_new_done, req);
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
static void push_database_new_done(struct tevent_req *subreq)
|
||||
{
|
||||
struct tevent_req *req = tevent_req_callback_data(
|
||||
subreq, struct tevent_req);
|
||||
bool status;
|
||||
int ret;
|
||||
|
||||
status = push_database_new_recv(subreq, &ret);
|
||||
if (! status) {
|
||||
tevent_req_error(req, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
tevent_req_done(req);
|
||||
}
|
||||
|
||||
static bool push_database_recv(struct tevent_req *req, int *perr)
|
||||
{
|
||||
return generic_recv(req, perr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Collect databases using highest sequence number
|
||||
*/
|
||||
@ -1933,12 +1872,13 @@ static void recover_db_wipedb_done(struct tevent_req *subreq)
|
||||
return;
|
||||
}
|
||||
|
||||
subreq = push_database_send(state,
|
||||
state->ev,
|
||||
state->client,
|
||||
state->nlist,
|
||||
state->tun_list,
|
||||
state->recdb);
|
||||
subreq = push_database_new_send(state,
|
||||
state->ev,
|
||||
state->client,
|
||||
state->nlist->pnn_list,
|
||||
state->nlist->count,
|
||||
state->recdb,
|
||||
state->tun_list->rec_buffer_size_limit);
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return;
|
||||
}
|
||||
@ -1955,7 +1895,7 @@ static void recover_db_pushdb_done(struct tevent_req *subreq)
|
||||
int ret;
|
||||
bool status;
|
||||
|
||||
status = push_database_recv(subreq, &ret);
|
||||
status = push_database_new_recv(subreq, &ret);
|
||||
TALLOC_FREE(subreq);
|
||||
if (! status) {
|
||||
tevent_req_error(req, ret);
|
||||
|
Loading…
Reference in New Issue
Block a user