summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2017-07-11 20:41:43 +0200
committerKarolin Seeger <kseeger@samba.org>2017-07-24 22:00:38 +0200
commita577510d348ba9be9653a75363eeb2e400d1a425 (patch)
treed53f29943d42219f0956f7eb8b26a143f96d1c6c /source3/lib
parentd12832f11a120b35a472f9268af2081c5699b44b (diff)
downloadsamba-a577510d348ba9be9653a75363eeb2e400d1a425.tar.gz
ctdbd_conn: pass persistent bool instead of tdb_flags
ctdbd_db_attach() only needs to know the ctdb database model, not the rest of the flags. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit b2b7e3b9710fa22716f931177265dcd8de74532b)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/ctdbd_conn.c3
-rw-r--r--source3/lib/dbwrap/dbwrap_ctdb.c5
2 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 70d3d83f031..b81feca65ba 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -819,12 +819,11 @@ char *ctdbd_dbpath(struct ctdbd_connection *conn,
* attach to a ctdb database
*/
int ctdbd_db_attach(struct ctdbd_connection *conn,
- const char *name, uint32_t *db_id, int tdb_flags)
+ const char *name, uint32_t *db_id, bool persistent)
{
int ret;
TDB_DATA data;
int32_t cstatus;
- bool persistent = (tdb_flags & TDB_CLEAR_IF_FIRST) == 0;
data = string_term_tdb_data(name);
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 001d2c42fb2..07e35f8ffb0 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1780,6 +1780,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
char *db_path;
struct loadparm_context *lp_ctx;
TDB_DATA data;
+ bool persistent = (tdb_flags & TDB_CLEAR_IF_FIRST);
int32_t cstatus;
int ret;
@@ -1811,7 +1812,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
db_ctdb->db = result;
db_ctdb->conn = conn;
- ret = ctdbd_db_attach(db_ctdb->conn, name, &db_ctdb->db_id, tdb_flags);
+ ret = ctdbd_db_attach(db_ctdb->conn, name, &db_ctdb->db_id, persistent);
if (ret != 0) {
DEBUG(0, ("ctdbd_db_attach failed for %s: %s\n", name,
strerror(ret)));
@@ -1836,7 +1837,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
db_path = ctdbd_dbpath(db_ctdb->conn, db_ctdb, db_ctdb->db_id);
- result->persistent = ((tdb_flags & TDB_CLEAR_IF_FIRST) == 0);
+ result->persistent = persistent;
result->lock_order = lock_order;
/* only pass through specific flags */