Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
34461da9
Commit
34461da9
authored
Jul 25, 2017
by
Hallvard Furuseth
Committed by
Howard Chu
Oct 10, 2020
Browse files
Skip unnecessary mdb_page_get()s when spilling
Do not bring in pages merely to see if they should be skipped.
parent
6dd5a4d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/mdb.c
View file @
34461da9
...
...
@@ -2237,8 +2237,8 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all)
MDB_xcursor *mx;
MDB_page *dp, *mp;
MDB_node *leaf;
unsigned i, j;
int rc = MDB_SUCCESS
, level
;
unsigned i, j
, x
;
int rc = MDB_SUCCESS;
/* Mark pages seen by cursors: First m0, then tracked cursors */
for (i = txn->mt_numdbs;; ) {
...
...
@@ -2270,14 +2270,17 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all)
mark_done:
if (all) {
/* Mark dirty root pages */
MDB_ID2L dl = txn->mt_u.dirty_list;
for (i=0; i<txn->mt_numdbs; i++) {
if (txn->mt_dbflags[i] & DB_DIRTY) {
pgno_t pgno = txn->mt_dbs[i].md_root;
if (pgno == P_INVALID)
continue;
if ((rc = MDB_PAGE_GET(m0, pgno, 1, &dp, &level)) != MDB_SUCCESS)
break;
if ((dp->mp_flags & Mask) == pflags && level <= 1)
x = mdb_mid2l_search(dl, pgno);
if (! (x <= dl[0].mid && dl[x].mid == pgno))
continue;
dp = dl[x].mptr;
if ((dp->mp_flags & Mask) == pflags)
dp->mp_flags ^= P_KEEP;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment