diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-04-04 04:57:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:49:47 -0500 |
commit | a78be2150ba06738f4c7e85ca2980200d4a3c533 (patch) | |
tree | bc30c417b22a8cd51692635134f4c865a6023235 /source4/cluster/ctdb/ctdb_cluster.c | |
parent | 690df3ccd98c586610cc5e528b05f7863b334a3c (diff) | |
download | samba-a78be2150ba06738f4c7e85ca2980200d4a3c533.tar.gz samba-a78be2150ba06738f4c7e85ca2980200d4a3c533.tar.bz2 samba-a78be2150ba06738f4c7e85ca2980200d4a3c533.zip |
r22070: merge in the changes from the bzr ctdb tree, and convert the brlock
ctdb backend to use the updated multi-database API
(This used to be commit 44dcac9e4d81bfc078512248967b6240db9d1bd8)
Diffstat (limited to 'source4/cluster/ctdb/ctdb_cluster.c')
-rw-r--r-- | source4/cluster/ctdb/ctdb_cluster.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source4/cluster/ctdb/ctdb_cluster.c b/source4/cluster/ctdb/ctdb_cluster.c index 917a56d2b8..4892f3e173 100644 --- a/source4/cluster/ctdb/ctdb_cluster.c +++ b/source4/cluster/ctdb/ctdb_cluster.c @@ -193,7 +193,8 @@ void cluster_ctdb_init(struct event_context *ev) const char *address; const char *transport; struct cluster_state *state; - int ret, lacount; + int ret, lacount, i; + const char *db_list[] = { "brlock", "opendb" }; nlist = lp_parm_string(-1, "ctdb", "nlist"); if (nlist == NULL) return; @@ -255,10 +256,12 @@ void cluster_ctdb_init(struct event_context *ev) goto failed; } - ret = ctdb_attach(state->ctdb, "cluster.tdb", TDB_DEFAULT, O_RDWR|O_CREAT|O_TRUNC, 0666); - if (ret == -1) { - DEBUG(0,("ctdb_attach failed - %s\n", ctdb_errstr(state->ctdb))); - goto failed; + /* attach all the databases we will need */ + for (i=0;i<ARRAY_SIZE(db_list);i++) { + struct ctdb_db_context *ctdb_db; + ctdb_db = ctdb_attach(state->ctdb, db_list[i], TDB_DEFAULT, + O_RDWR|O_CREAT|O_TRUNC, 0666); + if (ctdb_db == NULL) goto failed; } /* start the protocol running */ |