summaryrefslogtreecommitdiffstats
path: root/lib/libc/db/btree/bt_debug.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-03-28 07:31:02 +0000
committerdelphij <delphij@FreeBSD.org>2009-03-28 07:31:02 +0000
commit1db7e98746958564da51eee2a32c7c3f1b56e03d (patch)
treeed6c7564fb2f2d25581d74c48ca0074066b16e39 /lib/libc/db/btree/bt_debug.c
parent2ca1d8e1e96f9ca5abe40be147c7076163b69c68 (diff)
downloadFreeBSD-src-1db7e98746958564da51eee2a32c7c3f1b56e03d.zip
FreeBSD-src-1db7e98746958564da51eee2a32c7c3f1b56e03d.tar.gz
Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD.
This does not include the new hash routines since they will cause problems when reading old hash files. Since mpool(3) has been changed, provide a compatibility shim for older binaries. Obtained from: OpenBSD
Diffstat (limited to 'lib/libc/db/btree/bt_debug.c')
-rw-r--r--lib/libc/db/btree/bt_debug.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/libc/db/btree/bt_debug.c b/lib/libc/db/btree/bt_debug.c
index ff5357a..dc8b83d 100644
--- a/lib/libc/db/btree/bt_debug.c
+++ b/lib/libc/db/btree/bt_debug.c
@@ -83,10 +83,9 @@ __bt_dump(DB *dbp)
}
#undef X
- for (i = P_ROOT; (h = mpool_get(t->bt_mp, i, 0)) != NULL; ++i) {
+ for (i = P_ROOT;
+ (h = mpool_get(t->bt_mp, i, MPOOL_IGNOREPIN)) != NULL; ++i)
__bt_dpage(h);
- (void)mpool_put(t->bt_mp, h, 0);
- }
}
/*
@@ -135,10 +134,8 @@ __bt_dnpage(DB *dbp, pgno_t pgno)
PAGE *h;
t = dbp->internal;
- if ((h = mpool_get(t->bt_mp, pgno, 0)) != NULL) {
+ if ((h = mpool_get(t->bt_mp, pgno, MPOOL_IGNOREPIN)) != NULL)
__bt_dpage(h);
- (void)mpool_put(t->bt_mp, h, 0);
- }
}
/*
@@ -257,7 +254,8 @@ __bt_stat(DB *dbp)
t = dbp->internal;
pcont = pinternal = pleaf = 0;
nkeys = ifree = lfree = 0;
- for (i = P_ROOT; (h = mpool_get(t->bt_mp, i, 0)) != NULL; ++i) {
+ for (i = P_ROOT;
+ (h = mpool_get(t->bt_mp, i, MPOOL_IGNOREPIN)) != NULL; ++i)
switch (h->flags & P_TYPE) {
case P_BINTERNAL:
case P_RINTERNAL:
@@ -274,22 +272,18 @@ __bt_stat(DB *dbp)
++pcont;
break;
}
- (void)mpool_put(t->bt_mp, h, 0);
- }
/* Count the levels of the tree. */
for (i = P_ROOT, levels = 0 ;; ++levels) {
- h = mpool_get(t->bt_mp, i, 0);
+ h = mpool_get(t->bt_mp, i, MPOOL_IGNOREPIN);
if (h->flags & (P_BLEAF|P_RLEAF)) {
if (levels == 0)
levels = 1;
- (void)mpool_put(t->bt_mp, h, 0);
break;
}
i = F_ISSET(t, R_RECNO) ?
GETRINTERNAL(h, 0)->pgno :
GETBINTERNAL(h, 0)->pgno;
- (void)mpool_put(t->bt_mp, h, 0);
}
(void)fprintf(stderr, "%d level%s with %lu keys",
OpenPOWER on IntegriCloud