4 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2006
6 * NOTICE: this module is NOT released under the GNU LGPL license as
7 * other ldb code. This module is release under the GNU GPL v2 or
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 * Component: ldb partitions module
30 * Description: Implement LDAP partitions
32 * Author: Andrew Bartlett
36 #include "ldb/include/includes.h"
39 struct ldb_module *module;
43 struct partition_private_data {
44 struct partition **partitions;
45 struct ldb_dn **replicate;
48 struct partition_context {
49 struct ldb_module *module;
50 struct ldb_request *orig_req;
52 struct ldb_request **down_req;
54 int finished_requests;
57 static struct ldb_handle *partition_init_handle(struct ldb_request *req, struct ldb_module *module)
59 struct partition_context *ac;
62 h = talloc_zero(req, struct ldb_handle);
64 ldb_set_errstring(module->ldb, "Out of Memory");
70 ac = talloc_zero(h, struct partition_context);
72 ldb_set_errstring(module->ldb, "Out of Memory");
77 h->private_data = (void *)ac;
85 struct ldb_module *make_module_for_next_request(TALLOC_CTX *mem_ctx,
86 struct ldb_context *ldb,
87 struct ldb_module *module)
89 struct ldb_module *current;
90 static const struct ldb_module_ops ops; /* zero */
91 current = talloc_zero(mem_ctx, struct ldb_module);
92 if (current == NULL) {
99 current->next = module;
103 struct ldb_module *find_backend(struct ldb_module *module, struct ldb_request *req, struct ldb_dn *dn)
106 struct partition_private_data *data = talloc_get_type(module->private_data,
107 struct partition_private_data);
108 /* Look at base DN */
109 /* Figure out which partition it is under */
110 /* Skip the lot if 'data' isn't here yet (initialistion) */
111 for (i=0; data && data->partitions && data->partitions[i]; i++) {
112 if (ldb_dn_compare_base(data->partitions[i]->dn, dn) == 0) {
113 return make_module_for_next_request(req, module->ldb, data->partitions[i]->module);
122 fire the caller's callback for every entry, but only send 'done' once.
124 static int partition_search_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
126 struct partition_context *ac;
128 if (!context || !ares) {
129 ldb_set_errstring(ldb, "partition_search_callback: NULL Context or Result in 'search' callback");
133 ac = talloc_get_type(context, struct partition_context);
135 if (ares->type == LDB_REPLY_ENTRY) {
136 return ac->orig_req->callback(ldb, ac->orig_req->context, ares);
138 ac->finished_requests++;
139 if (ac->finished_requests == ac->num_requests) {
140 return ac->orig_req->callback(ldb, ac->orig_req->context, ares);
148 return LDB_ERR_OPERATIONS_ERROR;
152 only fire the 'last' callback, and only for START-TLS for now
154 static int partition_other_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
156 struct partition_context *ac;
159 ldb_set_errstring(ldb, "partition_other_callback: NULL Context in 'other' callback");
163 ac = talloc_get_type(context, struct partition_context);
165 if (!ac->orig_req->callback) {
171 || (ares->type == LDB_REPLY_EXTENDED
172 && strcmp(ares->response->oid, LDB_EXTENDED_START_TLS_OID))) {
173 ac->finished_requests++;
174 if (ac->finished_requests == ac->num_requests) {
175 return ac->orig_req->callback(ldb, ac->orig_req->context, ares);
180 ldb_set_errstring(ldb, "partition_other_callback: Unknown reply type, only supports START_TLS");
183 return LDB_ERR_OPERATIONS_ERROR;
187 static int partition_send_request(struct partition_context *ac, struct ldb_module *partition,
188 struct ldb_dn *partition_base_dn)
191 struct ldb_module *next = make_module_for_next_request(ac->module, ac->module->ldb, partition);
192 struct ldb_request *req;
193 ac->down_req = talloc_realloc(ac, ac->down_req,
194 struct ldb_request *, ac->num_requests + 1);
196 ldb_set_errstring(ac->module->ldb, "Out of Memory");
197 return LDB_ERR_OPERATIONS_ERROR;
199 req = ac->down_req[ac->num_requests] = talloc(ac, struct ldb_request);
201 ldb_set_errstring(ac->module->ldb, "Out of Memory");
202 return LDB_ERR_OPERATIONS_ERROR;
205 *ac->down_req[ac->num_requests] = *ac->orig_req; /* copy the request */
207 if (req->operation == LDB_SEARCH) {
208 /* If the search is for 'more' than this partition,
209 * then change the basedn, so a remote LDAP server
211 if (ldb_dn_compare_base(partition_base_dn, req->op.search.base) != 0) {
212 req->op.search.base = partition_base_dn;
214 req->callback = partition_search_callback;
217 req->callback = partition_other_callback;
221 /* Spray off search requests to all backends */
222 ret = ldb_next_request(next, req);
223 if (ret != LDB_SUCCESS) {
231 /* Send a request down to all the partitions */
232 static int partition_send_all(struct ldb_module *module,
233 struct partition_context *ac, struct ldb_request *req)
236 struct partition_private_data *data = talloc_get_type(module->private_data,
237 struct partition_private_data);
238 int ret = partition_send_request(ac, module->next, NULL);
239 if (ret != LDB_SUCCESS) {
242 for (i=0; data && data->partitions && data->partitions[i]; i++) {
243 ret = partition_send_request(ac, data->partitions[i]->module, data->partitions[i]->dn);
244 if (ret != LDB_SUCCESS) {
251 /* Figure out which backend a request needs to be aimed at. Some
252 * requests must be replicated to all backends */
253 static int partition_replicate(struct ldb_module *module, struct ldb_request *req, struct ldb_dn *dn)
256 struct ldb_module *backend;
257 struct partition_private_data *data = talloc_get_type(module->private_data,
258 struct partition_private_data);
260 /* Is this a special DN, we need to replicate to every backend? */
261 for (i=0; data->replicate && data->replicate[i]; i++) {
262 if (ldb_dn_compare(data->replicate[i],
264 struct ldb_handle *h;
265 struct partition_context *ac;
267 h = partition_init_handle(req, module);
269 return LDB_ERR_OPERATIONS_ERROR;
271 /* return our own handle to deal with this call */
274 ac = talloc_get_type(h->private_data, struct partition_context);
276 return partition_send_all(module, ac, req);
280 /* Otherwise, we need to find the backend to fire it to */
283 backend = find_backend(module, req, dn);
286 return ldb_next_request(backend, req);
291 static int partition_search(struct ldb_module *module, struct ldb_request *req)
294 struct partition_private_data *data = talloc_get_type(module->private_data,
295 struct partition_private_data);
298 /* (later) consider if we should be searching multiple
299 * partitions (for 'invisible' partition behaviour */
300 if (ldb_get_opaque(module->ldb, "global_catalog")) {
302 struct ldb_handle *h;
303 struct partition_context *ac;
305 h = partition_init_handle(req, module);
307 return LDB_ERR_OPERATIONS_ERROR;
309 /* return our own handle to deal with this call */
312 ac = talloc_get_type(h->private_data, struct partition_context);
314 /* Search from the base DN */
315 if (!req->op.search.base || ldb_dn_is_null(req->op.search.base)) {
316 return partition_send_all(module, ac, req);
318 for (i=0; data && data->partitions && data->partitions[i]; i++) {
319 /* Find all partitions under the search base */
320 if (ldb_dn_compare_base(req->op.search.base, data->partitions[i]->dn) == 0) {
321 ret = partition_send_request(ac, data->partitions[i]->module, data->partitions[i]->dn);
322 if (ret != LDB_SUCCESS) {
328 /* Perhaps we didn't match any partitions. Try the main partition, only */
329 if (ac->num_requests == 0) {
331 return ldb_next_request(module, req);
336 struct ldb_module *backend = find_backend(module, req, req->op.search.base);
338 return ldb_next_request(backend, req);
343 static int partition_add(struct ldb_module *module, struct ldb_request *req)
345 return partition_replicate(module, req, req->op.add.message->dn);
349 static int partition_modify(struct ldb_module *module, struct ldb_request *req)
351 return partition_replicate(module, req, req->op.mod.message->dn);
355 static int partition_delete(struct ldb_module *module, struct ldb_request *req)
357 return partition_replicate(module, req, req->op.del.dn);
361 static int partition_rename(struct ldb_module *module, struct ldb_request *req)
364 struct ldb_module *backend = find_backend(module, req, req->op.rename.olddn);
365 struct ldb_module *backend2 = find_backend(module, req, req->op.rename.newdn);
367 if (backend->next != backend2->next) {
368 return LDB_ERR_AFFECTS_MULTIPLE_DSAS;
371 return partition_replicate(module, req, req->op.rename.olddn);
374 /* start a transaction */
375 static int partition_start_trans(struct ldb_module *module)
378 struct partition_private_data *data = talloc_get_type(module->private_data,
379 struct partition_private_data);
380 /* Look at base DN */
381 /* Figure out which partition it is under */
382 /* Skip the lot if 'data' isn't here yet (initialistion) */
383 ret = ldb_next_start_trans(module);
384 if (ret != LDB_SUCCESS) {
388 for (i=0; data && data->partitions && data->partitions[i]; i++) {
389 struct ldb_module *next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
391 ret = ldb_next_start_trans(next);
393 if (ret != LDB_SUCCESS) {
394 /* Back it out, if it fails on one */
395 for (i--; i >= 0; i--) {
396 next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
397 ldb_next_del_trans(next);
406 /* end a transaction */
407 static int partition_end_trans(struct ldb_module *module)
409 int i, ret, ret2 = LDB_SUCCESS;
410 struct partition_private_data *data = talloc_get_type(module->private_data,
411 struct partition_private_data);
412 ret = ldb_next_end_trans(module);
413 if (ret != LDB_SUCCESS) {
417 /* Look at base DN */
418 /* Figure out which partition it is under */
419 /* Skip the lot if 'data' isn't here yet (initialistion) */
420 for (i=0; data && data->partitions && data->partitions[i]; i++) {
421 struct ldb_module *next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
423 ret = ldb_next_end_trans(next);
425 if (ret != LDB_SUCCESS) {
430 if (ret != LDB_SUCCESS) {
431 /* Back it out, if it fails on one */
432 for (i=0; data && data->partitions && data->partitions[i]; i++) {
433 struct ldb_module *next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
434 ldb_next_del_trans(next);
441 /* delete a transaction */
442 static int partition_del_trans(struct ldb_module *module)
444 int i, ret, ret2 = LDB_SUCCESS;
445 struct partition_private_data *data = talloc_get_type(module->private_data,
446 struct partition_private_data);
447 ret = ldb_next_del_trans(module);
448 if (ret != LDB_SUCCESS) {
452 /* Look at base DN */
453 /* Figure out which partition it is under */
454 /* Skip the lot if 'data' isn't here yet (initialistion) */
455 for (i=0; data && data->partitions && data->partitions[i]; i++) {
456 struct ldb_module *next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
458 ret = ldb_next_del_trans(next);
460 if (ret != LDB_SUCCESS) {
467 static int partition_sequence_number(struct ldb_module *module, struct ldb_request *req)
470 uint64_t seq_number = 0;
471 uint64_t timestamp_sequence = 0;
472 uint64_t timestamp = 0;
473 struct partition_private_data *data = talloc_get_type(module->private_data,
474 struct partition_private_data);
476 switch (req->op.seq_num.type) {
478 case LDB_SEQ_HIGHEST_SEQ:
479 ret = ldb_next_request(module, req);
480 if (ret != LDB_SUCCESS) {
483 if (req->op.seq_num.flags & LDB_SEQ_TIMESTAMP_SEQUENCE) {
484 timestamp_sequence = req->op.seq_num.seq_num;
486 seq_number = seq_number + req->op.seq_num.seq_num;
489 /* Look at base DN */
490 /* Figure out which partition it is under */
491 /* Skip the lot if 'data' isn't here yet (initialistion) */
492 for (i=0; data && data->partitions && data->partitions[i]; i++) {
493 struct ldb_module *next = make_module_for_next_request(req, module->ldb, data->partitions[i]->module);
495 ret = ldb_next_request(next, req);
497 if (ret != LDB_SUCCESS) {
500 if (req->op.seq_num.flags & LDB_SEQ_TIMESTAMP_SEQUENCE) {
501 timestamp_sequence = MAX(timestamp_sequence, req->op.seq_num.seq_num);
503 seq_number = seq_number + req->op.seq_num.seq_num;
507 case LDB_SEQ_HIGHEST_TIMESTAMP:
509 struct ldb_request *date_req = talloc(req, struct ldb_request);
511 return LDB_ERR_OPERATIONS_ERROR;
514 date_req->op.seq_num.flags = LDB_SEQ_HIGHEST_TIMESTAMP;
516 ret = ldb_next_request(module, date_req);
517 if (ret != LDB_SUCCESS) {
520 timestamp = date_req->op.seq_num.seq_num;
522 /* Look at base DN */
523 /* Figure out which partition it is under */
524 /* Skip the lot if 'data' isn't here yet (initialistion) */
525 for (i=0; data && data->partitions && data->partitions[i]; i++) {
526 struct ldb_module *next = make_module_for_next_request(req, module->ldb, data->partitions[i]->module);
528 ret = ldb_next_request(next, date_req);
530 if (ret != LDB_SUCCESS) {
533 timestamp = MAX(timestamp, date_req->op.seq_num.seq_num);
539 switch (req->op.seq_num.flags) {
541 case LDB_SEQ_HIGHEST_SEQ:
543 req->op.seq_num.flags = 0;
545 /* Has someone above set a timebase sequence? */
546 if (timestamp_sequence) {
547 req->op.seq_num.seq_num = (((unsigned long long)timestamp << 24) | (seq_number & 0xFFFFFF));
549 req->op.seq_num.seq_num = seq_number;
552 if (timestamp_sequence > req->op.seq_num.seq_num) {
553 req->op.seq_num.seq_num = timestamp_sequence;
554 req->op.seq_num.flags |= LDB_SEQ_TIMESTAMP_SEQUENCE;
557 req->op.seq_num.flags |= LDB_SEQ_GLOBAL_SEQUENCE;
559 case LDB_SEQ_HIGHEST_TIMESTAMP:
560 req->op.seq_num.seq_num = timestamp;
564 switch (req->op.seq_num.flags) {
566 req->op.seq_num.seq_num++;
571 static int sort_compare(void *void1,
572 void *void2, void *opaque)
574 struct partition **pp1 = void1;
575 struct partition **pp2 = void2;
576 struct partition *partition1 = talloc_get_type(*pp1, struct partition);
577 struct partition *partition2 = talloc_get_type(*pp2, struct partition);
579 return ldb_dn_compare(partition1->dn, partition2->dn);
582 static int partition_init(struct ldb_module *module)
585 TALLOC_CTX *mem_ctx = talloc_new(module);
586 static const char *attrs[] = { "partition", "replicateEntries", "modules", NULL };
587 struct ldb_result *res;
588 struct ldb_message *msg;
589 struct ldb_message_element *partition_attributes;
590 struct ldb_message_element *replicate_attributes;
591 struct ldb_message_element *modules_attributes;
593 struct partition_private_data *data;
596 return LDB_ERR_OPERATIONS_ERROR;
599 data = talloc(mem_ctx, struct partition_private_data);
601 return LDB_ERR_OPERATIONS_ERROR;
604 ret = ldb_search(module->ldb, ldb_dn_new(mem_ctx, module->ldb, "@PARTITION"),
608 if (ret != LDB_SUCCESS) {
609 talloc_free(mem_ctx);
612 talloc_steal(mem_ctx, res);
613 if (res->count == 0) {
614 talloc_free(mem_ctx);
615 return ldb_next_init(module);
618 if (res->count > 1) {
619 talloc_free(mem_ctx);
620 return LDB_ERR_CONSTRAINT_VIOLATION;
625 partition_attributes = ldb_msg_find_element(msg, "partition");
626 if (!partition_attributes) {
627 ldb_set_errstring(module->ldb, "partition_init: no partitions specified");
628 talloc_free(mem_ctx);
629 return LDB_ERR_CONSTRAINT_VIOLATION;
631 data->partitions = talloc_array(data, struct partition *, partition_attributes->num_values + 1);
632 if (!data->partitions) {
633 talloc_free(mem_ctx);
634 return LDB_ERR_OPERATIONS_ERROR;
636 for (i=0; i < partition_attributes->num_values; i++) {
637 char *base = talloc_strdup(data->partitions, (char *)partition_attributes->values[i].data);
638 char *p = strchr(base, ':');
640 ldb_asprintf_errstring(module->ldb,
642 "invalid form for partition record (missing ':'): %s", base);
643 talloc_free(mem_ctx);
644 return LDB_ERR_CONSTRAINT_VIOLATION;
649 ldb_asprintf_errstring(module->ldb,
651 "invalid form for partition record (missing backend database): %s", base);
652 talloc_free(mem_ctx);
653 return LDB_ERR_CONSTRAINT_VIOLATION;
655 data->partitions[i] = talloc(data->partitions, struct partition);
656 if (!data->partitions[i]) {
657 talloc_free(mem_ctx);
658 return LDB_ERR_OPERATIONS_ERROR;
661 data->partitions[i]->dn = ldb_dn_new(data->partitions[i], module->ldb, base);
662 if (!data->partitions[i]->dn) {
663 ldb_asprintf_errstring(module->ldb,
664 "partition_init: invalid DN in partition record: %s", base);
665 talloc_free(mem_ctx);
666 return LDB_ERR_CONSTRAINT_VIOLATION;
669 data->partitions[i]->backend = private_path(data->partitions[i], p);
670 ret = ldb_connect_backend(module->ldb, data->partitions[i]->backend, NULL, &data->partitions[i]->module);
671 if (ret != LDB_SUCCESS) {
672 talloc_free(mem_ctx);
676 data->partitions[i] = NULL;
678 /* sort these into order, most to least specific */
679 ldb_qsort(data->partitions, partition_attributes->num_values, sizeof(*data->partitions),
680 module->ldb, sort_compare);
682 for (i=0; data->partitions[i]; i++) {
683 struct ldb_request *req;
684 req = talloc_zero(mem_ctx, struct ldb_request);
686 ldb_debug(module->ldb, LDB_DEBUG_ERROR, "partition: Out of memory!\n");
687 talloc_free(mem_ctx);
688 return LDB_ERR_OPERATIONS_ERROR;
691 req->operation = LDB_REQ_REGISTER_PARTITION;
692 req->op.reg_partition.dn = data->partitions[i]->dn;
694 ret = ldb_request(module->ldb, req);
695 if (ret != LDB_SUCCESS) {
696 ldb_debug(module->ldb, LDB_DEBUG_ERROR, "partition: Unable to register partition with rootdse!\n");
697 talloc_free(mem_ctx);
698 return LDB_ERR_OTHER;
703 replicate_attributes = ldb_msg_find_element(msg, "replicateEntries");
704 if (!replicate_attributes) {
705 data->replicate = NULL;
707 data->replicate = talloc_array(data, struct ldb_dn *, replicate_attributes->num_values + 1);
708 if (!data->replicate) {
709 talloc_free(mem_ctx);
710 return LDB_ERR_OPERATIONS_ERROR;
713 for (i=0; i < replicate_attributes->num_values; i++) {
714 data->replicate[i] = ldb_dn_new(data->replicate, module->ldb, (const char *)replicate_attributes->values[i].data);
715 if (!ldb_dn_validate(data->replicate[i])) {
716 ldb_asprintf_errstring(module->ldb,
718 "invalid DN in partition replicate record: %s",
719 replicate_attributes->values[i].data);
720 talloc_free(mem_ctx);
721 return LDB_ERR_CONSTRAINT_VIOLATION;
724 data->replicate[i] = NULL;
727 /* Make the private data available to any searches the modules may trigger in initialisation */
728 module->private_data = data;
729 talloc_steal(module, data);
731 modules_attributes = ldb_msg_find_element(msg, "modules");
732 if (modules_attributes) {
733 for (i=0; i < modules_attributes->num_values; i++) {
734 struct ldb_dn *base_dn;
736 struct partition *partition = NULL;
737 const char **modules = NULL;
739 char *base = talloc_strdup(data->partitions, (char *)modules_attributes->values[i].data);
740 char *p = strchr(base, ':');
742 ldb_asprintf_errstring(module->ldb,
744 "invalid form for partition module record (missing ':'): %s", base);
745 talloc_free(mem_ctx);
746 return LDB_ERR_CONSTRAINT_VIOLATION;
751 ldb_asprintf_errstring(module->ldb,
753 "invalid form for partition module record (missing backend database): %s", base);
754 talloc_free(mem_ctx);
755 return LDB_ERR_CONSTRAINT_VIOLATION;
758 modules = ldb_modules_list_from_string(module->ldb, mem_ctx,
761 base_dn = ldb_dn_new(mem_ctx, module->ldb, base);
762 if (!ldb_dn_validate(base_dn)) {
763 talloc_free(mem_ctx);
764 return LDB_ERR_OPERATIONS_ERROR;
767 for (partition_idx = 0; data->partitions[partition_idx]; partition_idx++) {
768 if (ldb_dn_compare(data->partitions[partition_idx]->dn, base_dn) == 0) {
769 partition = data->partitions[partition_idx];
775 ldb_asprintf_errstring(module->ldb,
777 "invalid form for partition module record (no such partition): %s", base);
778 talloc_free(mem_ctx);
779 return LDB_ERR_CONSTRAINT_VIOLATION;
782 ret = ldb_load_modules_list(module->ldb, modules, partition->module, &partition->module);
783 if (ret != LDB_SUCCESS) {
784 ldb_asprintf_errstring(module->ldb,
786 "loading backend for %s failed: %s",
787 base, ldb_errstring(module->ldb));
788 talloc_free(mem_ctx);
791 ret = ldb_init_module_chain(module->ldb, partition->module);
792 if (ret != LDB_SUCCESS) {
793 ldb_asprintf_errstring(module->ldb,
795 "initialising backend for %s failed: %s",
796 base, ldb_errstring(module->ldb));
797 talloc_free(mem_ctx);
803 talloc_free(mem_ctx);
804 return ldb_next_init(module);
807 static int partition_wait_none(struct ldb_handle *handle) {
808 struct partition_context *ac;
812 if (!handle || !handle->private_data) {
813 return LDB_ERR_OPERATIONS_ERROR;
816 if (handle->state == LDB_ASYNC_DONE) {
817 return handle->status;
820 handle->state = LDB_ASYNC_PENDING;
821 handle->status = LDB_SUCCESS;
823 ac = talloc_get_type(handle->private_data, struct partition_context);
825 for (i=0; i < ac->num_requests; i++) {
826 ret = ldb_wait(ac->down_req[i]->handle, LDB_WAIT_NONE);
828 if (ret != LDB_SUCCESS) {
829 handle->status = ret;
832 if (ac->down_req[i]->handle->status != LDB_SUCCESS) {
833 handle->status = ac->down_req[i]->handle->status;
837 if (ac->down_req[i]->handle->state != LDB_ASYNC_DONE) {
845 handle->state = LDB_ASYNC_DONE;
850 static int partition_wait_all(struct ldb_handle *handle) {
854 while (handle->state != LDB_ASYNC_DONE) {
855 ret = partition_wait_none(handle);
856 if (ret != LDB_SUCCESS) {
861 return handle->status;
864 static int partition_wait(struct ldb_handle *handle, enum ldb_wait_type type)
866 if (type == LDB_WAIT_ALL) {
867 return partition_wait_all(handle);
869 return partition_wait_none(handle);
873 static const struct ldb_module_ops partition_ops = {
875 .init_context = partition_init,
876 .search = partition_search,
877 .add = partition_add,
878 .modify = partition_modify,
879 .del = partition_delete,
880 .rename = partition_rename,
881 .start_transaction = partition_start_trans,
882 .end_transaction = partition_end_trans,
883 .del_transaction = partition_del_trans,
884 .sequence_number = partition_sequence_number,
885 .wait = partition_wait
888 int ldb_partition_init(void)
890 return ldb_register_module(&partition_ops);