mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
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>
This commit is contained in:
parent
0077296cee
commit
b2b7e3b971
@ -55,7 +55,7 @@ char *ctdbd_dbpath(struct ctdbd_connection *conn,
|
||||
TALLOC_CTX *mem_ctx, uint32_t db_id);
|
||||
|
||||
int ctdbd_db_attach(struct ctdbd_connection *conn, const char *name,
|
||||
uint32_t *db_id, int tdb_flags);
|
||||
uint32_t *db_id, bool persistent);
|
||||
|
||||
int ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user