aboutsummaryrefslogtreecommitdiff
path: root/db2
diff options
context:
space:
mode:
Diffstat (limited to 'db2')
-rw-r--r--db2/Makefile4
-rw-r--r--db2/btree/bt_close.c8
-rw-r--r--db2/btree/bt_cursor.c30
-rw-r--r--db2/btree/bt_delete.c7
-rw-r--r--db2/btree/bt_open.c19
-rw-r--r--db2/btree/bt_page.c26
-rw-r--r--db2/btree/bt_put.c19
-rw-r--r--db2/btree/bt_rec.c113
-rw-r--r--db2/btree/bt_recno.c31
-rw-r--r--db2/btree/btree_auto.c22
-rw-r--r--db2/common/db_appinit.c7
-rw-r--r--db2/common/db_apprec.c129
-rw-r--r--db2/common/db_err.c28
-rw-r--r--db2/common/db_region.c77
-rw-r--r--db2/common/db_shash.c10
-rw-r--r--db2/db.h129
-rw-r--r--db2/db/db.c18
-rw-r--r--db2/db/db_auto.c22
-rw-r--r--db2/db/db_conv.c6
-rw-r--r--db2/db/db_dispatch.c11
-rw-r--r--db2/db/db_dup.c7
-rw-r--r--db2/db/db_pr.c4
-rw-r--r--db2/db/db_rec.c12
-rw-r--r--db2/db185/db185.c2
-rw-r--r--db2/db_185.h8
-rw-r--r--db2/db_int.h29
-rw-r--r--db2/dbm/dbm.c76
-rw-r--r--db2/hash/hash.c52
-rw-r--r--db2/hash/hash_auto.c20
-rw-r--r--db2/hash/hash_dup.c24
-rw-r--r--db2/hash/hash_page.c13
-rw-r--r--db2/hash/hash_rec.c4
-rw-r--r--db2/include/btree_ext.h18
-rw-r--r--db2/include/clib_ext.h3
-rw-r--r--db2/include/common_ext.h5
-rw-r--r--db2/include/db.h.src129
-rw-r--r--db2/include/db_185.h.src4
-rw-r--r--db2/include/db_am.h4
-rw-r--r--db2/include/db_ext.h14
-rw-r--r--db2/include/db_int.h.src29
-rw-r--r--db2/include/hash_ext.h15
-rw-r--r--db2/include/lock_ext.h12
-rw-r--r--db2/include/log.h13
-rw-r--r--db2/include/log_auto.h11
-rw-r--r--db2/include/log_ext.h16
-rw-r--r--db2/include/mp.h33
-rw-r--r--db2/include/mp_ext.h3
-rw-r--r--db2/include/mutex_ext.h5
-rw-r--r--db2/include/os_ext.h7
-rw-r--r--db2/include/os_func.h6
-rw-r--r--db2/include/txn_ext.h3
-rw-r--r--db2/lock/lock.c48
-rw-r--r--db2/lock/lock_util.c10
-rw-r--r--db2/log/log.c67
-rw-r--r--db2/log/log.src9
-rw-r--r--db2/log/log_archive.c4
-rw-r--r--db2/log/log_auto.c140
-rw-r--r--db2/log/log_get.c26
-rw-r--r--db2/log/log_put.c13
-rw-r--r--db2/log/log_rec.c102
-rw-r--r--db2/log/log_register.c55
-rw-r--r--db2/makedb.c6
-rw-r--r--db2/mp/mp_bh.c131
-rw-r--r--db2/mp/mp_fget.c13
-rw-r--r--db2/mp/mp_fopen.c34
-rw-r--r--db2/mp/mp_fput.c4
-rw-r--r--db2/mp/mp_pr.c4
-rw-r--r--db2/mp/mp_sync.c29
-rw-r--r--db2/mutex/mutex.c16
-rw-r--r--db2/os/os_alloc.c75
-rw-r--r--db2/os/os_config.c75
-rw-r--r--db2/os/os_stat.c31
-rw-r--r--db2/progs/db_checkpoint/db_checkpoint.c5
-rw-r--r--db2/progs/db_deadlock/db_deadlock.c4
-rw-r--r--db2/progs/db_load/db_load.c55
-rw-r--r--db2/progs/db_printlog/db_printlog.c5
-rw-r--r--db2/progs/db_recover/db_recover.c4
-rw-r--r--db2/progs/db_stat/db_stat.c19
-rw-r--r--db2/txn/txn.c12
79 files changed, 1313 insertions, 980 deletions
diff --git a/db2/Makefile b/db2/Makefile
index 0ae06a3089..02f1b300e6 100644
--- a/db2/Makefile
+++ b/db2/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
+# Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -58,7 +58,7 @@ libdb-routines := bt_close bt_compare bt_conv bt_cursor bt_delete \
bt_open bt_page bt_put bt_rec bt_recno bt_rsearch bt_search \
bt_split bt_stat btree_auto db db_appinit db_apprec \
db_auto \
- db_byteorder db_conv db_dispatch db_dup db_err db_log2 \
+ db_byteorder db_conv db_dispatch db_dup db_err db_log2 os_alloc \
os_abs os_config os_dir os_fid os_fsync os_map os_oflags \
os_open os_rpath os_rw os_seek os_sleep os_stat os_unlink \
os_spin db_overflow db_pr db_rec db_region db_ret db_salloc \
diff --git a/db2/btree/bt_close.c b/db2/btree/bt_close.c
index 7dd7139c66..ecccc9fe08 100644
--- a/db2/btree/bt_close.c
+++ b/db2/btree/bt_close.c
@@ -47,7 +47,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)bt_close.c 10.24 (Sleepycat) 9/17/97";
+static const char sccsid[] = "@(#)bt_close.c 10.25 (Sleepycat) 1/6/98";
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
@@ -144,7 +144,7 @@ __bam_upstat(dbp)
{
BTREE *t;
BTMETA *meta;
- DB_LOCK mlock;
+ DB_LOCK metalock;
db_pgno_t pgno;
int flags, ret;
@@ -161,7 +161,7 @@ __bam_upstat(dbp)
pgno = PGNO_METADATA;
/* Lock and retrieve the page. */
- if (__bam_lget(dbp, 0, pgno, DB_LOCK_WRITE, &mlock) != 0)
+ if (__bam_lget(dbp, 0, pgno, DB_LOCK_WRITE, &metalock) != 0)
return;
if (__bam_pget(dbp, (PAGE **)&meta, &pgno, 0) == 0) {
/* Log the change. */
@@ -178,5 +178,5 @@ __bam_upstat(dbp)
}
err: (void)memp_fput(dbp->mpf, (PAGE *)meta, flags);
- (void)__BT_LPUT(dbp, mlock);
+ (void)__BT_LPUT(dbp, metalock);
}
diff --git a/db2/btree/bt_cursor.c b/db2/btree/bt_cursor.c
index 47ecd7c66d..f526c965e5 100644
--- a/db2/btree/bt_cursor.c
+++ b/db2/btree/bt_cursor.c
@@ -8,7 +8,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)bt_cursor.c 10.37 (Sleepycat) 11/22/97";
+static const char sccsid[] = "@(#)bt_cursor.c 10.41 (Sleepycat) 1/8/98";
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
@@ -128,22 +128,25 @@ __bam_c_iclose(dbp, dbc)
CURSOR *cp;
int ret;
- cp = dbc->internal;
+ /*
+ * All cursors are queued from the master DB structure. For
+ * now, discard the DB handle which triggered this call, and
+ * replace it with the cursor's reference.
+ */
+ dbp = dbc->dbp;
/* If a cursor key was deleted, perform the actual deletion. */
+ cp = dbc->internal;
ret = F_ISSET(cp, C_DELETED) ? __bam_c_physdel(dbp, cp, NULL) : 0;
/* Discard any lock if we're not inside a transaction. */
if (cp->lock != LOCK_INVALID)
(void)__BT_TLPUT(dbp, cp->lock);
- /*
- * All cursors are queued from the master DB structure. Remove the
- * cursor from that queue.
- */
- DB_THREAD_LOCK(dbc->dbp);
- TAILQ_REMOVE(&dbc->dbp->curs_queue, dbc, links);
- DB_THREAD_UNLOCK(dbc->dbp);
+ /* Remove the cursor from the queue. */
+ DB_THREAD_LOCK(dbp);
+ TAILQ_REMOVE(&dbp->curs_queue, dbc, links);
+ DB_THREAD_UNLOCK(dbp);
/* Discard the structures. */
FREE(dbc->internal, sizeof(CURSOR));
@@ -452,6 +455,8 @@ __bam_c_rget(dbp, cp, data, flags)
db_recno_t recno;
int exact, ret;
+ COMPQUIET(flags, 0);
+
/* Get the page with the current item on it. */
if ((ret = __bam_pget(dbp, &cp->page, &cp->pgno, 0)) != 0)
return (ret);
@@ -1086,6 +1091,8 @@ __bam_ovfl_chk(dbp, cp, indx, to_end)
/*
* __bam_cprint --
* Display the current btree cursor list.
+ *
+ * PUBLIC: int __bam_cprint __P((DB *));
*/
int
__bam_cprint(dbp)
@@ -1258,12 +1265,11 @@ __bam_ca_dup(dbp, fpgno, first, fi, tpgno, ti)
* __bam_ca_move --
* Adjust the cursors when moving data items to another page.
*
- * PUBLIC: void __bam_ca_move __P((DB *, BTREE *, db_pgno_t, db_pgno_t));
+ * PUBLIC: void __bam_ca_move __P((DB *, db_pgno_t, db_pgno_t));
*/
void
-__bam_ca_move(dbp, t, fpgno, tpgno)
+__bam_ca_move(dbp, fpgno, tpgno)
DB *dbp;
- BTREE *t;
db_pgno_t fpgno, tpgno;
{
CURSOR *cp;
diff --git a/db2/btree/bt_delete.c b/db2/btree/bt_delete.c
index dbd1995f89..baa8a25401 100644
--- a/db2/btree/bt_delete.c
+++ b/db2/btree/bt_delete.c
@@ -47,7 +47,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)bt_delete.c 10.23 (Sleepycat) 11/22/97";
+static const char sccsid[] = "@(#)bt_delete.c 10.25 (Sleepycat) 1/8/98";
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
@@ -500,7 +500,8 @@ __bam_dpages(dbp, t)
db_recno_t rcnt;
int ret;
- rcnt = 0; /* XXX: Shut the compiler up. */
+ COMPQUIET(rcnt, 0);
+
epg = t->bt_sp;
/*
@@ -581,7 +582,7 @@ __bam_dpages(dbp, t)
++t->lstat.bt_freed;
/* Adjust the cursors. */
- __bam_ca_move(dbp, t, h->pgno, PGNO_ROOT);
+ __bam_ca_move(dbp, h->pgno, PGNO_ROOT);
}
/* Release the top page in the subtree. */
diff --git a/db2/btree/bt_open.c b/db2/btree/bt_open.c
index 2361f6