Commit 31aa0af0 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #1040

Moved a couple of functions out of the critical path for the common case (only needed for uncommon case)

git-svn-id: file:///svn/tokudb@5298 c7de825b-a66e-492c-adef-691d508d4ae1
parent ab7a3ca9
......@@ -1567,17 +1567,12 @@ static int toku_c_get_assign_outputs(C_GET_VARS* g, DBT* key, DBT* val) {
static int toku_c_get_noassociate(DBC * c, DBT * key, DBT * val, u_int32_t flag) {
HANDLE_PANICKED_DB(c->dbp);
int r = ENOSYS;
int r_cursor_op = 0;
C_GET_VARS g;
memset(&g, 0, sizeof(g));
/* Initialize variables. */
g.c = c;
g.db = c->dbp;
g.flag = flag;
if (c->i->txn) {
g.txn_anc = toku_txn_ancestor(c->i->txn);
g.id_anc = toku_txn_get_txnid(g.txn_anc->i->tokutxn);
}
unsigned int brtflags;
toku_brt_get_flags(g.db->i->brt, &brtflags);
g.duplicates = (brtflags & TOKU_DB_DUPSORT) != 0;
......@@ -1590,6 +1585,11 @@ static int toku_c_get_noassociate(DBC * c, DBT * key, DBT * val, u_int32_t flag)
r = toku_brt_cursor_get(c->i->c, key, val, g.flag, txn);
goto cleanup;
}
int r_cursor_op = 0;
if (c->i->txn) {
g.txn_anc = toku_txn_ancestor(c->i->txn);
g.id_anc = toku_txn_get_txnid(g.txn_anc->i->tokutxn);
}
/* If we know what to lock before the cursor op, lock now. */
if ((r = toku_c_get_pre_acquire_lock_if_possible(&g, key, val))) goto cleanup;
......
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