about summary refs log tree commit diff
path: root/db2/btree/bt_page.c
diff options
context:
space:
mode:
Diffstat (limited to 'db2/btree/bt_page.c')
-rw-r--r--db2/btree/bt_page.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/db2/btree/bt_page.c b/db2/btree/bt_page.c
index 853317e835..87f2811398 100644
--- a/db2/btree/bt_page.c
+++ b/db2/btree/bt_page.c
@@ -1,7 +1,7 @@
 /*-
  * See the file LICENSE for redistribution information.
  *
- * Copyright (c) 1996, 1997
+ * Copyright (c) 1996, 1997, 1998
  *	Sleepycat Software.  All rights reserved.
  */
 /*
@@ -47,14 +47,13 @@
 #include "config.h"
 
 #ifndef lint
-static const char sccsid[] = "@(#)bt_page.c	10.7 (Sleepycat) 1/7/98";
+static const char sccsid[] = "@(#)bt_page.c	10.12 (Sleepycat) 5/6/98";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
 #include <sys/types.h>
 
 #include <errno.h>
-#include <stdio.h>
 #include <string.h>
 #endif
 
@@ -142,7 +141,8 @@ __bam_free(dbp, h)
 	DBT ldbt;
 	DB_LOCK metalock;
 	db_pgno_t pgno;
-	int is_dirty, ret, t_ret;
+	u_int32_t dirty_flag;
+	int ret, t_ret;
 
 	/*
 	 * Retrieve the metadata page and insert the page at the head of
@@ -150,7 +150,7 @@ __bam_free(dbp, h)
 	 * fail, then we need to put the page with which we were called
 	 * back because our caller assumes we take care of it.
 	 */
-	is_dirty = 0;
+	dirty_flag = 0;
 	pgno = PGNO_METADATA;
 	if ((ret = __bam_lget(dbp, 0, pgno, DB_LOCK_WRITE, &metalock)) != 0)
 		goto err;
@@ -178,7 +178,7 @@ __bam_free(dbp, h)
 	 * The page should have nothing interesting on it, re-initialize it,
 	 * leaving only the page number and the LSN.
 	 */
-#ifdef DEBUG
+#ifdef DIAGNOSTIC
 	{ db_pgno_t __pgno; DB_LSN __lsn;
 		__pgno = h->pgno;
 		__lsn = h->lsn;
@@ -198,8 +198,8 @@ __bam_free(dbp, h)
 		ret = t_ret;
 
 	/* Discard the caller's page reference. */
-	is_dirty = DB_MPOOL_DIRTY;
-err:	if ((t_ret = memp_fput(dbp->mpf, h, is_dirty)) != 0 && ret == 0)
+	dirty_flag = DB_MPOOL_DIRTY;
+err:	if ((t_ret = memp_fput(dbp->mpf, h, dirty_flag)) != 0 && ret == 0)
 		ret = t_ret;
 
 	/*
@@ -248,8 +248,10 @@ __bam_lget(dbp, do_couple, pgno, mode, lockp)
 	u_int32_t locker;
 	int ret;
 
-	if (!F_ISSET(dbp, DB_AM_LOCKING))
+	if (!F_ISSET(dbp, DB_AM_LOCKING)) {
+		*lockp = LOCK_INVALID;
 		return (0);
+	}
 
 	locker = dbp->txn == NULL ? dbp->locker : dbp->txn->txnid;
 	dbp->lock.pgno = pgno;
@@ -300,15 +302,15 @@ __bam_lput(dbp, lock)
  * __bam_pget --
  *	The standard page get call.
  *
- * PUBLIC: int __bam_pget __P((DB *, PAGE **, db_pgno_t *, int));
+ * PUBLIC: int __bam_pget __P((DB *, PAGE **, db_pgno_t *, u_int32_t));
  */
 int
-__bam_pget(dbp, hp, pgnop, mflags)
+__bam_pget(dbp, hp, pgnop, mpool_flags)
 	DB *dbp;
 	PAGE **hp;
 	db_pgno_t *pgnop;
-	int mflags;
+	u_int32_t mpool_flags;
 {
 	return (memp_fget((dbp)->mpf,
-	    pgnop, mflags, hp) == 0 ? 0 : __db_pgerr(dbp, *pgnop));
+	    pgnop, mpool_flags, hp) == 0 ? 0 : __db_pgerr(dbp, *pgnop));
 }