summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorGuido van Rooij <guido@FreeBSD.org>1998-06-25 18:50:06 +0000
committerGuido van Rooij <guido@FreeBSD.org>1998-06-25 18:50:06 +0000
commit7d0cc08e7f7f17d088d78f4b1bf68b00eb5502d2 (patch)
treef73b82cdde5629cc944e5f8a965aeee818fd838e /lib/libc
parent6bfc1a02b121816ebbe6b38f2879445550b2ea82 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/db/btree/bt_page.c2
-rw-r--r--lib/libc/db/btree/bt_split.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/db/btree/bt_page.c b/lib/libc/db/btree/bt_page.c
index 0d9d138d5cee..ce9cbf15a646 100644
--- a/lib/libc/db/btree/bt_page.c
+++ b/lib/libc/db/btree/bt_page.c
@@ -65,6 +65,7 @@ __bt_free(t, h)
h->prevpg = P_INVALID;
h->nextpg = t->bt_free;
t->bt_free = h->pgno;
+ F_SET(t, B_METADIRTY);
/* Make sure the page gets written back. */
return (mpool_put(t->bt_mp, h, MPOOL_DIRTY));
@@ -92,6 +93,7 @@ __bt_new(t, npg)
(h = mpool_get(t->bt_mp, t->bt_free, 0)) != NULL) {
*npg = t->bt_free;
t->bt_free = h->nextpg;
+ F_SET(t, B_METADIRTY);
return (h);
}
return (mpool_new(t->bt_mp, npg));
diff --git a/lib/libc/db/btree/bt_split.c b/lib/libc/db/btree/bt_split.c
index 1646d8215950..c7779b897c95 100644
--- a/lib/libc/db/btree/bt_split.c
+++ b/lib/libc/db/btree/bt_split.c
@@ -673,7 +673,8 @@ bt_psplit(t, h, l, r, pskip, ilen)
* where we decide to try and copy too much onto the left page.
* Make sure that doesn't happen.
*/
- if (skip <= off && used + nbytes >= full) {
+ if (skip <= off &&
+ used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) {
--off;
break;
}
@@ -686,7 +687,7 @@ bt_psplit(t, h, l, r, pskip, ilen)
memmove((char *)l + l->upper, src, nbytes);
}
- used += nbytes;
+ used += nbytes + sizeof(indx_t);
if (used >= half) {
if (!isbigkey || bigkeycnt == 3)
break;