From: Amitay Isaacs Date: Thu, 2 Mar 2017 04:37:19 +0000 (+1100) Subject: ctdb-locking: Get tdb open flags from tdb instead of re-calculating X-Git-Tag: tdb-1.3.14~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45ea95126e370d09f392e79dc8deeac7804636e5;p=thirdparty%2Fsamba.git ctdb-locking: Get tdb open flags from tdb instead of re-calculating Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c index 2644fcd6f5f..a559e244471 100644 --- a/ctdb/server/ctdb_lock.c +++ b/ctdb/server/ctdb_lock.c @@ -586,18 +586,6 @@ skip_lock_debug: (void *)lock_ctx); } -static int db_flags(struct ctdb_db_context *ctdb_db) -{ - int tdb_flags = TDB_DEFAULT; - -#ifdef TDB_MUTEX_LOCKING - if (!ctdb_db->persistent && ctdb_db->ctdb->tunable.mutex_enabled) { - tdb_flags = (TDB_MUTEX_LOCKING | TDB_CLEAR_IF_FIRST); - } -#endif - return tdb_flags; -} - static bool lock_helper_args(TALLOC_CTX *mem_ctx, struct lock_context *lock_ctx, int fd, int *argc, const char ***argv) @@ -631,7 +619,7 @@ static bool lock_helper_args(TALLOC_CTX *mem_ctx, args[2] = talloc_strdup(args, "RECORD"); args[3] = talloc_strdup(args, lock_ctx->ctdb_db->db_path); args[4] = talloc_asprintf(args, "0x%x", - db_flags(lock_ctx->ctdb_db)); + tdb_get_flags(lock_ctx->ctdb_db->ltdb->tdb)); if (lock_ctx->key.dsize == 0) { args[5] = talloc_strdup(args, "NULL"); } else { @@ -643,7 +631,7 @@ static bool lock_helper_args(TALLOC_CTX *mem_ctx, args[2] = talloc_strdup(args, "DB"); args[3] = talloc_strdup(args, lock_ctx->ctdb_db->db_path); args[4] = talloc_asprintf(args, "0x%x", - db_flags(lock_ctx->ctdb_db)); + tdb_get_flags(lock_ctx->ctdb_db->ltdb->tdb)); break; }