s4-drepl: Pass replication options from DsReplicaSync call
authorKamen Mazdrashki <kamenim@samba.org>
Sat, 26 Feb 2011 18:36:19 +0000 (20:36 +0200)
committerKamen Mazdrashki <kamenim@samba.org>
Sat, 26 Feb 2011 22:23:16 +0000 (00:23 +0200)
source4/dsdb/repl/drepl_extended.c
source4/dsdb/repl/drepl_out_pull.c
source4/dsdb/repl/drepl_service.c
source4/dsdb/repl/drepl_service.h

index cf1c25a097ac0186459ad0cb28d14464d4ea615a..4d645941bbe3d1e8c8a712d9ba51bd0e6434f14a 100644 (file)
@@ -198,7 +198,7 @@ WERROR drepl_request_extended_op(struct dreplsrv_service *service,
        data->sdsa = sdsa;
 
        werr = dreplsrv_schedule_partition_pull_source(service, sdsa,
-                                                      extended_op, fsmo_info,
+                                                      0, extended_op, fsmo_info,
                                                       extended_op_callback, data);
        if (!W_ERROR_IS_OK(werr)) {
                talloc_free(sdsa);
index 11165f4a3edf2c190e1fa8e0743d744b651f6629..0c68cc931056bf475f8a33a3ddb31c4f97433167 100644 (file)
@@ -89,6 +89,7 @@ void drepl_reps_update(struct dreplsrv_service *s, const char *reps_attr,
 
 WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
                                               struct dreplsrv_partition_source_dsa *source,
+                                              uint32_t options,
                                               enum drsuapi_DsExtendedOperation extended_op,
                                               uint64_t fsmo_info,
                                               dreplsrv_extended_callback_t callback,
@@ -101,6 +102,7 @@ WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
 
        op->service     = s;
        op->source_dsa  = source;
+       op->options     = options;
        op->extended_op = extended_op;
        op->fsmo_info   = fsmo_info;
        op->callback    = callback;
@@ -121,7 +123,7 @@ static WERROR dreplsrv_schedule_partition_pull(struct dreplsrv_service *s,
 
        for (cur = p->sources; cur; cur = cur->next) {
                status = dreplsrv_schedule_partition_pull_source(s, cur,
-                                                                DRSUAPI_EXOP_NONE, 0,
+                                                                0, DRSUAPI_EXOP_NONE, 0,
                                                                 NULL, NULL);
                W_ERROR_NOT_OK_RETURN(status);
        }
index ab97ba650d46b1b7aa0a27b56bd4b00aeecdb448..658d597c5d6a94cb84e4d19313a17efd3f08ac23 100644 (file)
@@ -170,6 +170,7 @@ static void _drepl_replica_sync_done_cb(struct dreplsrv_service *service,
 static WERROR _drepl_schedule_replication(struct dreplsrv_service *service,
                                          struct dreplsrv_partition_source_dsa *dsa,
                                          struct drsuapi_DsReplicaObjectIdentifier *nc,
+                                         uint32_t rep_options,
                                          struct drepl_replica_sync_cb_data *data,
                                          TALLOC_CTX *mem_ctx)
 {
@@ -181,7 +182,7 @@ static WERROR _drepl_schedule_replication(struct dreplsrv_service *service,
        }
 
        /* schedule replication item */
-       werr = dreplsrv_schedule_partition_pull_source(service, dsa,
+       werr = dreplsrv_schedule_partition_pull_source(service, dsa, rep_options,
                                                       DRSUAPI_EXOP_NONE, 0,
                                                       fn_callback, data);
        if (!W_ERROR_IS_OK(werr)) {
@@ -277,7 +278,8 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg,
        if (req1->options & DRSUAPI_DRS_SYNC_ALL) {
                for (dsa = p->sources; dsa; dsa = dsa->next) {
                        /* schedule replication item */
-                       werr = _drepl_schedule_replication(service, dsa, nc, cb_data, msg);
+                       werr = _drepl_schedule_replication(service, dsa, nc,
+                                                          req1->options, cb_data, msg);
                        if (!W_ERROR_IS_OK(werr)) {
                                REPLICA_SYNC_FAIL("_drepl_schedule_replication() failed",
                                                  werr);
@@ -311,7 +313,8 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg,
                }
 
                /* schedule replication item */
-               werr = _drepl_schedule_replication(service, dsa, nc, cb_data, msg);
+               werr = _drepl_schedule_replication(service, dsa, nc,
+                                                  req1->options, cb_data, msg);
                if (!W_ERROR_IS_OK(werr)) {
                        REPLICA_SYNC_FAIL("_drepl_schedule_replication() failed",
                                          werr);
index 80f60d6812723945b605c26fd4c79988313905bf..c454ac618ad2285a678d6f9549841cd01c2e159b 100644 (file)
@@ -125,6 +125,8 @@ struct dreplsrv_out_operation {
 
        struct dreplsrv_partition_source_dsa *source_dsa;
 
+       /* replication options - currently used by DsReplicaSync */
+       uint32_t options;
        enum drsuapi_DsExtendedOperation extended_op;
        uint64_t fsmo_info;
        enum drsuapi_DsExtendedError extended_ret;