diff options
Diffstat (limited to 'db2')
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 |
