Commit 9919eb8d authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4872], remove a couple of more instances of ydb lock

git-svn-id: file:///svn/toku/tokudb@44044 c7de825b-a66e-492c-adef-691d508d4ae1
parent 112fb6b3
......@@ -730,14 +730,16 @@ toku_db_hot_optimize(DB *db,
static int
locked_db_optimize(DB *db) {
toku_ydb_lock();
// need to protect from checkpointing because
// toku_db_optimize does a message injection
toku_multi_operation_client_lock(); //Cannot begin checkpoint
int r = toku_db_optimize(db);
toku_ydb_unlock();
toku_multi_operation_client_unlock();
return r;
}
static int
db_get_fragmentation(DB * db, TOKU_DB_FRAGMENTATION report) {
toku_db_get_fragmentation(DB * db, TOKU_DB_FRAGMENTATION report) {
HANDLE_PANICKED_DB(db);
int r;
if (!db_opened(db))
......@@ -747,14 +749,6 @@ db_get_fragmentation(DB * db, TOKU_DB_FRAGMENTATION report) {
return r;
}
static int
locked_db_get_fragmentation(DB * db, TOKU_DB_FRAGMENTATION report) {
toku_ydb_lock();
int r = db_get_fragmentation(db, report);
toku_ydb_unlock();
return r;
}
int
toku_db_set_indexer(DB *db, DB_INDEXER * indexer) {
int r = 0;
......@@ -852,7 +846,6 @@ toku_db_create(DB ** db, DB_ENV * env, u_int32_t flags) {
SDB(open);
SDB(change_descriptor);
SDB(optimize);
SDB(get_fragmentation);
#undef SDB
// methods that do not take the ydb lock
#define USDB(name) result->name = toku_db_ ## name
......@@ -877,6 +870,7 @@ toku_db_create(DB ** db, DB_ENV * env, u_int32_t flags) {
USDB(cursor);
USDB(dbt_pos_infty);
USDB(dbt_neg_infty);
USDB(get_fragmentation);
#undef USDB
result->get_indexer = db_get_indexer;
result->del = autotxn_db_del;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment