From: Hallvard Furuseth Date: Sun, 19 May 2013 17:08:07 +0000 (+0200) Subject: More ITS#7589 followup: OVPAGES() -> mp_pages. X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~36^2~43 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2eb50b1d2ed61dedf33a9d89ef25e0ba853f5f81;p=openldap More ITS#7589 followup: OVPAGES() -> mp_pages. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index fced10c202..79635fd014 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -6514,10 +6514,14 @@ mdb_cursor_del0(MDB_cursor *mc, MDB_node *leaf) /* add overflow pages to free list */ if (!IS_LEAF2(mc->mc_pg[mc->mc_top]) && F_ISSET(leaf->mn_flags, F_BIGDATA)) { int i, ovpages; + MDB_page *omp; pgno_t pg; memcpy(&pg, NODEDATA(leaf), sizeof(pg)); - ovpages = OVPAGES(NODEDSZ(leaf), mc->mc_txn->mt_env->me_psize); + if ((rc = mdb_page_get(mc->mc_txn, pg, &omp)) != 0) + return rc; + assert(IS_OVERFLOW(omp)); + ovpages = omp->mp_pages; mc->mc_db->md_overflow_pages -= ovpages; for (i=0; imc_pg[mc->mc_top]); i++) { ni = NODEPTR(mc->mc_pg[mc->mc_top], i); if (ni->mn_flags & F_BIGDATA) { - int j, ovpages = OVPAGES(NODEDSZ(ni), mc->mc_txn->mt_env->me_psize); + int j, ovpages; + MDB_page *omp; pgno_t pg; memcpy(&pg, NODEDATA(ni), sizeof(pg)); + if ((rc = mdb_page_get(mc->mc_txn, pg, &omp)) != 0) + return rc; + assert(IS_OVERFLOW(omp)); + ovpages = omp->mp_pages; for (j=0; jmc_txn->mt_free_pgs, pg); pg++;