summaryrefslogtreecommitdiffstats
path: root/ctdb/common/ctdb_util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-04-30 15:31:40 +0200
committerAndrew Tridgell <tridge@samba.org>2007-04-30 15:31:40 +0200
commit9366120d9229f5bbc70388beb1133d81f9077fff (patch)
tree0bff58d172ba2462df27b3a2b7315139cd5d41c5 /ctdb/common/ctdb_util.c
parent4832d8f834ff09dfd1e77d511f065f3fdf06c05e (diff)
downloadsamba-9366120d9229f5bbc70388beb1133d81f9077fff.tar.gz
samba-9366120d9229f5bbc70388beb1133d81f9077fff.tar.xz
samba-9366120d9229f5bbc70388beb1133d81f9077fff.zip
changed the way set_call and attach are done so that you can safely
attach to databases after the protocol has started. The daemon broadcasts information on new databases to the other daemons. This also eliminates the need for the client to know about the hash between db name and db_id. (This used to be ctdb commit 3bad91a9d987d4c09fe3322eac23c2733660ad08)
Diffstat (limited to 'ctdb/common/ctdb_util.c')
-rw-r--r--ctdb/common/ctdb_util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index b74162bb3f..41d4fe5de4 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -103,6 +103,17 @@ uint32_t ctdb_hash(const TDB_DATA *key)
}
/*
+ hash function for a string
+*/
+uint32_t ctdb_hash_string(const char *str)
+{
+ TDB_DATA data;
+ data.dptr = (uint8_t *)discard_const(str);
+ data.dsize = strlen(str)+1;
+ return ctdb_hash(&data);
+}
+
+/*
a type checking varient of idr_find
*/
static void *_idr_find_type(struct idr_context *idp, int id, const char *type, const char *location)