summaryrefslogtreecommitdiffstats
path: root/lib/libc/db/btree/bt_page.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/db/btree/bt_page.c')
-rw-r--r--lib/libc/db/btree/bt_page.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/libc/db/btree/bt_page.c b/lib/libc/db/btree/bt_page.c
index d6a44941854..7b977bd0d36 100644
--- a/lib/libc/db/btree/bt_page.c
+++ b/lib/libc/db/btree/bt_page.c
@@ -1,7 +1,7 @@
-/* $NetBSD: bt_page.c,v 1.5 1995/02/27 13:20:36 cgd Exp $ */
+/* $NetBSD: bt_page.c,v 1.6 1996/05/03 21:50:49 cgd Exp $ */
/*-
- * Copyright (c) 1990, 1993
+ * Copyright (c) 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,9 +35,9 @@
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
-static char sccsid[] = "@(#)bt_page.c 8.2 (Berkeley) 2/21/94";
+static char sccsid[] = "@(#)bt_page.c 8.3 (Berkeley) 7/14/94";
#else
-static char rcsid[] = "$NetBSD: bt_page.c,v 1.5 1995/02/27 13:20:36 cgd Exp $";
+static char rcsid[] = "$NetBSD: bt_page.c,v 1.6 1996/05/03 21:50:49 cgd Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -49,7 +49,8 @@ static char rcsid[] = "$NetBSD: bt_page.c,v 1.5 1995/02/27 13:20:36 cgd Exp $";
#include "btree.h"
/*
- * __BT_FREE -- Put a page on the freelist.
+ * __bt_free --
+ * Put a page on the freelist.
*
* Parameters:
* t: tree
@@ -57,13 +58,16 @@ static char rcsid[] = "$NetBSD: bt_page.c,v 1.5 1995/02/27 13:20:36 cgd Exp $";
*
* Returns:
* RET_ERROR, RET_SUCCESS
+ *
+ * Side-effect:
+ * mpool_put's the page.
*/
int
__bt_free(t, h)
BTREE *t;
PAGE *h;
{
- /* Insert the page at the start of the free list. */
+ /* Insert the page at the head of the free list. */
h->prevpg = P_INVALID;
h->nextpg = t->bt_free;
t->bt_free = h->pgno;
@@ -73,7 +77,8 @@ __bt_free(t, h)
}
/*
- * __BT_NEW -- Get a new page, preferably from the freelist.
+ * __bt_new --
+ * Get a new page, preferably from the freelist.
*
* Parameters:
* t: tree
@@ -91,9 +96,9 @@ __bt_new(t, npg)
if (t->bt_free != P_INVALID &&
(h = mpool_get(t->bt_mp, t->bt_free, 0)) != NULL) {
- *npg = t->bt_free;
- t->bt_free = h->nextpg;
- return (h);
+ *npg = t->bt_free;
+ t->bt_free = h->nextpg;
+ return (h);
}
return (mpool_new(t->bt_mp, npg));
}