mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
s4-repl: allow for callbacks when a repl operation completes
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
7a40cacbde
commit
cc7967b1c0
@ -290,7 +290,7 @@ static void dreplsrv_op_pull_source_get_changes_send(struct dreplsrv_op_pull_sou
|
||||
r->in.req->req8.max_object_count = 133;
|
||||
r->in.req->req8.max_ndr_size = 1336811;
|
||||
r->in.req->req8.extended_op = st->op->extended_op;
|
||||
r->in.req->req8.fsmo_info = 0;
|
||||
r->in.req->req8.fsmo_info = st->op->fsmo_info;
|
||||
r->in.req->req8.partial_attribute_set = NULL;
|
||||
r->in.req->req8.partial_attribute_set_ex= NULL;
|
||||
r->in.req->req8.mapping_ctr.num_mappings= 0;
|
||||
@ -306,7 +306,7 @@ static void dreplsrv_op_pull_source_get_changes_send(struct dreplsrv_op_pull_sou
|
||||
r->in.req->req5.max_object_count = 133;
|
||||
r->in.req->req5.max_ndr_size = 1336770;
|
||||
r->in.req->req5.extended_op = st->op->extended_op;
|
||||
r->in.req->req5.fsmo_info = 0;
|
||||
r->in.req->req5.fsmo_info = st->op->fsmo_info;
|
||||
}
|
||||
|
||||
req = dcerpc_drsuapi_DsGetNCChanges_send(drsuapi->pipe, r, r);
|
||||
|
@ -35,7 +35,9 @@
|
||||
|
||||
WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
|
||||
struct dreplsrv_partition_source_dsa *source,
|
||||
enum drsuapi_DsExtendedOperation extended_op)
|
||||
enum drsuapi_DsExtendedOperation extended_op,
|
||||
uint64_t fsmo_info,
|
||||
dreplsrv_fsmo_callback_t callback)
|
||||
{
|
||||
struct dreplsrv_out_operation *op;
|
||||
|
||||
@ -45,6 +47,8 @@ WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
|
||||
op->service = s;
|
||||
op->source_dsa = source;
|
||||
op->extended_op = extended_op;
|
||||
op->fsmo_info = fsmo_info;
|
||||
op->callback = callback;
|
||||
|
||||
DLIST_ADD_END(s->ops.pending, op, struct dreplsrv_out_operation *);
|
||||
|
||||
@ -59,7 +63,7 @@ static WERROR dreplsrv_schedule_partition_pull(struct dreplsrv_service *s,
|
||||
struct dreplsrv_partition_source_dsa *cur;
|
||||
|
||||
for (cur = p->sources; cur; cur = cur->next) {
|
||||
status = dreplsrv_schedule_partition_pull_source(s, cur, DRSUAPI_EXOP_NONE);
|
||||
status = dreplsrv_schedule_partition_pull_source(s, cur, DRSUAPI_EXOP_NONE, 0, NULL);
|
||||
W_ERROR_NOT_OK_RETURN(status);
|
||||
}
|
||||
|
||||
@ -122,6 +126,9 @@ static void dreplsrv_pending_op_callback(struct dreplsrv_out_operation *op)
|
||||
rf->consecutive_sync_failures));
|
||||
|
||||
done:
|
||||
if (op->callback) {
|
||||
op->callback(s, rf->result_last_attempt);
|
||||
}
|
||||
talloc_free(op);
|
||||
s->ops.current = NULL;
|
||||
dreplsrv_run_pending_ops(s);
|
||||
|
@ -100,6 +100,8 @@ struct dreplsrv_partition {
|
||||
struct dreplsrv_partition_source_dsa *sources;
|
||||
};
|
||||
|
||||
typedef void (*dreplsrv_fsmo_callback_t)(struct dreplsrv_service *, WERROR );
|
||||
|
||||
struct dreplsrv_out_operation {
|
||||
struct dreplsrv_out_operation *prev, *next;
|
||||
|
||||
@ -110,6 +112,8 @@ struct dreplsrv_out_operation {
|
||||
struct composite_context *creq;
|
||||
|
||||
enum drsuapi_DsExtendedOperation extended_op;
|
||||
uint64_t fsmo_info;
|
||||
dreplsrv_fsmo_callback_t callback;
|
||||
};
|
||||
|
||||
struct dreplsrv_notify_operation {
|
||||
@ -208,6 +212,7 @@ struct dreplsrv_service {
|
||||
} ops;
|
||||
|
||||
struct {
|
||||
bool in_progress;
|
||||
struct dreplsrv_partition_source_dsa *rid_manager_source_dsa;
|
||||
} ridalloc;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user