diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-08-31 00:01:25 +0300 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-09-03 13:23:47 +0300 |
commit | 5685fb64e4f4660d586e57c59800d0f374d10749 (patch) | |
tree | db54debf0aace8911916e8d81e48308b671180bb /source4/dsdb | |
parent | cf728f890f6d2cd8cc831ba95a5d2d0dac6e8e35 (diff) | |
download | samba-5685fb64e4f4660d586e57c59800d0f374d10749.tar.gz samba-5685fb64e4f4660d586e57c59800d0f374d10749.tar.bz2 samba-5685fb64e4f4660d586e57c59800d0f374d10749.zip |
s4-dreplsrv: Add caller-specific data parameter for dreplsrv_fsmo_callback_t
It is to be used when we need to preserve a state
to be used in tha callback when dreplsrv_out_operation is completed
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/repl/drepl_out_pull.c | 10 | ||||
-rw-r--r-- | source4/dsdb/repl/drepl_ridalloc.c | 5 | ||||
-rw-r--r-- | source4/dsdb/repl/drepl_service.h | 6 |
3 files changed, 14 insertions, 7 deletions
diff --git a/source4/dsdb/repl/drepl_out_pull.c b/source4/dsdb/repl/drepl_out_pull.c index e9b57a1fec..db77a4e1de 100644 --- a/source4/dsdb/repl/drepl_out_pull.c +++ b/source4/dsdb/repl/drepl_out_pull.c @@ -38,7 +38,8 @@ WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s, struct dreplsrv_partition_source_dsa *source, enum drsuapi_DsExtendedOperation extended_op, uint64_t fsmo_info, - dreplsrv_fsmo_callback_t callback) + dreplsrv_fsmo_callback_t callback, + void *cb_data) { struct dreplsrv_out_operation *op; @@ -50,6 +51,7 @@ WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s, op->extended_op = extended_op; op->fsmo_info = fsmo_info; op->callback = callback; + op->cb_data = cb_data; DLIST_ADD_END(s->ops.pending, op, struct dreplsrv_out_operation *); @@ -64,7 +66,9 @@ 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, 0, NULL); + status = dreplsrv_schedule_partition_pull_source(s, cur, + DRSUAPI_EXOP_NONE, 0, + NULL, NULL); W_ERROR_NOT_OK_RETURN(status); } @@ -160,7 +164,7 @@ static void dreplsrv_pending_op_callback(struct tevent_req *subreq) done: if (op->callback) { - op->callback(s, rf->result_last_attempt, op->extended_ret); + op->callback(s, rf->result_last_attempt, op->extended_ret, op->cb_data); } talloc_free(op); s->ops.current = NULL; diff --git a/source4/dsdb/repl/drepl_ridalloc.c b/source4/dsdb/repl/drepl_ridalloc.c index c036228ee7..6d4b0da04b 100644 --- a/source4/dsdb/repl/drepl_ridalloc.c +++ b/source4/dsdb/repl/drepl_ridalloc.c @@ -102,7 +102,8 @@ static WERROR drepl_create_rid_manager_source_dsa(struct dreplsrv_service *servi */ static void drepl_new_rid_pool_callback(struct dreplsrv_service *service, WERROR werr, - enum drsuapi_DsExtendedError ext_err) + enum drsuapi_DsExtendedError ext_err, + void *cb_data) { if (!W_ERROR_IS_OK(werr)) { DEBUG(0,(__location__ ": RID Manager failed RID allocation - %s - extended_ret[0x%X]\n", @@ -139,7 +140,7 @@ static WERROR drepl_request_new_rid_pool(struct dreplsrv_service *service, werr = dreplsrv_schedule_partition_pull_source(service, service->ridalloc.rid_manager_source_dsa, DRSUAPI_EXOP_FSMO_RID_ALLOC, alloc_pool, - drepl_new_rid_pool_callback); + drepl_new_rid_pool_callback, NULL); return werr; } diff --git a/source4/dsdb/repl/drepl_service.h b/source4/dsdb/repl/drepl_service.h index 4019bf7307..00fd3bfbd8 100644 --- a/source4/dsdb/repl/drepl_service.h +++ b/source4/dsdb/repl/drepl_service.h @@ -105,7 +105,8 @@ struct dreplsrv_partition { typedef void (*dreplsrv_fsmo_callback_t)(struct dreplsrv_service *, WERROR, - enum drsuapi_DsExtendedError); + enum drsuapi_DsExtendedError, + void *cb_data); struct dreplsrv_out_operation { struct dreplsrv_out_operation *prev, *next; @@ -116,8 +117,9 @@ struct dreplsrv_out_operation { enum drsuapi_DsExtendedOperation extended_op; uint64_t fsmo_info; - dreplsrv_fsmo_callback_t callback; enum drsuapi_DsExtendedError extended_ret; + dreplsrv_fsmo_callback_t callback; + void *cb_data; }; struct dreplsrv_notify_operation { |