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, const 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(module->ldb,
113 data->partitions[i]->dn,
115 return make_module_for_next_request(req, module->ldb, data->partitions[i]->module);
124 fire the caller's callback for every entry, but only send 'done' once.
126 static int partition_search_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
128 struct partition_context *ac;
130 if (!context || !ares) {
131 ldb_set_errstring(ldb, "partition_search_callback: NULL Context or Result in 'search' callback");
135 ac = talloc_get_type(context, struct partition_context);
137 if (ares->type == LDB_REPLY_ENTRY) {
138 return ac->orig_req->callback(ldb, ac->orig_req->context, ares);
140 ac->finished_requests++;
141 if (ac->finished_requests == ac->num_requests) {
142 return ac->orig_req->callback(ldb, ac->orig_req->context, ares);
150 return LDB_ERR_OPERATIONS_ERROR;
154 only fire the 'last' callback, and only for START-TLS for now
156 static int partition_other_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
158 struct partition_context *ac;
161 ldb_set_errstring(ldb, "partition_other_callback: NULL Context in 'other' callback");
165 ac = talloc_get_type(context, struct partition_context);
167 if (!ac->orig_req->callback) {
173 || (ares->type == LDB_REPLY_EXTENDED
174 && strcmp(ares->response->oid, LDB_EXTENDED_START_TLS_OID))) {
175 ac->finished_requests++;
176 if (ac->finished_requests == ac->num_requests) {
177 return ac->orig_req->callback(ldb, ac->orig_req->context, ares);
182 ldb_set_errstring(ldb, "partition_other_callback: Unknown reply type, only supports START_TLS");
185 return LDB_ERR_OPERATIONS_ERROR;
189 static int partition_send_request(struct partition_context *ac, struct ldb_module *partition,
190 struct ldb_dn *partition_base_dn)
193 struct ldb_module *next = make_module_for_next_request(ac->module, ac->module->ldb, partition);
194 struct ldb_request *req;
195 ac->down_req = talloc_realloc(ac, ac->down_req,
196 struct ldb_request *, ac->num_requests + 1);
198 ldb_set_errstring(ac->module->ldb, "Out of Memory");
199 return LDB_ERR_OPERATIONS_ERROR;
201 req = ac->down_req[ac->num_requests] = talloc(ac, struct ldb_request);
203 ldb_set_errstring(ac->module->ldb, "Out of Memory");
204 return LDB_ERR_OPERATIONS_ERROR;
207 *ac->down_req[ac->num_requests] = *ac->orig_req; /* copy the request */
209 if (req->operation == LDB_SEARCH) {
210 /* If the search is for 'more' than this partition,
211 * then change the basedn, so a remote LDAP server
213 if (ldb_dn_compare_base(ac->module->ldb,
214 partition_base_dn, req->op.search.base) != 0) {
215 req->op.search.base = partition_base_dn;
217 req->callback = partition_search_callback;
220 req->callback = partition_other_callback;
224 /* Spray off search requests to all backends */
225 ret = ldb_next_request(next, req);
226 if (ret != LDB_SUCCESS) {
234 /* Send a request down to all the partitions */
235 static int partition_send_all(struct ldb_module *module,
236 struct partition_context *ac, struct ldb_request *req)
239 struct partition_private_data *data = talloc_get_type(module->private_data,
240 struct partition_private_data);
241 int ret = partition_send_request(ac, module->next, NULL);
242 if (ret != LDB_SUCCESS) {
245 for (i=0; data && data->partitions && data->partitions[i]; i++) {
246 ret = partition_send_request(ac, data->partitions[i]->module, data->partitions[i]->dn);
247 if (ret != LDB_SUCCESS) {
254 /* Figure out which backend a request needs to be aimed at. Some
255 * requests must be replicated to all backends */
256 static int partition_replicate(struct ldb_module *module, struct ldb_request *req, const struct ldb_dn *dn)
259 struct ldb_module *backend;
260 struct partition_private_data *data = talloc_get_type(module->private_data,
261 struct partition_private_data);
263 /* Is this a special DN, we need to replicate to every backend? */
264 for (i=0; data->replicate && data->replicate[i]; i++) {
265 if (ldb_dn_compare(module->ldb,
268 struct ldb_handle *h;
269 struct partition_context *ac;
271 h = partition_init_handle(req, module);
273 return LDB_ERR_OPERATIONS_ERROR;
275 /* return our own handle to deal with this call */
278 ac = talloc_get_type(h->private_data, struct partition_context);
280 return partition_send_all(module, ac, req);
284 /* Otherwise, we need to find the backend to fire it to */
287 backend = find_backend(module, req, dn);
290 return ldb_next_request(backend, req);
295 static int partition_search(struct ldb_module *module, struct ldb_request *req)
298 struct partition_private_data *data = talloc_get_type(module->private_data,
299 struct partition_private_data);
302 /* (later) consider if we should be searching multiple
303 * partitions (for 'invisible' partition behaviour */
304 if (ldb_get_opaque(module->ldb, "global_catalog")) {
306 struct ldb_handle *h;
307 struct partition_context *ac;
309 h = partition_init_handle(req, module);
311 return LDB_ERR_OPERATIONS_ERROR;
313 /* return our own handle to deal with this call */
316 ac = talloc_get_type(h->private_data, struct partition_context);
318 /* Search from the base DN */
319 if (!req->op.search.base || (ldb_dn_get_comp_num(req->op.search.base) == 0)) {
320 return partition_send_all(module, ac, req);
322 for (i=0; data && data->partitions && data->partitions[i]; i++) {
323 /* Find all partitions under the search base */
324 if (ldb_dn_compare_base(module->ldb,
326 data->partitions[i]->dn) == 0) {
327 ret = partition_send_request(ac, data->partitions[i]->module, data->partitions[i]->dn);
328 if (ret != LDB_SUCCESS) {
334 /* Perhaps we didn't match any partitions. Try the main partition, only */
335 if (ac->num_requests == 0) {
337 return ldb_next_request(module, req);
342 struct ldb_module *backend = find_backend(module, req, req->op.search.base);
344 return ldb_next_request(backend, req);
349 static int partition_add(struct ldb_module *module, struct ldb_request *req)
351 return partition_replicate(module, req, req->op.add.message->dn);
355 static int partition_modify(struct ldb_module *module, struct ldb_request *req)
357 return partition_replicate(module, req, req->op.mod.message->dn);
361 static int partition_delete(struct ldb_module *module, struct ldb_request *req)
363 return partition_replicate(module, req, req->op.del.dn);
367 static int partition_rename(struct ldb_module *module, struct ldb_request *req)
370 struct ldb_module *backend = find_backend(module, req, req->op.rename.olddn);
371 struct ldb_module *backend2 = find_backend(module, req, req->op.rename.newdn);
373 if (backend->next != backend2->next) {
374 return LDB_ERR_AFFECTS_MULTIPLE_DSAS;
377 return partition_replicate(module, req, req->op.rename.olddn);
380 /* start a transaction */
381 static int partition_start_trans(struct ldb_module *module)
384 struct partition_private_data *data = talloc_get_type(module->private_data,
385 struct partition_private_data);
386 /* Look at base DN */
387 /* Figure out which partition it is under */
388 /* Skip the lot if 'data' isn't here yet (initialistion) */
389 ret = ldb_next_start_trans(module);
390 if (ret != LDB_SUCCESS) {
394 for (i=0; data && data->partitions && data->partitions[i]; i++) {
395 struct ldb_module *next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
397 ret = ldb_next_start_trans(next);
399 if (ret != LDB_SUCCESS) {
400 /* Back it out, if it fails on one */
401 for (i--; i >= 0; i--) {
402 next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
403 ldb_next_del_trans(next);
412 /* end a transaction */
413 static int partition_end_trans(struct ldb_module *module)
415 int i, ret, ret2 = LDB_SUCCESS;
416 struct partition_private_data *data = talloc_get_type(module->private_data,
417 struct partition_private_data);
418 ret = ldb_next_end_trans(module);
419 if (ret != LDB_SUCCESS) {
423 /* Look at base DN */
424 /* Figure out which partition it is under */
425 /* Skip the lot if 'data' isn't here yet (initialistion) */
426 for (i=0; data && data->partitions && data->partitions[i]; i++) {
427 struct ldb_module *next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
429 ret = ldb_next_end_trans(next);
431 if (ret != LDB_SUCCESS) {
436 if (ret != LDB_SUCCESS) {
437 /* Back it out, if it fails on one */
438 for (i=0; data && data->partitions && data->partitions[i]; i++) {
439 struct ldb_module *next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
440 ldb_next_del_trans(next);
447 /* delete a transaction */
448 static int partition_del_trans(struct ldb_module *module)
450 int i, ret, ret2 = LDB_SUCCESS;
451 struct partition_private_data *data = talloc_get_type(module->private_data,
452 struct partition_private_data);
453 ret = ldb_next_del_trans(module);
454 if (ret != LDB_SUCCESS) {
458 /* Look at base DN */
459 /* Figure out which partition it is under */
460 /* Skip the lot if 'data' isn't here yet (initialistion) */
461 for (i=0; data && data->partitions && data->partitions[i]; i++) {
462 struct ldb_module *next = make_module_for_next_request(module, module->ldb, data->partitions[i]->module);
464 ret = ldb_next_del_trans(next);
466 if (ret != LDB_SUCCESS) {
473 static int partition_sequence_number(struct ldb_module *module, struct ldb_request *req)
476 uint64_t seq_number = 0;
477 uint64_t timestamp_sequence = 0;
478 uint64_t timestamp = 0;
479 struct partition_private_data *data = talloc_get_type(module->private_data,
480 struct partition_private_data);
482 switch (req->op.seq_num.type) {
484 case LDB_SEQ_HIGHEST_SEQ:
485 ret = ldb_next_request(module, req);
486 if (ret != LDB_SUCCESS) {
489 if (req->op.seq_num.flags & LDB_SEQ_TIMESTAMP_SEQUENCE) {
490 timestamp_sequence = req->op.seq_num.seq_num;
492 seq_number = seq_number + req->op.seq_num.seq_num;
495 /* Look at base DN */
496 /* Figure out which partition it is under */
497 /* Skip the lot if 'data' isn't here yet (initialistion) */
498 for (i=0; data && data->partitions && data->partitions[i]; i++) {
499 struct ldb_module *next = make_module_for_next_request(req, module->ldb, data->partitions[i]->module);
501 ret = ldb_next_request(next, req);
503 if (ret != LDB_SUCCESS) {
506 if (req->op.seq_num.flags & LDB_SEQ_TIMESTAMP_SEQUENCE) {
507 timestamp_sequence = MAX(timestamp_sequence, req->op.seq_num.seq_num);
509 seq_number = seq_number + req->op.seq_num.seq_num;
513 case LDB_SEQ_HIGHEST_TIMESTAMP:
515 struct ldb_request *date_req = talloc(req, struct ldb_request);
517 return LDB_ERR_OPERATIONS_ERROR;
520 date_req->op.seq_num.flags = LDB_SEQ_HIGHEST_TIMESTAMP;
522 ret = ldb_next_request(module, date_req);
523 if (ret != LDB_SUCCESS) {
526 timestamp = date_req->op.seq_num.seq_num;
528 /* Look at base DN */
529 /* Figure out which partition it is under */
530 /* Skip the lot if 'data' isn't here yet (initialistion) */
531 for (i=0; data && data->partitions && data->partitions[i]; i++) {
532 struct ldb_module *next = make_module_for_next_request(req, module->ldb, data->partitions[i]->module);
534 ret = ldb_next_request(next, date_req);
536 if (ret != LDB_SUCCESS) {
539 timestamp = MAX(timestamp, date_req->op.seq_num.seq_num);
545 switch (req->op.seq_num.flags) {
547 case LDB_SEQ_HIGHEST_SEQ:
549 req->op.seq_num.flags = 0;
551 /* Has someone above set a timebase sequence? */
552 if (timestamp_sequence) {
553 req->op.seq_num.seq_num = (((unsigned long long)timestamp << 24) | (seq_number & 0xFFFFFF));
555 req->op.seq_num.seq_num = seq_number;
558 if (timestamp_sequence > req->op.seq_num.seq_num) {
559 req->op.seq_num.seq_num = timestamp_sequence;
560 req->op.seq_num.flags |= LDB_SEQ_TIMESTAMP_SEQUENCE;
563 req->op.seq_num.flags |= LDB_SEQ_GLOBAL_SEQUENCE;
565 case LDB_SEQ_HIGHEST_TIMESTAMP:
566 req->op.seq_num.seq_num = timestamp;
570 switch (req->op.seq_num.flags) {
572 req->op.seq_num.seq_num++;
577 static int sort_compare(void *void1,
578 void *void2, void *opaque)
580 struct ldb_context *ldb = talloc_get_type(opaque, struct ldb_context);
581 struct partition **pp1 = void1;
582 struct partition **pp2 = void2;
583 struct partition *partition1 = talloc_get_type(*pp1, struct partition);
584 struct partition *partition2 = talloc_get_type(*pp2, struct partition);
586 return ldb_dn_compare(ldb, partition1->dn, partition2->dn);
589 static int partition_init(struct ldb_module *module)
592 TALLOC_CTX *mem_ctx = talloc_new(module);
593 static const char *attrs[] = { "partition", "replicateEntries", "modules", NULL };
594 struct ldb_result *res;
595 struct ldb_message *msg;
596 struct ldb_message_element *partition_attributes;
597 struct ldb_message_element *replicate_attributes;
598 struct ldb_message_element *modules_attributes;
600 struct partition_private_data *data;
603 return LDB_ERR_OPERATIONS_ERROR;
606 data = talloc(mem_ctx, struct partition_private_data);
608 return LDB_ERR_OPERATIONS_ERROR;
611 ret = ldb_search(module->ldb, ldb_dn_explode(mem_ctx, "@PARTITION"),
615 if (ret != LDB_SUCCESS) {
616 talloc_free(mem_ctx);
619 talloc_steal(mem_ctx, res);
620 if (res->count == 0) {
621 talloc_free(mem_ctx);
622 return ldb_next_init(module);
625 if (res->count > 1) {
626 talloc_free(mem_ctx);
627 return LDB_ERR_CONSTRAINT_VIOLATION;
632 partition_attributes = ldb_msg_find_element(msg, "partition");
633 if (!partition_attributes) {
634 ldb_set_errstring(module->ldb, "partition_init: no partitions specified");
635 talloc_free(mem_ctx);
636 return LDB_ERR_CONSTRAINT_VIOLATION;
638 data->partitions = talloc_array(data, struct partition *, partition_attributes->num_values + 1);
639 if (!data->partitions) {
640 talloc_free(mem_ctx);
641 return LDB_ERR_OPERATIONS_ERROR;
643 for (i=0; i < partition_attributes->num_values; i++) {
644 char *base = talloc_strdup(data->partitions, (char *)partition_attributes->values[i].data);
645 char *p = strchr(base, ':');
647 ldb_asprintf_errstring(module->ldb,
649 "invalid form for partition record (missing ':'): %s", base);
650 talloc_free(mem_ctx);
651 return LDB_ERR_CONSTRAINT_VIOLATION;
656 ldb_asprintf_errstring(module->ldb,
658 "invalid form for partition record (missing backend database): %s", base);
659 talloc_free(mem_ctx);
660 return LDB_ERR_CONSTRAINT_VIOLATION;
662 data->partitions[i] = talloc(data->partitions, struct partition);
663 if (!data->partitions[i]) {
664 talloc_free(mem_ctx);
665 return LDB_ERR_OPERATIONS_ERROR;
668 data->partitions[i]->dn = ldb_dn_explode(data->partitions[i], base);
669 if (!data->partitions[i]->dn) {
670 ldb_asprintf_errstring(module->ldb,
671 "partition_init: invalid DN in partition record: %s", base);
672 talloc_free(mem_ctx);
673 return LDB_ERR_CONSTRAINT_VIOLATION;
676 data->partitions[i]->backend = private_path(data->partitions[i], p);
677 ret = ldb_connect_backend(module->ldb, data->partitions[i]->backend, NULL, &data->partitions[i]->module);
678 if (ret != LDB_SUCCESS) {
679 talloc_free(mem_ctx);
683 data->partitions[i] = NULL;
685 /* sort these into order, most to least specific */
686 ldb_qsort(data->partitions, partition_attributes->num_values, sizeof(*data->partitions),
687 module->ldb, sort_compare);
689 for (i=0; data->partitions[i]; i++) {
690 struct ldb_request *req;
691 req = talloc_zero(mem_ctx, struct ldb_request);
693 ldb_debug(module->ldb, LDB_DEBUG_ERROR, "partition: Out of memory!\n");
694 talloc_free(mem_ctx);
695 return LDB_ERR_OPERATIONS_ERROR;
698 req->operation = LDB_REQ_REGISTER_PARTITION;
699 req->op.reg_partition.dn = data->partitions[i]->dn;
701 ret = ldb_request(module->ldb, req);
702 if (ret != LDB_SUCCESS) {
703 ldb_debug(module->ldb, LDB_DEBUG_ERROR, "partition: Unable to register partition with rootdse!\n");
704 talloc_free(mem_ctx);
705 return LDB_ERR_OTHER;
710 replicate_attributes = ldb_msg_find_element(msg, "replicateEntries");
711 if (!replicate_attributes) {
712 data->replicate = NULL;
714 data->replicate = talloc_array(data, struct ldb_dn *, replicate_attributes->num_values + 1);
715 if (!data->replicate) {
716 talloc_free(mem_ctx);
717 return LDB_ERR_OPERATIONS_ERROR;
720 for (i=0; i < replicate_attributes->num_values; i++) {
721 data->replicate[i] = ldb_dn_explode(data->replicate, (const char *)replicate_attributes->values[i].data);
722 if (!data->replicate[i]) {
723 ldb_asprintf_errstring(module->ldb,
725 "invalid DN in partition replicate record: %s",
726 replicate_attributes->values[i].data);
727 talloc_free(mem_ctx);
728 return LDB_ERR_CONSTRAINT_VIOLATION;
731 data->replicate[i] = NULL;
734 /* Make the private data available to any searches the modules may trigger in initialisation */
735 module->private_data = data;
736 talloc_steal(module, data);
738 modules_attributes = ldb_msg_find_element(msg, "modules");
739 if (modules_attributes) {
740 for (i=0; i < modules_attributes->num_values; i++) {
741 struct ldb_dn *base_dn;
743 struct partition *partition = NULL;
744 const char **modules = NULL;
746 char *base = talloc_strdup(data->partitions, (char *)modules_attributes->values[i].data);
747 char *p = strchr(base, ':');
749 ldb_asprintf_errstring(module->ldb,
751 "invalid form for partition module record (missing ':'): %s", base);
752 talloc_free(mem_ctx);
753 return LDB_ERR_CONSTRAINT_VIOLATION;
758 ldb_asprintf_errstring(module->ldb,
760 "invalid form for partition module record (missing backend database): %s", base);
761 talloc_free(mem_ctx);
762 return LDB_ERR_CONSTRAINT_VIOLATION;
765 modules = ldb_modules_list_from_string(module->ldb, mem_ctx,
768 base_dn = ldb_dn_explode(mem_ctx, base);
770 talloc_free(mem_ctx);
771 return LDB_ERR_OPERATIONS_ERROR;
774 for (partition_idx = 0; data->partitions[partition_idx]; partition_idx++) {
775 if (ldb_dn_compare(module->ldb, data->partitions[partition_idx]->dn,
777 partition = data->partitions[partition_idx];
783 ldb_asprintf_errstring(module->ldb,
785 "invalid form for partition module record (no such partition): %s", base);
786 talloc_free(mem_ctx);
787 return LDB_ERR_CONSTRAINT_VIOLATION;
790 ret = ldb_load_modules_list(module->ldb, modules, partition->module, &partition->module);
791 if (ret != LDB_SUCCESS) {
792 ldb_asprintf_errstring(module->ldb,
794 "loading backend for %s failed: %s",
795 base, ldb_errstring(module->ldb));
796 talloc_free(mem_ctx);
799 ret = ldb_init_module_chain(module->ldb, partition->module);
800 if (ret != LDB_SUCCESS) {
801 ldb_asprintf_errstring(module->ldb,
803 "initialising backend for %s failed: %s",
804 base, ldb_errstring(module->ldb));
805 talloc_free(mem_ctx);
811 talloc_free(mem_ctx);
812 return ldb_next_init(module);
815 static int partition_wait_none(struct ldb_handle *handle) {
816 struct partition_context *ac;
820 if (!handle || !handle->private_data) {
821 return LDB_ERR_OPERATIONS_ERROR;
824 if (handle->state == LDB_ASYNC_DONE) {
825 return handle->status;
828 handle->state = LDB_ASYNC_PENDING;
829 handle->status = LDB_SUCCESS;
831 ac = talloc_get_type(handle->private_data, struct partition_context);
833 for (i=0; i < ac->num_requests; i++) {
834 ret = ldb_wait(ac->down_req[i]->handle, LDB_WAIT_NONE);
836 if (ret != LDB_SUCCESS) {
837 handle->status = ret;
840 if (ac->down_req[i]->handle->status != LDB_SUCCESS) {
841 handle->status = ac->down_req[i]->handle->status;
845 if (ac->down_req[i]->handle->state != LDB_ASYNC_DONE) {
853 handle->state = LDB_ASYNC_DONE;
858 static int partition_wait_all(struct ldb_handle *handle) {
862 while (handle->state != LDB_ASYNC_DONE) {
863 ret = partition_wait_none(handle);
864 if (ret != LDB_SUCCESS) {
869 return handle->status;
872 static int partition_wait(struct ldb_handle *handle, enum ldb_wait_type type)
874 if (type == LDB_WAIT_ALL) {
875 return partition_wait_all(handle);
877 return partition_wait_none(handle);
881 static const struct ldb_module_ops partition_ops = {
883 .init_context = partition_init,
884 .search = partition_search,
885 .add = partition_add,
886 .modify = partition_modify,
887 .del = partition_delete,
888 .rename = partition_rename,
889 .start_transaction = partition_start_trans,
890 .end_transaction = partition_end_trans,
891 .del_transaction = partition_del_trans,
892 .sequence_number = partition_sequence_number,
893 .wait = partition_wait
896 int ldb_partition_init(void)
898 return ldb_register_module(&partition_ops);