a client has asked to attach a new database
*/
int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
- TDB_DATA *outdata, uint64_t tdb_flags,
+ TDB_DATA *outdata,
bool persistent, uint32_t client_id,
struct ctdb_req_control_old *c,
bool *async_reply)
}
}
- /* the client can optionally pass additional tdb flags, but we
- only allow a subset of those on the database in ctdb. Note
- that tdb_flags is passed in via the (otherwise unused)
- srvid to the attach control */
-#ifdef TDB_MUTEX_LOCKING
- tdb_flags &= (TDB_NOSYNC|TDB_INCOMPATIBLE_HASH|TDB_MUTEX_LOCKING|TDB_CLEAR_IF_FIRST);
-#else
- tdb_flags &= (TDB_NOSYNC|TDB_INCOMPATIBLE_HASH);
-#endif
-
/* see if we already have this name */
db = ctdb_db_handle(ctdb, db_name);
if (db) {
return 0;
}
- with_jenkinshash = (tdb_flags & TDB_INCOMPATIBLE_HASH) ? true : false;
-#ifdef TDB_MUTEX_LOCKING
- with_mutexes = (tdb_flags & TDB_MUTEX_LOCKING) ? true : false;
-#else
- with_mutexes = false;
-#endif
+ with_jenkinshash = persistent ? false : true;
+ with_mutexes = (ctdb->tunable.mutex_enabled == 1) ? true : false;
if (ctdb_local_attach(ctdb, db_name, persistent, NULL,
with_jenkinshash, with_mutexes) != 0) {
lockdown_memory(ctdb->valgrinding);
/* tell all the other nodes about this database */
- ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, tdb_flags,
+ ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, 0,
persistent?CTDB_CONTROL_DB_ATTACH_PERSISTENT:
CTDB_CONTROL_DB_ATTACH,
0, CTDB_CTRL_FLAG_NOREPLY,