diff options
| author | Andrew Tridgell <tridge@samba.org> | 2006-11-28 20:48:34 +1100 |
|---|---|---|
| committer | Andrew Tridgell <tridge@samba.org> | 2006-11-28 20:48:34 +1100 |
| commit | fcae7fb9ca397df7f69d099b5dfa40d1f3d21de8 (patch) | |
| tree | a476fceca3959170fc1d7f5072590110816a4111 /ctdb/include | |
| parent | fdb317facfdb60c87695b557a4680401c210031a (diff) | |
| download | samba-fcae7fb9ca397df7f69d099b5dfa40d1f3d21de8.tar.gz samba-fcae7fb9ca397df7f69d099b5dfa40d1f3d21de8.tar.xz samba-fcae7fb9ca397df7f69d099b5dfa40d1f3d21de8.zip | |
- added in idtree for efficient reqid handling
- started adding ctdb_call() code
- added ctdb_call_local() implementation
(This used to be ctdb commit 97b1fdf7fa0e230f36add3f1770ecb3a9faee0a1)
Diffstat (limited to 'ctdb/include')
| -rw-r--r-- | ctdb/include/ctdb_private.h | 5 | ||||
| -rw-r--r-- | ctdb/include/idtree.h | 7 | ||||
| -rw-r--r-- | ctdb/include/includes.h | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index d4e7350bd7..582739f617 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -78,6 +78,7 @@ struct ctdb_context { const char *name; uint32_t vnn; /* our own vnn */ uint32_t num_nodes; + struct idr_context *idr; struct ctdb_node **nodes; /* array of nodes in the cluster - indexed by vnn */ struct ctdb_registered_call *calls; /* list of registered calls */ char *err_msg; @@ -91,6 +92,10 @@ struct ctdb_context { ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \ return -1; }} while (0) +/* arbitrary maximum timeout for ctdb operations */ +#define CTDB_REQ_TIMEOUT 10 + + /* operation IDs */ diff --git a/ctdb/include/idtree.h b/ctdb/include/idtree.h new file mode 100644 index 0000000000..259af91005 --- /dev/null +++ b/ctdb/include/idtree.h @@ -0,0 +1,7 @@ +struct idr_context *idr_init(TALLOC_CTX *mem_ctx); +int idr_get_new(struct idr_context *idp, void *ptr, int limit); +int idr_get_new_above(struct idr_context *idp, void *ptr, int starting_id, int limit); +int idr_get_new_random(struct idr_context *idp, void *ptr, int limit); +void *idr_find(struct idr_context *idp, int id); +int idr_remove(struct idr_context *idp, int id); + diff --git a/ctdb/include/includes.h b/ctdb/include/includes.h index 70632a7e0d..b160e1f739 100644 --- a/ctdb/include/includes.h +++ b/ctdb/include/includes.h @@ -3,6 +3,7 @@ #include "replace.h" #include "talloc.h" #include "tdb.h" +#include "idtree.h" #include "ctdb.h" #include "lib/util/dlinklist.h" |
