From: Hallvard Furuseth Date: Thu, 8 Aug 2013 17:54:54 +0000 (+0200) Subject: Factor out MDB_env. X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~12^2~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ffd2287b5505dd56a1ed12bf5f5fb903ff2fc8ea;p=openldap Factor out MDB_env. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 345d6d61f9..c2e75e54aa 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4452,12 +4452,11 @@ mdb_cursor_push(MDB_cursor *mc, MDB_page *mp) static int mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) { + MDB_env *env = txn->mt_env; MDB_page *p = NULL; int level; - if (!((txn->mt_flags & MDB_TXN_RDONLY) | - (txn->mt_env->me_flags & MDB_WRITEMAP))) - { + if (!((txn->mt_flags & MDB_TXN_RDONLY) | (env->me_flags & MDB_WRITEMAP))) { MDB_txn *tx2 = txn; level = 1; do { @@ -4471,7 +4470,7 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) if (tx2->mt_spill_pgs) { x = mdb_midl_search(tx2->mt_spill_pgs, pgno); if (x <= tx2->mt_spill_pgs[0] && tx2->mt_spill_pgs[x] == pgno) { - p = (MDB_page *)(txn->mt_env->me_map + txn->mt_env->me_psize * pgno); + p = (MDB_page *)(env->me_map + env->me_psize * pgno); goto done; } } @@ -4488,7 +4487,7 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) if (pgno < txn->mt_next_pgno) { level = 0; - p = (MDB_page *)(txn->mt_env->me_map + txn->mt_env->me_psize * pgno); + p = (MDB_page *)(env->me_map + env->me_psize * pgno); } else { DPRINTF("page %"Z"u not found", pgno); assert(p != NULL);