RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm-5_3: db/ LICENSE README db/btree/ bt_compact.c bt_compa...

From: Jeff Johnson <jbj@rpm5.org>
Date: Mon 23 Aug 2010 - 15:38:52 CEST
Message-Id: <20100823133853.4327DD4BEF@rpm5.org>
  RPM Package Manager, CVS Repository
  /cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: db                               Date:   23-Aug-2010 15:38:52
  Branch: rpm-5_3                          Handle: 2010040116031712432924

  Modified files:           (Branch: rpm-5_3)
    db                      LICENSE README
    db/btree                bt_compact.c bt_compare.c bt_conv.c bt_curadj.c
                            bt_cursor.c bt_delete.c bt_method.c bt_open.c
                            bt_put.c bt_rec.c bt_reclaim.c bt_recno.c
                            bt_rsearch.c bt_search.c bt_split.c bt_stat.c
                            bt_upgrade.c bt_verify.c btree.src btree_auto.c
                            btree_autop.c
    db/build_android        Android.mk db.h db_config.h
    db/build_vxworks        BerkeleyDB20.wpj BerkeleyDB20small.wpj
                            BerkeleyDB22.wpj BerkeleyDB22small.wpj db.h
                            db_config.h db_config_small.h db_int.h
    db/build_vxworks/db_archive
                            db_archive.c db_archive20.wpj db_archive22.wpj
    db/build_vxworks/db_checkpoint
                            db_checkpoint.c db_checkpoint20.wpj
                            db_checkpoint22.wpj
    db/build_vxworks/db_deadlock
                            db_deadlock.c db_deadlock20.wpj db_deadlock22.wpj
    db/build_vxworks/db_dump
                            db_dump.c db_dump20.wpj db_dump22.wpj
    db/build_vxworks/db_hotbackup
                            db_hotbackup.c db_hotbackup20.wpj
                            db_hotbackup22.wpj
    db/build_vxworks/db_load
                            db_load.c db_load20.wpj db_load22.wpj
    db/build_vxworks/db_printlog
                            db_printlog.c db_printlog20.wpj db_printlog22.wpj
    db/build_vxworks/db_recover
                            db_recover.c db_recover20.wpj db_recover22.wpj
    db/build_vxworks/db_stat
                            db_stat.c db_stat20.wpj db_stat22.wpj
    db/build_vxworks/db_upgrade
                            db_upgrade.c db_upgrade20.wpj db_upgrade22.wpj
    db/build_vxworks/db_verify
                            db_verify.c db_verify20.wpj db_verify22.wpj
    db/build_vxworks/dbdemo dbdemo.c dbdemo20.wpj dbdemo22.wpj
    db/build_wince          db.h db_config.h
    db/build_windows        db.h db_config.h db_cxx.h db_int.h dbkill.cpp
                            include.tcl libdb.def libdb.rc
    db/clib                 getcwd.c getopt.c isalpha.c isdigit.c isprint.c
                            isspace.c memcmp.c memmove.c printf.c raise.c
                            snprintf.c strerror.c
    db/common               crypto_stub.c db_byteorder.c db_err.c db_getlong.c
                            db_idspace.c db_log2.c mkpath.c util_arg.c
                            util_cache.c util_log.c util_sig.c
    db/crypto               aes_method.c crypto.c
    db/csharp/Internal      DB.cs
    db/csharp/Properties    AssemblyInfo.cs
    db/cxx                  cxx_db.cpp cxx_dbc.cpp cxx_dbt.cpp cxx_env.cpp
                            cxx_except.cpp cxx_lock.cpp cxx_logc.cpp
                            cxx_mpool.cpp cxx_multi.cpp cxx_seq.cpp
                            cxx_txn.cpp
    db/db                   crdel.src crdel_auto.c crdel_autop.c crdel_rec.c
                            db.c db.src db_am.c db_auto.c db_autop.c db_cam.c
                            db_cds.c db_conv.c db_dispatch.c db_dup.c
                            db_iface.c db_join.c db_meta.c db_method.c
                            db_open.c db_overflow.c db_ovfl_vrfy.c db_pr.c
                            db_rec.c db_reclaim.c db_remove.c db_rename.c
                            db_ret.c db_setid.c db_setlsn.c db_stati.c
                            db_truncate.c db_upg.c db_upg_opd.c db_vrfy.c
                            db_vrfy_stub.c db_vrfyutil.c partition.c
    db/db185                db185.c db185_int.in
    db/db_archive           db_archive.c
    db/db_checkpoint        db_checkpoint.c
    db/db_deadlock          db_deadlock.c
    db/db_dump              db_dump.c
    db/db_dump185           db_dump185.c
    db/db_hotbackup         db_hotbackup.c
    db/db_load              db_load.c
    db/db_printlog          db_printlog.c
    db/db_recover           db_recover.c
    db/db_stat              db_stat.c dd.sh
    db/db_upgrade           db_upgrade.c
    db/db_verify            db_verify.c
    db/dbinc                btree.h crypto.h cxx_int.h db.in db_185.in db_am.h
                            db_cxx.in db_dispatch.h db_int.in db_join.h
                            db_page.h db_swap.h db_upgrade.h db_verify.h
                            debug.h fop.h globals.h hash.h hmac.h lock.h log.h
                            mp.h mutex.h mutex_int.h os.h qam.h queue.h
                            region.h rep.h repmgr.h shqueue.h tcl_db.h txn.h
    db/dbinc_auto           btree_auto.h btree_ext.h common_ext.h crdel_auto.h
                            db_auto.h db_ext.h dbreg_auto.h dbreg_ext.h
                            env_ext.h ext_def.in ext_prot.in fileops_auto.h
                            fileops_ext.h hash_auto.h hash_ext.h int_def.in
                            lock_ext.h log_ext.h mp_ext.h mutex_ext.h os_ext.h
                            qam_auto.h qam_ext.h rep_auto.h rep_ext.h
                            repmgr_ext.h tcl_ext.h txn_auto.h txn_ext.h
    db/dbm                  dbm.c
    db/dbreg                dbreg.c dbreg.src dbreg_auto.c dbreg_autop.c
                            dbreg_rec.c dbreg_stat.c dbreg_util.c
    db/dist                 ChangeLog Makefile.in RELEASE buildpkg bumprel
                            config.guess config.hin config.sub configure
                            configure.ac gen_inc.awk gen_rec.awk pubdef.in
                            s_all s_config s_docs s_include s_java_const
                            s_java_stat s_perm s_readme s_test s_vxworks
                            s_windows s_windows_dsp s_winmsi srcfiles.in
                            vx_config.in win_config.in win_exports.in
    db/dist/aclocal         options.m4
    db/dist/template        rec_btree rec_db rec_hash
    db/dist/vx_setup        LICENSE.TXT
    db/dist/winmsi          db.wxs s_winmsi.fcn
    db/env                  env_alloc.c env_config.c env_failchk.c env_file.c
                            env_method.c env_open.c env_recover.c env_region.c
                            env_register.c env_stat.c
    db/examples_c           bench_001.c ex_access.c ex_btrec.c ex_dbclient.c
                            ex_env.c ex_lock.c ex_mpool.c ex_sequence.c
                            ex_thread.c ex_tpcb.c
    db/examples_c/csv       DbRecord.c README code.c csv.h csv_extern.h db.c
                            load.c load_main.c query.c query_main.c util.c
    db/examples_c/ex_apprec ex_apprec.c ex_apprec.h ex_apprec.src
                            ex_apprec_auto.c ex_apprec_auto.h
                            ex_apprec_autop.c ex_apprec_rec.c
    db/examples_c/ex_rep/base
                            rep_base.c rep_base.h rep_msg.c rep_net.c
    db/examples_c/ex_rep/common
                            rep_common.c rep_common.h
    db/examples_c/ex_rep/mgr
                            rep_mgr.c
    db/examples_c/getting_started
                            example_database_load.c example_database_read.c
                            gettingstarted_common.c gettingstarted_common.h
    db/examples_c/txn_guide txn_guide.c txn_guide_inmemory.c
    db/examples_cxx         AccessExample.cpp BtRecExample.cpp EnvExample.cpp
                            LockExample.cpp MpoolExample.cpp
                            SequenceExample.cpp TpcbExample.cpp
    db/examples_cxx/excxx_repquote
                            RepConfigInfo.cpp RepConfigInfo.h
                            RepQuoteExample.cpp
    db/examples_cxx/getting_started
                            MyDb.cpp MyDb.hpp excxx_example_database_load.cpp
                            excxx_example_database_read.cpp
                            gettingStartedCommon.hpp
    db/examples_cxx/txn_guide
                            TxnGuide.cpp TxnGuideInMemory.cpp
    db/examples_java/src/collections/access
                            AccessExample.java
    db/examples_java/src/collections/hello
                            HelloDatabaseWorld.java
    db/examples_java/src/collections/ship/basic
                            PartData.java PartKey.java Sample.java
                            SampleDatabase.java SampleViews.java
                            ShipmentData.java ShipmentKey.java
                            SupplierData.java SupplierKey.java Weight.java
    db/examples_java/src/collections/ship/entity
                            Part.java PartData.java PartKey.java Sample.java
                            SampleDatabase.java SampleViews.java Shipment.java
                            ShipmentData.java ShipmentKey.java Supplier.java
                            SupplierData.java SupplierKey.java Weight.java
    db/examples_java/src/collections/ship/factory
                            Part.java PartKey.java Sample.java
                            SampleDatabase.java SampleViews.java Shipment.java
                            ShipmentKey.java Supplier.java SupplierKey.java
                            Weight.java
    db/examples_java/src/collections/ship/index
                            PartData.java PartKey.java Sample.java
                            SampleDatabase.java SampleViews.java
                            ShipmentData.java ShipmentKey.java
                            SupplierData.java SupplierKey.java Weight.java
    db/examples_java/src/collections/ship/marshal
                            MarshalledEnt.java MarshalledKey.java Part.java
                            PartKey.java Sample.java SampleDatabase.java
                            SampleViews.java Shipment.java ShipmentKey.java
                            Supplier.java SupplierKey.java Weight.java
    db/examples_java/src/collections/ship/sentity
                            Part.java PartKey.java Sample.java
                            SampleDatabase.java SampleViews.java Shipment.java
                            ShipmentKey.java Supplier.java SupplierKey.java
                            Weight.java
    db/examples_java/src/collections/ship/tuple
                            Part.java PartData.java PartKey.java Sample.java
                            SampleDatabase.java SampleViews.java Shipment.java
                            ShipmentData.java ShipmentKey.java Supplier.java
                            SupplierData.java SupplierKey.java Weight.java
    db/examples_java/src/db AccessExample.java BtRecExample.java
                            BulkAccessExample.java BulkAccessNIOExample.java
                            EnvExample.java LockExample.java
                            SequenceExample.java TpcbExample.java
    db/examples_java/src/db/GettingStarted
                            ExampleDatabaseLoad.java ExampleDatabaseRead.java
                            Inventory.java InventoryBinding.java
                            ItemNameKeyCreator.java MyDbs.java Vendor.java
    db/examples_java/src/db/repquote
                            RepConfig.java RepQuoteEnvironment.java
                            RepQuoteExample.java RepRemoteHost.java
    db/examples_java/src/db/txn
                            DBWriter.java PayloadData.java TxnGuide.java
                            TxnGuideInMemory.java
    db/examples_java/src/persist
                            CustomKeyOrderExample.java DplDump.java
                            EventExample.java EventExampleDPL.java
                            PersonExample.java
    db/examples_java/src/persist/gettingStarted
                            SimpleDA.java SimpleEntityClass.java
                            SimpleStoreGet.java SimpleStorePut.java
    db/examples_java/src/persist/txn
                            PayloadDataEntity.java StoreWriter.java
                            TxnGuideDPL.java
    db/fileops              fileops.src fileops_auto.c fileops_autop.c
                            fop_basic.c fop_rec.c fop_util.c
    db/hash                 hash.c hash.src hash_auto.c hash_autop.c
                            hash_compact.c hash_conv.c hash_dup.c hash_func.c
                            hash_meta.c hash_method.c hash_open.c hash_page.c
                            hash_rec.c hash_reclaim.c hash_stat.c hash_stub.c
                            hash_upgrade.c hash_verify.c
    db/hmac                 hmac.c
    db/hsearch              hsearch.c
    db/java/src/com/sleepycat/bind
                            ByteArrayBinding.java EntityBinding.java
                            EntryBinding.java RecordNumberBinding.java
    db/java/src/com/sleepycat/bind/serial
                            ClassCatalog.java SerialBase.java
                            SerialBinding.java SerialInput.java
                            SerialOutput.java SerialSerialBinding.java
                            SerialSerialKeyCreator.java
                            StoredClassCatalog.java TupleSerialBinding.java
                            TupleSerialKeyCreator.java
                            TupleSerialMarshalledBinding.java
                            TupleSerialMarshalledKeyCreator.java
    db/java/src/com/sleepycat/bind/tuple
                            BigIntegerBinding.java BooleanBinding.java
                            ByteBinding.java CharacterBinding.java
                            DoubleBinding.java FloatBinding.java
                            IntegerBinding.java LongBinding.java
                            MarshalledTupleEntry.java
                            MarshalledTupleKeyEntity.java ShortBinding.java
                            SortedDoubleBinding.java SortedFloatBinding.java
                            StringBinding.java TupleBase.java
                            TupleBinding.java TupleInput.java
                            TupleInputBinding.java TupleMarshalledBinding.java
                            TupleOutput.java TupleTupleBinding.java
                            TupleTupleKeyCreator.java
                            TupleTupleMarshalledBinding.java
                            TupleTupleMarshalledKeyCreator.java
    db/java/src/com/sleepycat/collections
                            BaseIterator.java BlockIterator.java
                            CurrentTransaction.java DataCursor.java
                            DataView.java MapEntryParameter.java
                            MyRangeCursor.java PrimaryKeyAssigner.java
                            StoredCollection.java StoredCollections.java
                            StoredContainer.java StoredEntrySet.java
                            StoredIterator.java StoredKeySet.java
                            StoredList.java StoredMap.java StoredMapEntry.java
                            StoredSortedEntrySet.java StoredSortedKeySet.java
                            StoredSortedMap.java StoredSortedValueSet.java
                            StoredValueSet.java TransactionRunner.java
                            TransactionWorker.java TupleSerialFactory.java
                            package.html
    db/java/src/com/sleepycat/compat
                            DbCompat.java
    db/java/src/com/sleepycat/db
                            BtreePrefixCalculator.java BtreeStats.java
                            CacheFile.java CacheFilePriority.java
                            CacheFileStats.java CacheStats.java
                            CheckpointConfig.java CompactConfig.java
                            CompactStats.java Cursor.java CursorConfig.java
                            Database.java DatabaseConfig.java
                            DatabaseEntry.java DatabaseException.java
                            DatabaseStats.java DatabaseType.java
                            DeadlockException.java Environment.java
                            EnvironmentConfig.java ErrorHandler.java
                            EventHandler.java EventHandlerAdapter.java
                            FeedbackHandler.java ForeignKeyDeleteAction.java
                            ForeignKeyNullifier.java
                            ForeignMultiKeyNullifier.java HashStats.java
                            Hasher.java JoinConfig.java JoinCursor.java
                            KeyRange.java Lock.java LockDetectMode.java
                            LockMode.java LockNotGrantedException.java
                            LockOperation.java LockRequest.java
                            LockRequestMode.java LockStats.java LogCursor.java
                            LogRecordHandler.java LogSequenceNumber.java
                            LogStats.java MemoryException.java
                            MessageHandler.java MultipleDataEntry.java
                            MultipleEntry.java MultipleKeyDataEntry.java
                            MultipleKeyNIODataEntry.java
                            MultipleNIODataEntry.java
                            MultipleRecnoDataEntry.java
                            MultipleRecnoNIODataEntry.java MutexStats.java
                            OperationStatus.java PanicHandler.java
                            PreparedTransaction.java QueueStats.java
                            RecordNumberAppender.java RecoveryOperation.java
                            ReplicationConfig.java
                            ReplicationDuplicateMasterException.java
                            ReplicationHandleDeadException.java
                            ReplicationHoldElectionException.java
                            ReplicationHostAddress.java
                            ReplicationJoinFailureException.java
                            ReplicationLeaseExpiredException.java
                            ReplicationLeaseTimeoutException.java
                            ReplicationLockoutException.java
                            ReplicationManagerAckPolicy.java
                            ReplicationManagerSiteInfo.java
                            ReplicationManagerStartPolicy.java
                            ReplicationManagerStats.java
                            ReplicationSiteUnavailableException.java
                            ReplicationStats.java ReplicationStatus.java
                            ReplicationTimeoutType.java
                            ReplicationTransport.java
                            RunRecoveryException.java SecondaryConfig.java
                            SecondaryCursor.java SecondaryDatabase.java
                            SecondaryKeyCreator.java
                            SecondaryMultiKeyCreator.java Sequence.java
                            SequenceConfig.java SequenceStats.java
                            StatsConfig.java Transaction.java
                            TransactionConfig.java TransactionStats.java
                            VerboseConfig.java VerifyConfig.java
                            VersionMismatchException.java package.html
    db/java/src/com/sleepycat/db/internal
                            Db.java DbConstants.java DbEnv.java DbLock.java
                            DbLogc.java DbMpoolFile.java DbSequence.java
                            DbTxn.java DbUtil.java Dbc.java db_java.java
                            db_javaJNI.java
    db/java/src/com/sleepycat/persist
                            BasicCursor.java BasicIndex.java
                            BasicIterator.java DataValueAdapter.java
                            DatabaseNamer.java EntityCursor.java
                            EntityIndex.java EntityJoin.java EntityStore.java
                            EntityValueAdapter.java ForwardCursor.java
                            KeySelector.java KeyValueAdapter.java
                            KeysIndex.java PrimaryIndex.java
                            PrimaryKeyValueAdapter.java SecondaryIndex.java
                            StoreConfig.java SubIndex.java SubIndexCursor.java
                            ValueAdapter.java
    db/java/src/com/sleepycat/persist/evolve
                            Conversion.java Converter.java
                            DeletedClassException.java Deleter.java
                            EntityConverter.java EvolveConfig.java
                            EvolveEvent.java EvolveInternal.java
                            EvolveListener.java EvolveStats.java
                            IncompatibleClassException.java Mutation.java
                            Mutations.java Renamer.java
    db/java/src/com/sleepycat/persist/impl
                            AbstractInput.java Accessor.java Catalog.java
                            CollectionProxy.java ComplexFormat.java
                            CompositeKeyFormat.java ConverterReader.java
                            Enhanced.java EnhancedAccessor.java
                            EntityInput.java EntityOutput.java EnumFormat.java
                            Evolver.java FieldInfo.java Format.java
                            KeyLocation.java MapProxy.java
                            NonPersistentFormat.java ObjectArrayFormat.java
                            PersistCatalog.java PersistComparator.java
                            PersistEntityBinding.java PersistKeyAssigner.java
                            PersistKeyBinding.java PersistKeyCreator.java
                            PrimitiveArrayFormat.java ProxiedFormat.java
                            RawAbstractInput.java RawAccessor.java
                            RawArrayInput.java RawComplexInput.java
                            RawSingleInput.java ReadOnlyCatalog.java
                            Reader.java RecordInput.java RecordOutput.java
                            ReflectionAccessor.java SimpleCatalog.java
                            SimpleFormat.java Store.java StoredModel.java
                            VisitedObjects.java WidenerInput.java
    db/java/src/com/sleepycat/persist/model
                            AnnotationModel.java BytecodeEnhancer.java
                            ClassEnhancer.java ClassMetadata.java
                            DeleteAction.java Entity.java EntityMetadata.java
                            EntityModel.java FieldMetadata.java KeyField.java
                            ModelInternal.java Persistent.java
                            PersistentProxy.java PrimaryKey.java
                            PrimaryKeyMetadata.java Relationship.java
                            SecondaryKey.java SecondaryKeyMetadata.java
    db/java/src/com/sleepycat/persist/raw
                            RawField.java RawObject.java RawStore.java
                            RawType.java
    db/java/src/com/sleepycat/util
                            ErrorBuffer.java ExceptionUnwrapper.java
                            ExceptionWrapper.java FastInputStream.java
                            FastOutputStream.java IOExceptionWrapper.java
                            PackedInteger.java RuntimeExceptionWrapper.java
                            UtfOps.java
    db/java/src/com/sleepycat/util/keyrange
                            KeyRange.java KeyRangeException.java
                            RangeCursor.java
    db/libdb_csharp         db.i
    db/libdb_java           README db.i db_java.i db_java_wrap.c java-post.pl
                            java_callbacks.i java_except.i java_stat.i
                            java_stat_auto.c java_typemaps.i java_util.i
    db/lock                 Design lock.c lock_deadlock.c lock_failchk.c
                            lock_id.c lock_list.c lock_method.c lock_region.c
                            lock_stat.c lock_timer.c lock_util.c
    db/log                  log.c log_archive.c log_compare.c log_debug.c
                            log_get.c log_method.c log_put.c log_stat.c
    db/mod_db4              Makefile.in configure.in mm_hash.c mm_hash.h
                            mod_db4.c mod_db4_export.h sem_utils.c sem_utils.h
                            utils.c utils.h
    db/mp                   mp_alloc.c mp_bh.c mp_fget.c mp_fmethod.c
                            mp_fopen.c mp_fput.c mp_fset.c mp_method.c
                            mp_mvcc.c mp_region.c mp_register.c mp_resize.c
                            mp_stat.c mp_sync.c mp_trickle.c
    db/mutex                mut_alloc.c mut_failchk.c mut_fcntl.c mut_method.c
                            mut_pthread.c mut_region.c mut_stat.c mut_tas.c
                            mut_win32.c uts4_cc.s
    db/os                   os_abs.c os_alloc.c os_clock.c os_config.c
                            os_dir.c os_errno.c os_fid.c os_flock.c os_fsync.c
                            os_getenv.c os_handle.c os_map.c os_mkdir.c
                            os_open.c os_pid.c os_rename.c os_root.c
                            os_rpath.c os_rw.c os_seek.c os_stat.c os_tmpdir.c
                            os_truncate.c os_uid.c os_unlink.c os_yield.c
    db/os_vxworks           os_vx_abs.c os_vx_config.c os_vx_map.c
                            os_vx_rpath.c
    db/os_windows           os_abs.c os_clock.c os_config.c os_dir.c
                            os_errno.c os_fid.c os_flock.c os_fsync.c
                            os_getenv.c os_handle.c os_map.c os_open.c
                            os_rename.c os_rw.c os_seek.c os_stat.c
                            os_truncate.c os_unlink.c os_yield.c
    db/perl/BerkeleyDB      BerkeleyDB.pm BerkeleyDB.pod BerkeleyDB.pod.P
                            BerkeleyDB.xs Changes META.yml README
    db/perl/BerkeleyDB/t    btree.t hash.t queue.t recno.t
    db/php_db4              config.m4 db4.cpp php_db4.h
    db/php_db4/samples      transactional_counter.php
    db/qam                  qam.c qam.src qam_auto.c qam_autop.c qam_conv.c
                            qam_files.c qam_method.c qam_open.c qam_rec.c
                            qam_stat.c qam_stub.c qam_upgrade.c qam_verify.c
    db/rep                  rep.src rep_auto.c rep_backup.c rep_elect.c
                            rep_log.c rep_method.c rep_record.c rep_region.c
                            rep_stat.c rep_stub.c rep_util.c rep_verify.c
    db/repmgr               repmgr_elect.c repmgr_method.c repmgr_msg.c
                            repmgr_net.c repmgr_posix.c repmgr_queue.c
                            repmgr_sel.c repmgr_stat.c repmgr_util.c
                            repmgr_windows.c
    db/sequence             seq_stat.c sequence.c
    db/sql/adapter          btree.c
    db/sql/generated        sqlite3.c
    db/sql/odbc             ChangeLog README VERSION blobtoxy.rc libtool
                            resource3.h sqlite3odbc.c sqlite3odbc.rc
                            sqlite3odbc.rc.in sqliteodbc.c sqliteodbc.rc
                            sqliteodbc.spec
    db/stl                  dbstl_resource_manager.cpp
                            dbstl_resource_manager.h
    db/tcl                  tcl_compat.c tcl_db.c tcl_db_pkg.c tcl_dbcursor.c
                            tcl_env.c tcl_internal.c tcl_lock.c tcl_log.c
                            tcl_mp.c tcl_rep.c tcl_seq.c tcl_txn.c tcl_util.c
    db/tcl/docs             db.html env.html historic.html index.html
                            library.html lock.html log.html mpool.html
                            rep.html sequence.html test.html txn.html
    db/test                 README TESTS archive.tcl bigfile001.tcl
                            bigfile002.tcl byteorder.tcl conscript.tcl dbm.tcl
                            dbscript.tcl ddoyscript.tcl ddscript.tcl
                            dead001.tcl dead002.tcl dead003.tcl dead004.tcl
                            dead005.tcl dead006.tcl dead007.tcl env001.tcl
                            env002.tcl env003.tcl env004.tcl env005.tcl
                            env006.tcl env007.tcl env008.tcl env009.tcl
                            env010.tcl env011.tcl env012.tcl env013.tcl
                            env014.tcl env015.tcl envscript.tcl fop001.tcl
                            fop002.tcl fop003.tcl fop004.tcl fop005.tcl
                            fop006.tcl fop007.tcl fop008.tcl fopscript.tcl
                            foputils.tcl hsearch.tcl join.tcl lock001.tcl
                            lock002.tcl lock003.tcl lock004.tcl lock005.tcl
                            lock006.tcl lockscript.tcl log001.tcl log002.tcl
                            log003.tcl log004.tcl log005.tcl log006.tcl
                            log007.tcl log008.tcl log008script.tcl log009.tcl
                            logtrack.list logtrack.tcl mdbscript.tcl
                            memp001.tcl memp002.tcl memp003.tcl memp004.tcl
                            mpoolscript.tcl ndbm.tcl parallel.tcl plat001.tcl
                            recd001.tcl recd002.tcl recd003.tcl recd004.tcl
                            recd005.tcl recd006.tcl recd007.tcl recd008.tcl
                            recd009.tcl recd010.tcl recd011.tcl recd012.tcl
                            recd013.tcl recd014.tcl recd015.tcl recd016.tcl
                            recd017.tcl recd018.tcl recd019.tcl recd020.tcl
                            recd021.tcl recd022.tcl recd023.tcl recd15scr.tcl
                            recdscript.tcl rep001.tcl rep002.tcl rep003.tcl
                            rep005.tcl rep006.tcl rep007.tcl rep008.tcl
                            rep009.tcl rep010.tcl rep011.tcl rep012.tcl
                            rep013.tcl rep014.tcl rep015.tcl rep016.tcl
                            rep017.tcl rep017script.tcl rep018.tcl
                            rep018script.tcl rep019.tcl rep020.tcl rep021.tcl
                            rep022.tcl rep023.tcl rep024.tcl rep025.tcl
                            rep026.tcl rep027.tcl rep028.tcl rep029.tcl
                            rep030.tcl rep031.tcl rep032.tcl rep033.tcl
                            rep034.tcl rep035.tcl rep035script.tcl rep036.tcl
                            rep036script.tcl rep037.tcl rep038.tcl rep039.tcl
                            rep040.tcl rep040script.tcl rep041.tcl rep042.tcl
                            rep042script.tcl rep043.tcl rep043script.tcl
                            rep044.tcl rep045.tcl rep045script.tcl rep046.tcl
                            rep047.tcl rep048.tcl rep048script.tcl rep049.tcl
                            rep050.tcl rep051.tcl rep052.tcl rep053.tcl
                            rep054.tcl rep055.tcl rep058.tcl rep060.tcl
                            rep061.tcl rep062.tcl rep063.tcl rep064.tcl
                            rep065.tcl rep065script.tcl rep066.tcl
                            reputils.tcl rpc001.tcl rpc002.tcl rpc003.tcl
                            rpc004.tcl rpc005.tcl rpc006.tcl rsrc001.tcl
                            rsrc002.tcl rsrc003.tcl rsrc004.tcl sdb001.tcl
                            sdb002.tcl sdb003.tcl sdb004.tcl sdb005.tcl
                            sdb006.tcl sdb007.tcl sdb008.tcl sdb009.tcl
                            sdb010.tcl sdb011.tcl sdb012.tcl sdb013.tcl
                            sdb014.tcl sdb015.tcl sdb016.tcl sdb017.tcl
                            sdb018.tcl sdb019.tcl sdb020.tcl sdbscript.tcl
                            sdbtest001.tcl sdbtest002.tcl sdbutils.tcl
                            sec001.tcl sec002.tcl shelltest.tcl si001.tcl
                            si002.tcl si003.tcl si004.tcl si005.tcl si006.tcl
                            si007.tcl si008.tcl sijointest.tcl siutils.tcl
                            sysscript.tcl t106script.tcl test.tcl test001.tcl
                            test002.tcl test003.tcl test004.tcl test005.tcl
                            test006.tcl test007.tcl test008.tcl test009.tcl
                            test010.tcl test011.tcl test012.tcl test013.tcl
                            test014.tcl test015.tcl test016.tcl test017.tcl
                            test018.tcl test019.tcl test020.tcl test021.tcl
                            test022.tcl test023.tcl test024.tcl test025.tcl
                            test026.tcl test027.tcl test028.tcl test029.tcl
                            test030.tcl test031.tcl test032.tcl test033.tcl
                            test034.tcl test035.tcl test036.tcl test037.tcl
                            test038.tcl test039.tcl test040.tcl test041.tcl
                            test042.tcl test043.tcl test044.tcl test045.tcl
                            test046.tcl test047.tcl test048.tcl test049.tcl
                            test050.tcl test051.tcl test052.tcl test053.tcl
                            test054.tcl test055.tcl test056.tcl test057.tcl
                            test058.tcl test059.tcl test060.tcl test061.tcl
                            test062.tcl test063.tcl test064.tcl test065.tcl
                            test066.tcl test067.tcl test068.tcl test069.tcl
                            test070.tcl test071.tcl test072.tcl test073.tcl
                            test074.tcl test076.tcl test077.tcl test078.tcl
                            test079.tcl test081.tcl test082.tcl test083.tcl
                            test084.tcl test085.tcl test086.tcl test087.tcl
                            test088.tcl test089.tcl test090.tcl test091.tcl
                            test092.tcl test093.tcl test094.tcl test095.tcl
                            test096.tcl test097.tcl test098.tcl test099.tcl
                            test100.tcl test101.tcl test102.tcl test103.tcl
                            test106.tcl test107.tcl test109.tcl test110.tcl
                            test111.tcl test112.tcl test113.tcl test114.tcl
                            test115.tcl test116.tcl test117.tcl test119.tcl
                            test120.tcl test121.tcl test122.tcl testparams.tcl
                            testutils.tcl txn001.tcl txn002.tcl txn003.tcl
                            txn004.tcl txn005.tcl txn006.tcl txn007.tcl
                            txn008.tcl txn009.tcl txn010.tcl txn011.tcl
                            txn012.tcl txn012script.tcl txn013.tcl
                            txnscript.tcl update.tcl upgrade.tcl wrap.tcl
    db/test/scr003          chk.define
    db/test/scr004          chk.javafiles
    db/test/scr006          chk.offt
    db/test/scr007          chk.proto
    db/test/scr008          chk.pubdef
    db/test/scr009          chk.srcfiles
    db/test/scr010          spell.ok
    db/test/scr012          chk.vx_code
    db/test/scr013          chk.stats
    db/test/scr015          TestConstruct01.cpp TestGetSetMethods.cpp
                            TestKeyRange.cpp TestLogc.cpp TestSimpleAccess.cpp
                            TestTruncate.cpp
    db/test/scr017          t.c
    db/test/scr018          chk.comma t.c
    db/test/scr019          chk.include
    db/test/scr021          chk.flags t.c
    db/test/scr023          q.c
    db/test/scr024          chk.bdb
    db/test/scr024/src/com/sleepycat/bind/serial/test
                            MarshalledObject.java NullClassCatalog.java
                            SerialBindingTest.java TestClassCatalog.java
    db/test/scr024/src/com/sleepycat/bind/test
                            BindingSpeedTest.java
    db/test/scr024/src/com/sleepycat/bind/tuple/test
                            MarshalledObject.java TupleBindingTest.java
                            TupleFormatTest.java TupleOrderingTest.java
    db/test/scr024/src/com/sleepycat/collections
                            KeyRangeTest.java
    db/test/scr024/src/com/sleepycat/collections/test
                            CollectionTest.java DbTestUtil.java
                            IterDeadlockTest.java JoinTest.java
                            NullTransactionRunner.java
                            SecondaryDeadlockTest.java TestDataBinding.java
                            TestEntity.java TestEntityBinding.java
                            TestEnv.java TestKeyAssigner.java
                            TestKeyCreator.java TestStore.java
                            TransactionTest.java
    db/test/scr024/src/com/sleepycat/collections/test/serial
                            CatalogCornerCaseTest.java
                            StoredClassCatalogTest.java
                            StoredClassCatalogTestInit.java TestSerial.java
                            TestSerial.java.original
    db/test/scr024/src/com/sleepycat/util/test
                            ExceptionWrapperTest.java
                            FastOutputStreamTest.java PackedIntegerTest.java
                            UtfTest.java
    db/test/scr025          TestMulti.cpp
    db/test/scr026          chk.method
    db/test/scr028          t.c
    db/test/scr029          t.c
    db/test/scr037          BTreeDatabaseTest.cs
    db/test/scr038/data     17925.sql
    db/txn                  txn.c txn.src txn_auto.c txn_autop.c txn_chkpt.c
                            txn_failchk.c txn_method.c txn_rec.c txn_recover.c
                            txn_region.c txn_stat.c txn_util.c
  Removed files:            (Branch: rpm-5_3)
    db/build_brew           db.h db_config.h
    db/build_s60            db.h db_config.h
    db/build_windows        Berkeley_DB.dsw app_dsp.src build_all.dsp
                            db_archive.dsp db_checkpoint.dsp db_deadlock.dsp
                            db_dll.dsp db_dump.dsp db_hotbackup.dsp
                            db_java.dsp db_java.dsp.postbuild db_java_xa.dsp
                            db_java_xaj.mak db_load.dsp db_printlog.dsp
                            db_recover.dsp db_small.dsp db_stat.dsp
                            db_static.dsp db_tcl.dsp db_test.dsp
                            db_upgrade.dsp db_verify.dsp dynamic_dsp.src
                            ex_access.dsp ex_btrec.dsp ex_csvcode.dsp
                            ex_csvcode.dsp.postbuild ex_csvload.dsp
                            ex_csvquery.dsp ex_env.dsp ex_lock.dsp
                            ex_mpool.dsp ex_rep_base.dsp ex_rep_mgr.dsp
                            ex_sequence.dsp ex_tpcb.dsp ex_txnguide.dsp
                            ex_txnguide_inmem.dsp example_database_load.dsp
                            example_database_read.dsp excxx_access.dsp
                            excxx_btrec.dsp excxx_env.dsp
                            excxx_example_database_load.dsp
                            excxx_example_database_read.dsp excxx_lock.dsp
                            excxx_mpool.dsp excxx_repquote.dsp
                            excxx_sequence.dsp excxx_tpcb.dsp
                            excxx_txnguide.dsp excxx_txnguide_inmem.dsp
                            srcfile_dsp.src static_dsp.src
    db/db_sql               buildpt.c generate.c
    db/dist/winmsi          dbcorewix.in dbvarsbat.in dbwix.m4 environment.in
                            features.in files.in links.in winbuild.bat
    db/dist/winmsi/images   caticon.ibd foldernew.ibd folderup.ibd oracle.jpg
                            topstripe.ibd webicon.ico
    db/docs_src/images      api.gif next.gif prev.gif ps.gif ref.gif
    db/docs_src/ref/arch    bigpic.gif smallpic.gif
    db/docs_src/ref/install/ARCHIVE
                            __B.BE.185 __B.BE.186 __B.BE.2 __B.LE.185
                            __B.LE.186 __B.LE.2 __H.BE.185 __H.BE.186 __H.BE.2
                            __H.LE.185 __H.LE.186 __H.LE.2

  Log:
    - db: join db-5.0.26 onto the rpm-5_3 branch.

  Summary:
    Revision    Changes     Path
    1.9.2.1     +1  -1      db/LICENSE
    1.18.2.1    +2  -2      db/README
    1.7.2.1     +337 -761   db/btree/bt_compact.c
    1.9.2.1     +1  -1      db/btree/bt_compare.c
    1.9.2.1     +1  -1      db/btree/bt_conv.c
    1.9.2.1     +400 -326   db/btree/bt_curadj.c
    1.9.2.1     +12 -10     db/btree/bt_cursor.c
    1.9.2.1     +14 -121    db/btree/bt_delete.c
    1.9.2.1     +2  -2      db/btree/bt_method.c
    1.9.2.1     +6  -10     db/btree/bt_open.c
    1.10.2.1    +70 -56     db/btree/bt_put.c
    1.9.2.1     +574 -572   db/btree/bt_rec.c
    1.9.2.1     +3  -3      db/btree/bt_reclaim.c
    1.9.2.1     +148 -121   db/btree/bt_recno.c
    1.9.2.1     +11 -10     db/btree/bt_rsearch.c
    1.10.2.1    +33 -27     db/btree/bt_search.c
    1.9.2.1     +37 -27     db/btree/bt_split.c
    1.9.2.1     +15 -24     db/btree/bt_stat.c
    1.9.2.1     +1  -1      db/btree/bt_upgrade.c
    1.10.2.1    +2  -2      db/btree/bt_verify.c
    1.9.2.1     +43 -44     db/btree/btree.src
    1.10.2.1    +158 -3498  db/btree/btree_auto.c
    1.7.2.1     +72 -547    db/btree/btree_autop.c
    1.1.1.1.2.1 +180 -180   db/build_android/Android.mk
    1.1.1.1.2.1 +4  -4      db/build_android/db.h
    1.1.1.1.2.1 +3  -3      db/build_android/db_config.h
    1.3         +0  -2691   db/build_brew/db.h
    1.3         +0  -598    db/build_brew/db_config.h
    1.3         +0  -2674   db/build_s60/db.h
    1.3         +0  -597    db/build_s60/db_config.h
    1.8.2.1     +367 -6     db/build_vxworks/BerkeleyDB20.wpj
    1.7.2.1     +76 -0      db/build_vxworks/BerkeleyDB20small.wpj
    1.8.2.1     +367 -6     db/build_vxworks/BerkeleyDB22.wpj
    1.7.2.1     +76 -0      db/build_vxworks/BerkeleyDB22small.wpj
    1.18.2.1    +228 -105   db/build_vxworks/db.h
    1.11.2.1    +7  -7      db/build_vxworks/db_archive/db_archive.c
    1.2.10.1    +0  -16     db/build_vxworks/db_archive/db_archive20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_archive/db_archive22.wpj
    1.12.2.1    +8  -8      db/build_vxworks/db_checkpoint/db_checkpoint.c
    1.2.10.1    +0  -16     db/build_vxworks/db_checkpoint/db_checkpoint20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_checkpoint/db_checkpoint22.wpj
    1.18.2.1    +33 -6      db/build_vxworks/db_config.h
    1.14.2.1    +33 -6      db/build_vxworks/db_config_small.h
    1.11.2.1    +8  -8      db/build_vxworks/db_deadlock/db_deadlock.c
    1.2.10.1    +0  -16     db/build_vxworks/db_deadlock/db_deadlock20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_deadlock/db_deadlock22.wpj
    1.11.2.1    +13 -4      db/build_vxworks/db_dump/db_dump.c
    1.2.10.1    +0  -16     db/build_vxworks/db_dump/db_dump20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_dump/db_dump22.wpj
    1.6.2.1     +22 -20     db/build_vxworks/db_hotbackup/db_hotbackup.c
    1.2.10.1    +0  -16     db/build_vxworks/db_hotbackup/db_hotbackup20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_hotbackup/db_hotbackup22.wpj
    1.13.2.1    +128 -34    db/build_vxworks/db_int.h
    1.13.2.1    +35 -12     db/build_vxworks/db_load/db_load.c
    1.2.10.1    +0  -16     db/build_vxworks/db_load/db_load20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_load/db_load22.wpj
    1.12.2.1    +91 -92     db/build_vxworks/db_printlog/db_printlog.c
    1.3.4.1     +0  -144    db/build_vxworks/db_printlog/db_printlog20.wpj
    1.3.4.1     +0  -144    db/build_vxworks/db_printlog/db_printlog22.wpj
    1.11.2.1    +6  -6      db/build_vxworks/db_recover/db_recover.c
    1.2.10.1    +0  -16     db/build_vxworks/db_recover/db_recover20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_recover/db_recover22.wpj
    1.11.2.1    +15 -6      db/build_vxworks/db_stat/db_stat.c
    1.2.10.1    +0  -16     db/build_vxworks/db_stat/db_stat20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_stat/db_stat22.wpj
    1.11.2.1    +10 -10     db/build_vxworks/db_upgrade/db_upgrade.c
    1.2.10.1    +0  -16     db/build_vxworks/db_upgrade/db_upgrade20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_upgrade/db_upgrade22.wpj
    1.11.2.1    +17 -14     db/build_vxworks/db_verify/db_verify.c
    1.2.10.1    +0  -16     db/build_vxworks/db_verify/db_verify20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/db_verify/db_verify22.wpj
    1.11.2.1    +1  -1      db/build_vxworks/dbdemo/dbdemo.c
    1.2.10.1    +0  -16     db/build_vxworks/dbdemo/dbdemo20.wpj
    1.2.10.1    +0  -16     db/build_vxworks/dbdemo/dbdemo22.wpj
    1.2.2.1     +227 -105   db/build_wince/db.h
    1.2.2.1     +30 -5      db/build_wince/db_config.h
    1.4         +0  -833    db/build_windows/Berkeley_DB.dsw
    1.5         +0  -93     db/build_windows/app_dsp.src
    1.4         +0  -70     db/build_windows/build_all.dsp
    1.7.2.1     +227 -105   db/build_windows/db.h
    1.5         +0  -94     db/build_windows/db_archive.dsp
    1.5         +0  -94     db/build_windows/db_checkpoint.dsp
    1.7.2.1     +31 -4      db/build_windows/db_config.h
    1.4.2.1     +11 -2      db/build_windows/db_cxx.h
    1.5         +0  -94     db/build_windows/db_deadlock.dsp
    1.5         +0  -1053   db/build_windows/db_dll.dsp
    1.5         +0  -94     db/build_windows/db_dump.dsp
    1.5         +0  -94     db/build_windows/db_hotbackup.dsp
    1.4.2.1     +128 -34    db/build_windows/db_int.h
    1.5         +0  -127    db/build_windows/db_java.dsp
    1.3         +0  -15     db/build_windows/db_java.dsp.postbuild
    1.2         +0  -85     db/build_windows/db_java_xa.dsp
    1.2         +0  -21     db/build_windows/db_java_xaj.mak
    1.5         +0  -94     db/build_windows/db_load.dsp
    1.5         +0  -126    db/build_windows/db_printlog.dsp
    1.5         +0  -94     db/build_windows/db_recover.dsp
    1.5         +0  -832    db/build_windows/db_small.dsp
    1.5         +0  -94     db/build_windows/db_stat.dsp
    1.5         +0  -1036   db/build_windows/db_static.dsp
    1.5         +0  -161    db/build_windows/db_tcl.dsp
    1.5         +0  -94     db/build_windows/db_test.dsp
    1.5         +0  -94     db/build_windows/db_upgrade.dsp
    1.5         +0  -94     db/build_windows/db_verify.dsp
    1.4.2.1     +1  -1      db/build_windows/dbkill.cpp
    1.5         +0  -96     db/build_windows/dynamic_dsp.src
    1.5         +0  -94     db/build_windows/ex_access.dsp
    1.5         +0  -94     db/build_windows/ex_btrec.dsp
    1.5         +0  -104    db/build_windows/ex_csvcode.dsp
    1.3         +0  -5      db/build_windows/ex_csvcode.dsp.postbuild
    1.5         +0  -114    db/build_windows/ex_csvload.dsp
    1.5         +0  -114    db/build_windows/ex_csvquery.dsp
    1.5         +0  -94     db/build_windows/ex_env.dsp
    1.5         +0  -94     db/build_windows/ex_lock.dsp
    1.5         +0  -94     db/build_windows/ex_mpool.dsp
    1.5         +0  -106    db/build_windows/ex_rep_base.dsp
    1.5         +0  -98     db/build_windows/ex_rep_mgr.dsp
    1.5         +0  -94     db/build_windows/ex_sequence.dsp
    1.5         +0  -94     db/build_windows/ex_tpcb.dsp
    1.5         +0  -94     db/build_windows/ex_txnguide.dsp
    1.5         +0  -94     db/build_windows/ex_txnguide_inmem.dsp
    1.5         +0  -98     db/build_windows/example_database_load.dsp
    1.5         +0  -98     db/build_windows/example_database_read.dsp
    1.5         +0  -94     db/build_windows/excxx_access.dsp
    1.5         +0  -94     db/build_windows/excxx_btrec.dsp
    1.5         +0  -94     db/build_windows/excxx_env.dsp
    1.5         +0  -98     db/build_windows/excxx_example_database_load.dsp
    1.5         +0  -98     db/build_windows/excxx_example_database_read.dsp
    1.5         +0  -94     db/build_windows/excxx_lock.dsp
    1.5         +0  -94     db/build_windows/excxx_mpool.dsp
    1.5         +0  -98     db/build_windows/excxx_repquote.dsp
    1.5         +0  -94     db/build_windows/excxx_sequence.dsp
    1.5         +0  -94     db/build_windows/excxx_tpcb.dsp
    1.5         +0  -94     db/build_windows/excxx_txnguide.dsp
    1.5         +0  -94     db/build_windows/excxx_txnguide_inmem.dsp
    1.4.2.1     +1  -1      db/build_windows/include.tcl
    1.5.2.1     +209 -193   db/build_windows/libdb.def
    1.7.2.1     +7  -7      db/build_windows/libdb.rc
    1.2         +0  -4      db/build_windows/srcfile_dsp.src
    1.5         +0  -85     db/build_windows/static_dsp.src
    1.9.2.1     +1  -1      db/clib/getcwd.c
    1.9.2.1     +12 -4      db/clib/getopt.c
    1.4.2.1     +1  -1      db/clib/isalpha.c
    1.4.2.1     +1  -1      db/clib/isdigit.c
    1.4.2.1     +1  -1      db/clib/isprint.c
    1.4.2.1     +1  -1      db/clib/isspace.c
    1.9.2.1     +1  -1      db/clib/memcmp.c
    1.9.2.1     +1  -1      db/clib/memmove.c
    1.4.2.1     +1  -1      db/clib/printf.c
    1.9.2.1     +1  -1      db/clib/raise.c
    1.9.2.1     +1  -1      db/clib/snprintf.c
    1.9.2.1     +1  -1      db/clib/strerror.c
    1.8.2.1     +1  -1      db/common/crypto_stub.c
    1.9.2.1     +1  -1      db/common/db_byteorder.c
    1.9.2.1     +48 -15     db/common/db_err.c
    1.10.2.1    +1  -1      db/common/db_getlong.c
    1.9.2.1     +1  -1      db/common/db_idspace.c
    1.9.2.1     +1  -1      db/common/db_log2.c
    1.4.2.1     +1  -1      db/common/mkpath.c
    1.10.2.1    +1  -1      db/common/util_arg.c
    1.9.2.1     +1  -1      db/common/util_cache.c
    1.9.2.1     +1  -1      db/common/util_log.c
    1.9.2.1     +1  -1      db/common/util_sig.c
    1.10.2.1    +83 -1      db/crypto/aes_method.c
    1.10.2.1    +1  -1      db/crypto/crypto.c
    1.1.1.2.2.1 +1  -4      db/csharp/Internal/DB.cs
    1.2.2.1     +2  -2      db/csharp/Properties/AssemblyInfo.cs
    1.12.2.1    +12 -1      db/cxx/cxx_db.cpp
    1.10.2.1    +1  -1      db/cxx/cxx_dbc.cpp
    1.10.2.1    +1  -1      db/cxx/cxx_dbt.cpp
    1.12.2.1    +27 -2      db/cxx/cxx_env.cpp
    1.9.2.1     +1  -1      db/cxx/cxx_except.cpp
    1.9.2.1     +1  -1      db/cxx/cxx_lock.cpp
    1.11.2.1    +1  -1      db/cxx/cxx_logc.cpp
    1.9.2.1     +1  -1      db/cxx/cxx_mpool.cpp
    1.8.2.1     +1  -1      db/cxx/cxx_multi.cpp
    1.7.2.1     +1  -1      db/cxx/cxx_seq.cpp
    1.9.2.1     +3  -1      db/cxx/cxx_txn.cpp
    1.9.2.1     +1  -2      db/db/crdel.src
    1.10.2.1    +25 -911    db/db/crdel_auto.c
    1.5.4.1     +16 -140    db/db/crdel_autop.c
    1.9.2.1     +1  -2      db/db/crdel_rec.c
    1.11.2.1    +77 -7      db/db/db.c
    1.10.2.1    +109 -6     db/db/db.src
    1.10.2.1    +34 -13     db/db/db_am.c
    1.11.2.1    +221 -3212  db/db/db_auto.c
    1.6.2.1     +175 -536   db/db/db_autop.c
    1.10.2.1    +20 -15     db/db/db_cam.c
    1.4.2.1     +2  -2      db/db/db_cds.c
    1.9.2.1     +147 -13    db/db/db_conv.c
    1.11.2.1    +34 -10     db/db/db_dispatch.c
    1.9.2.1     +6  -5      db/db/db_dup.c
    1.11.2.1    +101 -17    db/db/db_iface.c
    1.9.2.1     +1  -1      db/db/db_join.c
    1.11.2.1    +117 -47    db/db/db_meta.c
    1.10.2.1    +2  -1      db/db/db_method.c
    1.10.2.1    +108 -4     db/db/db_open.c
    1.9.2.1     +10 -11     db/db/db_overflow.c
    1.8.2.1     +1  -1      db/db/db_ovfl_vrfy.c
    1.11.2.1    +213 -171   db/db/db_pr.c
    1.13.2.1    +890 -40    db/db/db_rec.c
    1.9.2.1     +1  -1      db/db/db_reclaim.c
    1.10.2.1    +34 -47     db/db/db_remove.c
    1.9.2.1     +29 -42     db/db/db_rename.c
    1.9.2.1     +1  -1      db/db/db_ret.c
    1.7.2.1     +1  -1      db/db/db_setid.c
    1.7.2.1     +1  -1      db/db/db_setlsn.c
    1.8.2.1     +1  -2      db/db/db_stati.c
    1.9.2.1     +26 -24     db/db/db_truncate.c
    1.9.2.1     +1  -1      db/db/db_upg.c
    1.9.2.1     +1  -1      db/db/db_upg_opd.c
    1.10.2.1    +5  -4      db/db/db_vrfy.c
    1.8.2.1     +8  -8      db/db/db_vrfy_stub.c
    1.9.2.1     +1  -1      db/db/db_vrfyutil.c
    1.1.1.2.2.1 +7  -7      db/db/partition.c
    1.10.2.1    +2  -2      db/db185/db185.c
    1.9.2.1     +1  -1      db/db185/db185_int.in
    1.10.2.1    +7  -7      db/db_archive/db_archive.c
    1.11.2.1    +8  -8      db/db_checkpoint/db_checkpoint.c
    1.10.2.1    +8  -8      db/db_deadlock/db_deadlock.c
    1.10.2.1    +13 -4      db/db_dump/db_dump.c
    1.9.2.1     +2  -2      db/db_dump185/db_dump185.c
    1.8.2.1     +22 -20     db/db_hotbackup/db_hotbackup.c
    1.12.2.1    +35 -12     db/db_load/db_load.c
    1.11.2.1    +91 -92     db/db_printlog/db_printlog.c
    1.11.2.1    +6  -12     db/db_recover/db_recover.c
    1.3         +0  -914    db/db_sql/buildpt.c
    1.3         +0  -1419   db/db_sql/generate.c
    1.10.2.1    +15 -6      db/db_stat/db_stat.c
    1.5.2.1     +2  -1      db/db_stat/dd.sh
    1.10.2.1    +10 -10     db/db_upgrade/db_upgrade.c
    1.10.2.1    +17 -14     db/db_verify/db_verify.c
    1.9.2.1     +73 -4      db/dbinc/btree.h
    1.9.2.1     +9  -1      db/dbinc/crypto.h
    1.9.2.1     +1  -1      db/dbinc/cxx_int.h
    1.11.2.1    +195 -87    db/dbinc/db.in
    1.9.2.1     +1  -1      db/dbinc/db_185.in
    1.9.2.1     +22 -3      db/dbinc/db_am.h
    1.9.2.1     +11 -2      db/dbinc/db_cxx.in
    1.9.2.1     +1  -1      db/dbinc/db_dispatch.h
    1.11.2.1    +128 -34    db/dbinc/db_int.in
    1.8.2.1     +1  -1      db/dbinc/db_join.h
    1.10.2.1    +1  -1      db/dbinc/db_page.h
    1.9.2.1     +1  -1      db/dbinc/db_swap.h
    1.9.2.1     +1  -1      db/dbinc/db_upgrade.h
    1.9.2.1     +1  -1      db/dbinc/db_verify.h
    1.9.2.1     +8  -2      db/dbinc/debug.h
    1.9.2.1     +1  -1      db/dbinc/fop.h
    1.9.2.1     +1  -41     db/dbinc/globals.h
    1.9.2.1     +12 -8      db/dbinc/hash.h
    1.9.2.1     +1  -1      db/dbinc/hmac.h
    1.10.2.1    +12 -2      db/dbinc/lock.h
    1.10.2.1    +19 -2      db/dbinc/log.h
    1.12.2.1    +20 -12     db/dbinc/mp.h
    1.11.2.1    +42 -17     db/dbinc/mutex.h
    1.6.2.1     +2  -2      db/dbinc/mutex_int.h
    1.11.2.1    +4  -2      db/dbinc/os.h
    1.9.2.1     +1  -1      db/dbinc/qam.h
    1.3.10.1    +5  -3      db/dbinc/queue.h
    1.11.2.1    +1  -1      db/dbinc/region.h
    1.10.2.1    +222 -89    db/dbinc/rep.h
    1.4.2.1     +42 -4      db/dbinc/repmgr.h
    1.9.2.1     +1  -1      db/dbinc/shqueue.h
    1.9.2.1     +34 -9      db/dbinc/tcl_db.h
    1.9.2.1     +18 -2      db/dbinc/txn.h
    1.6.2.1     +278 -43    db/dbinc_auto/btree_auto.h
    1.9.2.1     +10 -37     db/dbinc_auto/btree_ext.h
    1.9.2.1     +3  -0      db/dbinc_auto/common_ext.h
    1.3.10.1    +81 -0      db/dbinc_auto/crdel_auto.h
    1.7.2.1     +450 -0     db/dbinc_auto/db_auto.h
    1.11.2.1    +34 -43     db/dbinc_auto/db_ext.h
    1.2.10.1    +24 -0      db/dbinc_auto/dbreg_auto.h
    1.9.2.1     +0  -2      db/dbinc_auto/dbreg_ext.h
    1.9.2.1     +1  -1      db/dbinc_auto/env_ext.h
    1.5.2.1     +1  -0      db/dbinc_auto/ext_def.in
    1.4.4.1     +1  -0      db/dbinc_auto/ext_prot.in
    1.5.2.1     +160 -0     db/dbinc_auto/fileops_auto.h
    1.7.2.1     +0  -15     db/dbinc_auto/fileops_ext.h
    1.3.10.1    +323 -1     db/dbinc_auto/hash_auto.h
    1.7.2.1     +20 -25     db/dbinc_auto/hash_ext.h
    1.12.2.1    +295 -141   db/dbinc_auto/int_def.in
    1.9.2.1     +6  -6      db/dbinc_auto/lock_ext.h
    1.8.4.1     +125 -1     db/dbinc_auto/log_ext.h
    1.10.2.1    +2  -1      db/dbinc_auto/mp_ext.h
    1.6.2.1     +4  -4      db/dbinc_auto/mutex_ext.h
    1.8.4.1     +1  -1      db/dbinc_auto/os_ext.h
    1.2.10.1    +104 -0     db/dbinc_auto/qam_auto.h
    1.8.2.1     +0  -10     db/dbinc_auto/qam_ext.h
    1.4.4.1     +14 -0      db/dbinc_auto/rep_auto.h
    1.11.2.1    +19 -5      db/dbinc_auto/rep_ext.h
    1.4.2.1     +15 -8      db/dbinc_auto/repmgr_ext.h
    1.9.2.1     +7  -3      db/dbinc_auto/tcl_ext.h
    1.7.2.1     +128 -0     db/dbinc_auto/txn_auto.h
    1.10.2.1    +3  -13     db/dbinc_auto/txn_ext.h
    1.10.2.1    +1  -4      db/dbm/dbm.c
    1.10.2.1    +14 -2      db/dbreg/dbreg.c
    1.9.2.1     +2  -3      db/dbreg/dbreg.src
    1.9.2.1     +10 -257    db/dbreg/dbreg_auto.c
    1.5.4.1     +4  -39     db/dbreg/dbreg_autop.c
    1.10.2.1    +15 -16     db/dbreg/dbreg_rec.c
    1.8.2.1     +1  -2      db/dbreg/dbreg_stat.c
    1.10.2.1    +23 -23     db/dbreg/dbreg_util.c
    1.1.1.1.2.1 +72 -0      db/dist/ChangeLog
    1.11.2.1    +368 -76    db/dist/Makefile.in
    1.16.2.1    +7  -2      db/dist/RELEASE
    1.1.1.7.2.1 +3  -7      db/dist/aclocal/options.m4
    1.1.1.2.2.1 +3  -2      db/dist/buildpkg
    1.1.1.2.2.1 +1  -1      db/dist/bumprel
    1.8.2.1     +74 -130    db/dist/config.guess
    1.11.2.1    +29 -2      db/dist/config.hin
    1.9.2.1     +44 -15     db/dist/config.sub
    1.22.2.1    +16914 -27066db/dist/configure
    1.16.2.1    +161 -7     db/dist/configure.ac
    1.3.10.1    +12 -2      db/dist/gen_inc.awk
    1.10.2.1    +171 -722   db/dist/gen_rec.awk
    1.15.2.1    +26 -4      db/dist/pubdef.in
    1.7.2.1     +3  -0      db/dist/s_all
    1.6.2.1     +4  -1      db/dist/s_config
    1.1.1.1.2.1 +1  -1      db/dist/s_docs
    1.7.2.1     +12 -3      db/dist/s_include
    1.5.2.1     +3  -1      db/dist/s_java_const
    1.9.2.1     +1  -1      db/dist/s_java_stat
    1.7.2.1     +14 -31     db/dist/s_perm
    1.6.2.1     +3  -3      db/dist/s_readme
    1.8.2.1     +2  -2      db/dist/s_test
    1.11.2.1    +11 -2      db/dist/s_vxworks
    1.4.2.1     +4  -1      db/dist/s_windows
    1.4.2.1     +48 -83     db/dist/s_windows_dsp
    1.6.2.1     +62 -110    db/dist/s_winmsi
    1.11.2.1    +369 -405   db/dist/srcfiles.in
    1.6.2.1     +77 -142    db/dist/template/rec_btree
    1.7.2.1     +390 -0     db/dist/template/rec_db
    1.3.4.1     +260 -0     db/dist/template/rec_hash
    1.11.2.1    +30 -3      db/dist/vx_config.in
    1.9.2.1     +1  -1      db/dist/vx_setup/LICENSE.TXT
    1.11.2.1    +28 -1      db/dist/win_config.in
    1.13.2.1    +84 -68     db/dist/win_exports.in
    1.1.1.1.2.1 +15 -1      db/dist/winmsi/db.wxs
    1.5         +0  -196    db/dist/winmsi/dbcorewix.in
    1.4         +0  -25     db/dist/winmsi/dbvarsbat.in
    1.5         +0  -827    db/dist/winmsi/dbwix.m4
    1.4         +0  -23     db/dist/winmsi/environment.in
    1.4         +0  -35     db/dist/winmsi/features.in
    1.8         +0  -100    db/dist/winmsi/files.in
    1.2         +0  -2      db/dist/winmsi/images/caticon.ibd
    1.2         +0  -1      db/dist/winmsi/images/foldernew.ibd
    1.2         +0  -1      db/dist/winmsi/images/folderup.ibd
    1.2         +0  -21     db/dist/winmsi/images/oracle.jpg
    1.2         +0  -17     db/dist/winmsi/images/topstripe.ibd
    1.3         +0  -1      db/dist/winmsi/images/webicon.ico
    1.6         +0  -17     db/dist/winmsi/links.in
    1.5.2.1     +409 -1326  db/dist/winmsi/s_winmsi.fcn
    1.7         +0  -97     db/dist/winmsi/winbuild.bat
    1.8         +0  -2      db/docs_src/images/api.gif
    1.8         +0  -2      db/docs_src/images/next.gif
    1.8         +0  -2      db/docs_src/images/prev.gif
    1.8         +0  -1      db/docs_src/images/ps.gif
    1.8         +0  -2      db/docs_src/images/ref.gif
    1.8         +0  -10     db/docs_src/ref/arch/bigpic.gif
    1.8         +0  -9      db/docs_src/ref/arch/smallpic.gif
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__B.BE.185
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__B.BE.186
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__B.BE.2
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__B.LE.185
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__B.LE.186
    1.8         +0  -2      db/docs_src/ref/install/ARCHIVE/__B.LE.2
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__H.BE.185
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__H.BE.186
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__H.BE.2
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__H.LE.185
    1.8         +0  -1      db/docs_src/ref/install/ARCHIVE/__H.LE.186
    1.8         +0  -2      db/docs_src/ref/install/ARCHIVE/__H.LE.2
    1.2.2.1     +1  -1      db/env/env_alloc.c
    1.4.2.1     +78 -39     db/env/env_config.c
    1.7.2.1     +1  -1      db/env/env_failchk.c
    1.9.2.1     +1  -1      db/env/env_file.c
    1.10.2.1    +10 -2      db/env/env_method.c
    1.11.2.1    +79 -10     db/env/env_open.c
    1.11.2.1    +138 -133   db/env/env_recover.c
    1.10.2.1    +1  -1      db/env/env_region.c
    1.7.2.1     +1  -1      db/env/env_register.c
    1.9.2.1     +2  -2      db/env/env_stat.c
    1.12.2.1    +772 -431   db/examples_c/bench_001.c
    1.5.2.1     +1  -1      db/examples_c/csv/DbRecord.c
    1.5.2.1     +1  -1      db/examples_c/csv/README
    1.5.2.1     +3  -2      db/examples_c/csv/code.c
    1.5.2.1     +1  -1      db/examples_c/csv/csv.h
    1.5.2.1     +1  -1      db/examples_c/csv/csv_extern.h
    1.5.2.1     +1  -1      db/examples_c/csv/db.c
    1.5.2.1     +1  -1      db/examples_c/csv/load.c
    1.5.2.1     +1  -1      db/examples_c/csv/load_main.c
    1.5.2.1     +1  -1      db/examples_c/csv/query.c
    1.5.2.1     +1  -1      db/examples_c/csv/query_main.c
    1.5.2.1     +1  -1      db/examples_c/csv/util.c
    1.9.2.1     +1  -1      db/examples_c/ex_access.c
    1.9.2.1     +1  -2      db/examples_c/ex_apprec/ex_apprec.c
    1.9.2.1     +1  -5      db/examples_c/ex_apprec/ex_apprec.h
    1.9.2.1     +1  -1      db/examples_c/ex_apprec/ex_apprec.src
    1.7.4.1     +4  -131    db/examples_c/ex_apprec/ex_apprec_auto.c
    1.2.10.1    +19 -0      db/examples_c/ex_apprec/ex_apprec_auto.h
    1.5.4.1     +3  -25     db/examples_c/ex_apprec/ex_apprec_autop.c
    1.9.2.1     +3  -2      db/examples_c/ex_apprec/ex_apprec_rec.c
    1.9.2.1     +1  -1      db/examples_c/ex_btrec.c
    1.9.2.1     +1  -1      db/examples_c/ex_dbclient.c
    1.10.2.1    +6  -6      db/examples_c/ex_env.c
    1.9.2.1     +1  -1      db/examples_c/ex_lock.c
    1.9.2.1     +1  -1      db/examples_c/ex_mpool.c
    1.4.2.1     +1  -1      db/examples_c/ex_rep/base/rep_base.c
    1.4.2.1     +1  -1      db/examples_c/ex_rep/base/rep_base.h
    1.4.2.1     +1  -1      db/examples_c/ex_rep/base/rep_msg.c
    1.4.2.1     +3  -3      db/examples_c/ex_rep/base/rep_net.c
    1.4.2.1     +1  -1      db/examples_c/ex_rep/common/rep_common.c
    1.4.2.1     +1  -1      db/examples_c/ex_rep/common/rep_common.h
    1.4.2.1     +7  -2      db/examples_c/ex_rep/mgr/rep_mgr.c
    1.9.2.1     +1  -1      db/examples_c/ex_sequence.c
    1.9.2.1     +1  -1      db/examples_c/ex_thread.c
    1.10.2.1    +1  -1      db/examples_c/ex_tpcb.c
    1.8.2.1     +1  -1      db/examples_c/getting_started/example_database_load.c
    1.7.2.1     +1  -1      db/examples_c/getting_started/example_database_read.c
    1.7.2.1     +1  -1      db/examples_c/getting_started/gettingstarted_common.c
    1.7.2.1     +1  -1      db/examples_c/getting_started/gettingstarted_common.h
    1.5.2.1     +1  -1      db/examples_c/txn_guide/txn_guide.c
    1.5.2.1     +1  -1      db/examples_c/txn_guide/txn_guide_inmemory.c
    1.9.2.1     +1  -1      db/examples_cxx/AccessExample.cpp
    1.9.2.1     +1  -1      db/examples_cxx/BtRecExample.cpp
    1.10.2.1    +1  -1      db/examples_cxx/EnvExample.cpp
    1.9.2.1     +1  -1      db/examples_cxx/LockExample.cpp
    1.9.2.1     +1  -1      db/examples_cxx/MpoolExample.cpp
    1.7.2.1     +1  -1      db/examples_cxx/SequenceExample.cpp
    1.9.2.1     +1  -1      db/examples_cxx/TpcbExample.cpp
    1.4.2.1     +1  -1      db/examples_cxx/excxx_repquote/RepConfigInfo.cpp
    1.4.2.1     +1  -1      db/examples_cxx/excxx_repquote/RepConfigInfo.h
    1.4.2.1     +1  -1      db/examples_cxx/excxx_repquote/RepQuoteExample.cpp
    1.2.2.1     +1  -1      db/examples_cxx/getting_started/MyDb.cpp
    1.2.2.1     +1  -1      db/examples_cxx/getting_started/MyDb.hpp
    1.4.2.1     +1  -1      db/examples_cxx/getting_started/excxx_example_database_load.cpp
    1.4.2.1     +1  -1      db/examples_cxx/getting_started/excxx_example_database_read.cpp
    1.5.2.1     +1  -1      db/examples_cxx/getting_started/gettingStartedCommon.hpp
    1.4.2.1     +1  -1      db/examples_cxx/txn_guide/TxnGuide.cpp
    1.5.2.1     +1  -1      db/examples_cxx/txn_guide/TxnGuideInMemory.cpp
    1.6.2.1     +1  -1      db/examples_java/src/collections/access/AccessExample.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/hello/HelloDatabaseWorld.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/PartData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/PartKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/Sample.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/SampleDatabase.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/SampleViews.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/ShipmentData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/ShipmentKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/SupplierData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/SupplierKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/basic/Weight.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/Part.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/PartData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/PartKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/Sample.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/SampleDatabase.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/SampleViews.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/Shipment.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/ShipmentData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/ShipmentKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/Supplier.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/SupplierData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/SupplierKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/entity/Weight.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/Part.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/PartKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/Sample.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/SampleDatabase.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/SampleViews.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/Shipment.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/ShipmentKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/Supplier.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/SupplierKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/factory/Weight.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/PartData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/PartKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/Sample.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/SampleDatabase.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/SampleViews.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/ShipmentData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/ShipmentKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/SupplierData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/SupplierKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/index/Weight.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/MarshalledEnt.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/MarshalledKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/Part.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/PartKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/Sample.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/SampleDatabase.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/SampleViews.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/Shipment.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/ShipmentKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/Supplier.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/SupplierKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/marshal/Weight.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/Part.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/PartKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/Sample.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/SampleDatabase.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/SampleViews.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/Shipment.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/ShipmentKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/Supplier.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/SupplierKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/sentity/Weight.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/Part.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/PartData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/PartKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/Sample.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/SampleDatabase.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/SampleViews.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/Shipment.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/ShipmentData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/ShipmentKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/Supplier.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/SupplierData.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/SupplierKey.java
    1.6.2.1     +1  -1      db/examples_java/src/collections/ship/tuple/Weight.java
    1.6.2.1     +1  -1      db/examples_java/src/db/AccessExample.java
    1.6.2.1     +1  -1      db/examples_java/src/db/BtRecExample.java
    1.6.2.1     +1  -1      db/examples_java/src/db/BulkAccessExample.java
    1.5.2.1     +1  -1      db/examples_java/src/db/BulkAccessNIOExample.java
    1.7.2.1     +2  -2      db/examples_java/src/db/EnvExample.java
    1.5.2.1     +1  -1      db/examples_java/src/db/GettingStarted/ExampleDatabaseLoad.java
    1.4.2.1     +1  -1      db/examples_java/src/db/GettingStarted/ExampleDatabaseRead.java
    1.3.2.1     +1  -1      db/examples_java/src/db/GettingStarted/Inventory.java
    1.3.2.1     +1  -1      db/examples_java/src/db/GettingStarted/InventoryBinding.java
    1.3.2.1     +1  -1      db/examples_java/src/db/GettingStarted/ItemNameKeyCreator.java
    1.3.2.1     +1  -1      db/examples_java/src/db/GettingStarted/MyDbs.java
    1.3.2.1     +1  -1      db/examples_java/src/db/GettingStarted/Vendor.java
    1.6.2.1     +1  -1      db/examples_java/src/db/LockExample.java
    1.6.2.1     +1  -1      db/examples_java/src/db/SequenceExample.java
    1.6.2.1     +1  -1      db/examples_java/src/db/TpcbExample.java
    1.5.2.1     +1  -1      db/examples_java/src/db/repquote/RepConfig.java
    1.5.2.1     +1  -1      db/examples_java/src/db/repquote/RepQuoteEnvironment.java
    1.5.2.1     +1  -1      db/examples_java/src/db/repquote/RepQuoteExample.java
    1.3.2.1     +1  -1      db/examples_java/src/db/repquote/RepRemoteHost.java
    1.4.2.1     +1  -1      db/examples_java/src/db/txn/DBWriter.java
    1.3.2.1     +1  -1      db/examples_java/src/db/txn/PayloadData.java
    1.4.2.1     +1  -1      db/examples_java/src/db/txn/TxnGuide.java
    1.4.2.1     +1  -1      db/examples_java/src/db/txn/TxnGuideInMemory.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/CustomKeyOrderExample.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/DplDump.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/EventExample.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/EventExampleDPL.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/PersonExample.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/gettingStarted/SimpleDA.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/gettingStarted/SimpleEntityClass.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/gettingStarted/SimpleStoreGet.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/gettingStarted/SimpleStorePut.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/txn/PayloadDataEntity.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/txn/StoreWriter.java
    1.3.2.1     +1  -1      db/examples_java/src/persist/txn/TxnGuideDPL.java
    1.9.2.1     +1  -2      db/fileops/fileops.src
    1.9.2.1     +78 -1412   db/fileops/fileops_auto.c
    1.7.2.1     +32 -308    db/fileops/fileops_autop.c
    1.10.2.1    +1  -2      db/fileops/fop_basic.c
    1.10.2.1    +1  -1      db/fileops/fop_rec.c
    1.13.2.1    +36 -64     db/fileops/fop_util.c
    1.11.2.1    +325 -223   db/hash/hash.c
    1.9.2.1     +53 -4      db/hash/hash.src
    1.10.2.1    +159 -2603  db/hash/hash_auto.c
    1.5.4.1     +115 -353   db/hash/hash_autop.c
    1.1.1.1.2.1 +7  -0      db/hash/hash_compact.c
    1.9.2.1     +1  -1      db/hash/hash_conv.c
    1.11.2.1    +90 -69     db/hash/hash_dup.c
    1.9.2.1     +1  -1      db/hash/hash_func.c
    1.9.2.1     +1  -2      db/hash/hash_meta.c
    1.9.2.1     +1  -1      db/hash/hash_method.c
    1.10.2.1    +12 -13     db/hash/hash_open.c
    1.13.2.1    +588 -169   db/hash/hash_page.c
    1.10.2.1    +455 -106   db/hash/hash_rec.c
    1.9.2.1     +1  -1      db/hash/hash_reclaim.c
    1.9.2.1     +1  -1      db/hash/hash_stat.c
    1.8.2.1     +1  -1      db/hash/hash_stub.c
    1.9.2.1     +1  -1      db/hash/hash_upgrade.c
    1.14.2.1    +6  -5      db/hash/hash_verify.c
    1.9.2.1     +1  -1      db/hmac/hmac.c
    1.10.2.1    +1  -1      db/hsearch/hsearch.c
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/ByteArrayBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/EntityBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/EntryBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/RecordNumberBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/ClassCatalog.java
    1.6.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/SerialBase.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/SerialBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/SerialInput.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/SerialOutput.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/SerialSerialBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/SerialSerialKeyCreator.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/StoredClassCatalog.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/TupleSerialBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/TupleSerialKeyCreator.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/TupleSerialMarshalledBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/serial/TupleSerialMarshalledKeyCreator.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/BigIntegerBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/BooleanBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/ByteBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/CharacterBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/DoubleBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/FloatBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/IntegerBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/LongBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/MarshalledTupleEntry.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/MarshalledTupleKeyEntity.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/ShortBinding.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/SortedDoubleBinding.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/SortedFloatBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/StringBinding.java
    1.6.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleBase.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleInput.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleInputBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleMarshalledBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleOutput.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleTupleBinding.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleTupleKeyCreator.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleTupleMarshalledBinding.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/bind/tuple/TupleTupleMarshalledKeyCreator.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/collections/BaseIterator.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/collections/BlockIterator.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/collections/CurrentTransaction.java
    1.9.2.1     +1  -1      db/java/src/com/sleepycat/collections/DataCursor.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/DataView.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/MapEntryParameter.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/collections/MyRangeCursor.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/PrimaryKeyAssigner.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredCollection.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredCollections.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredContainer.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredEntrySet.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredIterator.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredKeySet.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredList.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredMap.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredMapEntry.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredSortedEntrySet.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredSortedKeySet.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredSortedMap.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredSortedValueSet.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/StoredValueSet.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/collections/TransactionRunner.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/TransactionWorker.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/collections/TupleSerialFactory.java
    1.9.2.1     +1  -1      db/java/src/com/sleepycat/collections/package.html
    1.9.2.1     +1  -1      db/java/src/com/sleepycat/compat/DbCompat.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/BtreePrefixCalculator.java
    1.8.2.1     +130 -22    db/java/src/com/sleepycat/db/BtreeStats.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/CacheFile.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/CacheFilePriority.java
    1.7.2.1     +25 -9      db/java/src/com/sleepycat/db/CacheFileStats.java
    1.7.2.1     +139 -43    db/java/src/com/sleepycat/db/CacheStats.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/CheckpointConfig.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/db/CompactConfig.java
    1.7.2.1     +32 -8      db/java/src/com/sleepycat/db/CompactStats.java
    1.9.2.1     +25 -3      db/java/src/com/sleepycat/db/Cursor.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/CursorConfig.java
    1.8.2.1     +10 -6      db/java/src/com/sleepycat/db/Database.java
    1.10.2.1    +22 -7      db/java/src/com/sleepycat/db/DatabaseConfig.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/DatabaseEntry.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/DatabaseException.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/DatabaseStats.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/DatabaseType.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/DeadlockException.java
    1.11.2.1    +263 -5     db/java/src/com/sleepycat/db/Environment.java
    1.11.2.1    +20 -3      db/java/src/com/sleepycat/db/EnvironmentConfig.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/ErrorHandler.java
    1.5.2.1     +40 -1      db/java/src/com/sleepycat/db/EventHandler.java
    1.3.2.1     +21 -1      db/java/src/com/sleepycat/db/EventHandlerAdapter.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/FeedbackHandler.java
    1.3.2.1     +30 -1      db/java/src/com/sleepycat/db/ForeignKeyDeleteAction.java
    1.3.2.1     +41 -1      db/java/src/com/sleepycat/db/ForeignKeyNullifier.java
    1.3.2.1     +45 -1      db/java/src/com/sleepycat/db/ForeignMultiKeyNullifier.java
    1.7.2.1     +88 -18     db/java/src/com/sleepycat/db/HashStats.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/Hasher.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/JoinConfig.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/JoinCursor.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/KeyRange.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/Lock.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/LockDetectMode.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/LockMode.java
    1.9.2.1     +1  -1      db/java/src/com/sleepycat/db/LockNotGrantedException.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/LockOperation.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/LockRequest.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/LockRequestMode.java
    1.9.2.1     +136 -43    db/java/src/com/sleepycat/db/LockStats.java
    1.8.2.1     +5  -1      db/java/src/com/sleepycat/db/LogCursor.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/LogRecordHandler.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/LogSequenceNumber.java
    1.7.2.1     +71 -24     db/java/src/com/sleepycat/db/LogStats.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/MemoryException.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/MessageHandler.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/MultipleDataEntry.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/MultipleEntry.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/MultipleKeyDataEntry.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/db/MultipleKeyNIODataEntry.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/db/MultipleNIODataEntry.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/MultipleRecnoDataEntry.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/db/MultipleRecnoNIODataEntry.java
    1.7.2.1     +16 -10     db/java/src/com/sleepycat/db/MutexStats.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/OperationStatus.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/PanicHandler.java
    1.8.2.1     +8  -1      db/java/src/com/sleepycat/db/PreparedTransaction.java
    1.7.2.1     +56 -14     db/java/src/com/sleepycat/db/QueueStats.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/RecordNumberAppender.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/RecoveryOperation.java
    1.7.2.1     +18 -7      db/java/src/com/sleepycat/db/ReplicationConfig.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationDuplicateMasterException.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationHandleDeadException.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationHoldElectionException.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationHostAddress.java
    1.6.2.1     +3  -4      db/java/src/com/sleepycat/db/ReplicationJoinFailureException.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationLeaseExpiredException.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationLeaseTimeoutException.java
    1.6.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationLockoutException.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationManagerAckPolicy.java
    1.3.2.1     +22 -4      db/java/src/com/sleepycat/db/ReplicationManagerSiteInfo.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationManagerStartPolicy.java
    1.3.2.1     +37 -6      db/java/src/com/sleepycat/db/ReplicationManagerStats.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationSiteUnavailableException.java
    1.7.2.1     +63 -63     db/java/src/com/sleepycat/db/ReplicationStats.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationStatus.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationTimeoutType.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/ReplicationTransport.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/RunRecoveryException.java
    1.8.2.1     +108 -1     db/java/src/com/sleepycat/db/SecondaryConfig.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/SecondaryCursor.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/SecondaryDatabase.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/SecondaryKeyCreator.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/db/SecondaryMultiKeyCreator.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/Sequence.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/SequenceConfig.java
    1.8.2.1     +30 -10     db/java/src/com/sleepycat/db/SequenceStats.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/StatsConfig.java
    1.8.2.1     +95 -1      db/java/src/com/sleepycat/db/Transaction.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/TransactionConfig.java
    1.8.2.1     +75 -25     db/java/src/com/sleepycat/db/TransactionStats.java
    1.3.2.1     +6  -1      db/java/src/com/sleepycat/db/VerboseConfig.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/VerifyConfig.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/db/VersionMismatchException.java
    1.8.2.1     +9  -7      db/java/src/com/sleepycat/db/internal/Db.java
    1.15.2.1    +28 -22     db/java/src/com/sleepycat/db/internal/DbConstants.java
    1.9.2.1     +53 -11     db/java/src/com/sleepycat/db/internal/DbEnv.java
    1.6.2.1     +7  -5      db/java/src/com/sleepycat/db/internal/DbLock.java
    1.7.2.1     +7  -5      db/java/src/com/sleepycat/db/internal/DbLogc.java
    1.6.2.1     +7  -5      db/java/src/com/sleepycat/db/internal/DbMpoolFile.java
    1.6.2.1     +7  -5      db/java/src/com/sleepycat/db/internal/DbSequence.java
    1.6.2.1     +13 -8      db/java/src/com/sleepycat/db/internal/DbTxn.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/db/internal/DbUtil.java
    1.7.2.1     +7  -5      db/java/src/com/sleepycat/db/internal/Dbc.java
    1.6.2.1     +5  -1      db/java/src/com/sleepycat/db/internal/db_java.java
    1.9.2.1     +13 -4      db/java/src/com/sleepycat/db/internal/db_javaJNI.java
    1.9.2.1     +1  -1      db/java/src/com/sleepycat/db/package.html
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/BasicCursor.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/BasicIndex.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/BasicIterator.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/DataValueAdapter.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/DatabaseNamer.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/EntityCursor.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/EntityIndex.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/EntityJoin.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/EntityStore.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/EntityValueAdapter.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/ForwardCursor.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/KeySelector.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/KeyValueAdapter.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/KeysIndex.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/PrimaryIndex.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/PrimaryKeyValueAdapter.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/SecondaryIndex.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/StoreConfig.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/SubIndex.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/SubIndexCursor.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/ValueAdapter.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/Conversion.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/Converter.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/DeletedClassException.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/Deleter.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/EntityConverter.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/EvolveConfig.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/EvolveEvent.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/EvolveInternal.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/EvolveListener.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/EvolveStats.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/IncompatibleClassException.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/Mutation.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/Mutations.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/evolve/Renamer.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/AbstractInput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/Accessor.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/Catalog.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/CollectionProxy.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/ComplexFormat.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/CompositeKeyFormat.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/ConverterReader.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/Enhanced.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/EnhancedAccessor.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/EntityInput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/EntityOutput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/EnumFormat.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/Evolver.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/FieldInfo.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/Format.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/KeyLocation.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/MapProxy.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/NonPersistentFormat.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/ObjectArrayFormat.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/PersistCatalog.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/PersistComparator.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/PersistEntityBinding.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/PersistKeyAssigner.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/PersistKeyBinding.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/PersistKeyCreator.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/PrimitiveArrayFormat.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/ProxiedFormat.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/RawAbstractInput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/RawAccessor.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/RawArrayInput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/RawComplexInput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/RawSingleInput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/ReadOnlyCatalog.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/Reader.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/RecordInput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/RecordOutput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/ReflectionAccessor.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/SimpleCatalog.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/SimpleFormat.java
    1.4.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/Store.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/StoredModel.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/VisitedObjects.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/impl/WidenerInput.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/AnnotationModel.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/BytecodeEnhancer.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/ClassEnhancer.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/ClassMetadata.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/DeleteAction.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/Entity.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/EntityMetadata.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/EntityModel.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/FieldMetadata.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/KeyField.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/ModelInternal.java
    1.3.2.1     +2  -2      db/java/src/com/sleepycat/persist/model/Persistent.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/PersistentProxy.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/PrimaryKey.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/PrimaryKeyMetadata.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/Relationship.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/SecondaryKey.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/model/SecondaryKeyMetadata.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/raw/RawField.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/raw/RawObject.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/persist/raw/RawStore.java
    1.3.2.1     +4  -4      db/java/src/com/sleepycat/persist/raw/RawType.java
    1.3.2.1     +1  -1      db/java/src/com/sleepycat/util/ErrorBuffer.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/util/ExceptionUnwrapper.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/util/ExceptionWrapper.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/util/FastInputStream.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/util/FastOutputStream.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/util/IOExceptionWrapper.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/util/PackedInteger.java
    1.8.2.1     +1  -1      db/java/src/com/sleepycat/util/RuntimeExceptionWrapper.java
    1.7.2.1     +1  -1      db/java/src/com/sleepycat/util/UtfOps.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/util/keyrange/KeyRange.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/util/keyrange/KeyRangeException.java
    1.5.2.1     +1  -1      db/java/src/com/sleepycat/util/keyrange/RangeCursor.java
    1.1.1.2.2.1 +4  -0      db/libdb_csharp/db.i
    1.6.2.1     +1  -1      db/libdb_java/README
    1.10.2.1    +60 -46     db/libdb_java/db.i
    1.10.2.1    +18 -2      db/libdb_java/db_java.i
    1.13.2.1    +501 -134   db/libdb_java/db_java_wrap.c
    1.3.2.1     +1  -1      db/libdb_java/java-post.pl
    1.10.2.1    +21 -2      db/libdb_java/java_callbacks.i
    1.9.2.1     +21 -21     db/libdb_java/java_except.i
    1.9.2.1     +3  -3      db/libdb_java/java_stat.i
    1.11.2.1    +6  -2      db/libdb_java/java_stat_auto.c
    1.10.2.1    +157 -22    db/libdb_java/java_typemaps.i
    1.10.2.1    +27 -4      db/libdb_java/java_util.i
    1.4.2.1     +2  -2      db/lock/Design
    1.10.2.1    +69 -56     db/lock/lock.c
    1.12.2.1    +29 -16     db/lock/lock_deadlock.c
    1.5.2.1     +7  -7      db/lock/lock_failchk.c
    1.8.2.1     +87 -42     db/lock/lock_id.c
    1.7.2.1     +1  -1      db/lock/lock_list.c
    1.9.2.1     +51 -1      db/lock/lock_method.c
    1.10.2.1    +1  -1      db/lock/lock_region.c
    1.10.2.1    +3  -1      db/lock/lock_stat.c
    1.7.2.1     +4  -50     db/lock/lock_timer.c
    1.9.2.1     +1  -1      db/lock/lock_util.c
    1.19.2.1    +12 -3      db/log/log.c
    1.10.2.1    +38 -12     db/log/log_archive.c
    1.9.2.1     +1  -1      db/log/log_compare.c
    1.5.2.1     +1  -2      db/log/log_debug.c
    1.10.2.1    +261 -6     db/log/log_get.c
    1.9.2.1     +3  -2      db/log/log_method.c
    1.14.2.1    +450 -8     db/log/log_put.c
    1.8.2.1     +1  -2      db/log/log_stat.c
    1.7.2.1     +1  -1      db/mod_db4/Makefile.in
    1.6.2.1     +1  -1      db/mod_db4/configure.in
    1.7.2.1     +1  -1      db/mod_db4/mm_hash.c
    1.7.2.1     +1  -1      db/mod_db4/mm_hash.h
    1.7.2.1     +1  -1      db/mod_db4/mod_db4.c
    1.7.2.1     +1  -1      db/mod_db4/mod_db4_export.h
    1.7.2.1     +1  -1      db/mod_db4/sem_utils.c
    1.7.2.1     +1  -1      db/mod_db4/sem_utils.h
    1.7.2.1     +1  -1      db/mod_db4/utils.c
    1.7.2.1     +1  -1      db/mod_db4/utils.h
    1.11.2.1    +134 -122   db/mp/mp_alloc.c
    1.14.2.1    +16 -21     db/mp/mp_bh.c
    1.11.2.1    +28 -25     db/mp/mp_fget.c
    1.8.2.1     +6  -7      db/mp/mp_fmethod.c
    1.21.2.1    +23 -27     db/mp/mp_fopen.c
    1.11.2.1    +5  -5      db/mp/mp_fput.c
    1.11.2.1    +2  -2      db/mp/mp_fset.c
    1.10.2.1    +22 -10     db/mp/mp_method.c
    1.5.2.1     +4  -4      db/mp/mp_mvcc.c
    1.10.2.1    +10 -7      db/mp/mp_region.c
    1.9.2.1     +1  -1      db/mp/mp_register.c
    1.1.1.5.2.1 +1  -1      db/mp/mp_resize.c
    1.11.2.1    +19 -30     db/mp/mp_stat.c
    1.13.2.1    +39 -2      db/mp/mp_sync.c
    1.10.2.1    +2  -2      db/mp/mp_trickle.c
    1.5.2.1     +1  -1      db/mutex/mut_alloc.c
    1.4.2.1     +1  -1      db/mutex/mut_failchk.c
    1.12.2.1    +26 -7      db/mutex/mut_fcntl.c
    1.5.2.1     +1  -1      db/mutex/mut_method.c
    1.11.2.1    +28 -10     db/mutex/mut_pthread.c
    1.6.2.1     +1  -1      db/mutex/mut_region.c
    1.6.2.1     +5  -1      db/mutex/mut_stat.c
    1.11.2.1    +51 -26     db/mutex/mut_tas.c
    1.11.2.1    +45 -19     db/mutex/mut_win32.c
    1.9.2.1     +1  -1      db/mutex/uts4_cc.s
    1.9.2.1     +1  -1      db/os/os_abs.c
    1.9.2.1     +1  -1      db/os/os_alloc.c
    1.10.2.1    +1  -1      db/os/os_clock.c
    1.9.2.1     +1  -1      db/os/os_config.c
    1.9.2.1     +22 -2      db/os/os_dir.c
    1.9.2.1     +1  -1      db/os/os_errno.c
    1.9.2.1     +1  -1      db/os/os_fid.c
    1.6.2.1     +1  -1      db/os/os_flock.c
    1.9.2.1     +1  -1      db/os/os_fsync.c
    1.4.2.1     +1  -1      db/os/os_getenv.c
    1.11.2.1    +1  -1      db/os/os_handle.c
    1.14.2.1    +1  -1      db/os/os_map.c
    1.6.2.1     +1  -1      db/os/os_mkdir.c
    1.12.2.1    +2  -1      db/os/os_open.c
    1.4.2.1     +1  -1      db/os/os_pid.c
    1.9.2.1     +1  -1      db/os/os_rename.c
    1.9.2.1     +1  -1      db/os/os_root.c
    1.9.2.1     +1  -1      db/os/os_rpath.c
    1.10.2.1    +1  -3      db/os/os_rw.c
    1.10.2.1    +3  -3      db/os/os_seek.c
    1.9.2.1     +1  -1      db/os/os_stat.c
    1.9.2.1     +4  -1      db/os/os_tmpdir.c
    1.7.2.1     +1  -1      db/os/os_truncate.c
    1.4.2.1     +1  -1      db/os/os_uid.c
    1.9.2.1     +1  -1      db/os/os_unlink.c
    1.4.2.1     +1  -2      db/os/os_yield.c
    1.10.2.1    +1  -1      db/os_vxworks/os_vx_abs.c
    1.9.2.1     +1  -1      db/os_vxworks/os_vx_config.c
    1.10.2.1    +1  -1      db/os_vxworks/os_vx_map.c
    1.4.2.1     +1  -1      db/os_vxworks/os_vx_rpath.c
    1.4.2.1     +5  -2      db/os_windows/os_abs.c
    1.4.2.1     +1  -1      db/os_windows/os_clock.c
    1.4.2.1     +1  -1      db/os_windows/os_config.c
    1.4.2.1     +1  -1      db/os_windows/os_dir.c
    1.4.2.1     +1  -1      db/os_windows/os_errno.c
    1.4.2.1     +1  -1      db/os_windows/os_fid.c
    1.4.2.1     +1  -1      db/os_windows/os_flock.c
    1.4.2.1     +1  -1      db/os_windows/os_fsync.c
    1.4.2.1     +1  -1      db/os_windows/os_getenv.c
    1.4.2.1     +1  -1      db/os_windows/os_handle.c
    1.4.2.1     +1  -1      db/os_windows/os_map.c
    1.4.2.1     +2  -1      db/os_windows/os_open.c
    1.4.2.1     +1  -1      db/os_windows/os_rename.c
    1.4.2.1     +1  -1      db/os_windows/os_rw.c
    1.4.2.1     +2  -2      db/os_windows/os_seek.c
    1.4.2.1     +1  -1      db/os_windows/os_stat.c
    1.4.2.1     +1  -1      db/os_windows/os_truncate.c
    1.4.2.1     +1  -1      db/os_windows/os_unlink.c
    1.4.2.1     +1  -1      db/os_windows/os_yield.c
    1.11.2.1    +43 -25     db/perl/BerkeleyDB/BerkeleyDB.pm
    1.10.2.1    +36 -0      db/perl/BerkeleyDB/BerkeleyDB.pod
    1.9.2.1     +36 -0      db/perl/BerkeleyDB/BerkeleyDB.pod.P
    1.11.2.1    +76 -15     db/perl/BerkeleyDB/BerkeleyDB.xs
    1.11.2.1    +24 -0      db/perl/BerkeleyDB/Changes
    1.5.2.1     +2  -2      db/perl/BerkeleyDB/META.yml
    1.11.2.1    +3  -3      db/perl/BerkeleyDB/README
    1.7.2.1     +3  -1      db/perl/BerkeleyDB/t/btree.t
    1.6.2.1     +4  -1      db/perl/BerkeleyDB/t/hash.t
    1.7.2.1     +9  -1      db/perl/BerkeleyDB/t/queue.t
    1.6.2.1     +7  -1      db/perl/BerkeleyDB/t/recno.t
    1.9.2.1     +2  -2      db/php_db4/config.m4
    1.9.2.1     +6  -3      db/php_db4/db4.cpp
    1.5.2.1     +1  -1      db/php_db4/php_db4.h
    1.2.10.1    +4  -5      db/php_db4/samples/transactional_counter.php
    1.10.2.1    +1  -2      db/qam/qam.c
    1.9.2.1     +1  -2      db/qam/qam.src
    1.10.2.1    +45 -1272   db/qam/qam_auto.c
    1.5.4.1     +20 -154    db/qam/qam_autop.c
    1.9.2.1     +1  -1      db/qam/qam_conv.c
    1.10.2.1    +1  -2      db/qam/qam_files.c
    1.10.2.1    +4  -10     db/qam/qam_method.c
    1.9.2.1     +1  -1      db/qam/qam_open.c
    1.10.2.1    +1  -2      db/qam/qam_rec.c
    1.9.2.1     +1  -1      db/qam/qam_stat.c
    1.8.2.1     +1  -1      db/qam/qam_stub.c
    1.9.2.1     +1  -1      db/qam/qam_upgrade.c
    1.9.2.1     +2  -2      db/qam/qam_verify.c
    1.8.2.1     +18 -2      db/rep/rep.src
    1.4.4.1     +88 -1      db/rep/rep_auto.c
    1.13.2.1    +334 -394   db/rep/rep_backup.c
    1.6.2.1     +366 -391   db/rep/rep_elect.c
    1.6.2.1     +36 -26     db/rep/rep_log.c
    1.15.2.1    +958 -170   db/rep/rep_method.c
    1.17.2.1    +215 -93    db/rep/rep_record.c
    1.13.2.1    +121 -20    db/rep/rep_region.c
    1.7.2.1     +63 -22     db/rep/rep_stat.c
    1.8.2.1     +43 -10     db/rep/rep_stub.c
    1.14.2.1    +623 -166   db/rep/rep_util.c
    1.6.2.1     +52 -41     db/rep/rep_verify.c
    1.5.2.1     +443 -276   db/repmgr/repmgr_elect.c
    1.4.2.1     +398 -119   db/repmgr/repmgr_method.c
    1.4.2.1     +125 -63    db/repmgr/repmgr_msg.c
    1.5.2.1     +150 -46    db/repmgr/repmgr_net.c
    1.4.2.1     +76 -44     db/repmgr/repmgr_posix.c
    1.4.2.1     +32 -12     db/repmgr/repmgr_queue.c
    1.4.2.1     +64 -48     db/repmgr/repmgr_sel.c
    1.4.2.1     +30 -12     db/repmgr/repmgr_stat.c
    1.4.2.1     +152 -65    db/repmgr/repmgr_util.c
    1.4.2.1     +54 -15     db/repmgr/repmgr_windows.c
    1.7.2.1     +1  -1      db/sequence/seq_stat.c
    1.9.2.1     +51 -12     db/sequence/sequence.c
    1.1.1.1.2.1 +21 -9      db/sql/adapter/btree.c
    1.1.1.1.2.1 +21 -9      db/sql/generated/sqlite3.c
    1.1.1.1.2.1 +7  -0      db/sql/odbc/ChangeLog
    1.1.1.1.2.1 +3  -3      db/sql/odbc/README
    1.1.1.1.2.1 +1  -1      db/sql/odbc/VERSION
    1.1.1.1.2.1 +1  -1      db/sql/odbc/blobtoxy.rc
    1.1.1.1.2.1 +1  -1      db/sql/odbc/libtool
    1.1.1.1.2.1 +2  -2      db/sql/odbc/resource3.h
    1.1.1.1.2.1 +65 -31     db/sql/odbc/sqlite3odbc.c
    1.1.1.1.2.1 +1  -1      db/sql/odbc/sqlite3odbc.rc
    1.1.1.1.2.1 +1  -1      db/sql/odbc/sqlite3odbc.rc.in
    1.1.1.1.2.1 +19 -17     db/sql/odbc/sqliteodbc.c
    1.1.1.1.2.1 +1  -1      db/sql/odbc/sqliteodbc.rc
    1.1.1.1.2.1 +2  -2      db/sql/odbc/sqliteodbc.spec
    1.2.2.1     +31 -1      db/stl/dbstl_resource_manager.cpp
    1.2.2.1     +5  -1      db/stl/dbstl_resource_manager.h
    1.8.2.1     +1  -1      db/tcl/docs/db.html
    1.8.2.1     +1  -1      db/tcl/docs/env.html
    1.8.2.1     +1  -1      db/tcl/docs/historic.html
    1.8.2.1     +1  -1      db/tcl/docs/index.html
    1.8.2.1     +1  -1      db/tcl/docs/library.html
    1.8.2.1     +1  -1      db/tcl/docs/lock.html
    1.8.2.1     +1  -1      db/tcl/docs/log.html
    1.8.2.1     +1  -1      db/tcl/docs/mpool.html
    1.9.2.1     +1  -1      db/tcl/docs/rep.html
    1.4.2.1     +1  -1      db/tcl/docs/sequence.html
    1.8.2.1     +1  -1      db/tcl/docs/test.html
    1.8.2.1     +2  -2      db/tcl/docs/txn.html
    1.9.2.1     +1  -1      db/tcl/tcl_compat.c
    1.10.2.1    +5  -3      db/tcl/tcl_db.c
    1.12.2.1    +41 -27     db/tcl/tcl_db_pkg.c
    1.9.2.1     +1  -1      db/tcl/tcl_dbcursor.c
    1.10.2.1    +239 -114   db/tcl/tcl_env.c
    1.10.2.1    +34 -80     db/tcl/tcl_internal.c
    1.10.2.1    +1  -1      db/tcl/tcl_lock.c
    1.10.2.1    +11 -18     db/tcl/tcl_log.c
    1.10.2.1    +1  -1      db/tcl/tcl_mp.c
    1.10.2.1    +103 -19    db/tcl/tcl_rep.c
    1.8.2.1     +1  -1      db/tcl/tcl_seq.c
    1.11.2.1    +68 -47     db/tcl/tcl_txn.c
    1.9.2.1     +32 -1      db/tcl/tcl_util.c
    1.8.2.1     +1  -1      db/test/README
    1.11.2.1    +198 -41    db/test/TESTS
    1.9.2.1     +1  -1      db/test/archive.tcl
    1.11.2.1    +1  -1      db/test/bigfile001.tcl
    1.11.2.1    +1  -1      db/test/bigfile002.tcl
    1.9.2.1     +1  -1      db/test/byteorder.tcl
    1.9.2.1     +1  -1      db/test/conscript.tcl
    1.9.2.1     +1  -1      db/test/dbm.tcl
    1.9.2.1     +1  -1      db/test/dbscript.tcl
    1.9.2.1     +1  -1      db/test/ddoyscript.tcl
    1.9.2.1     +1  -1      db/test/ddscript.tcl
    1.9.2.1     +53 -6      db/test/dead001.tcl
    1.9.2.1     +51 -5      db/test/dead002.tcl
    1.9.2.1     +86 -17     db/test/dead003.tcl
    1.9.2.1     +7  -1      db/test/dead004.tcl
    1.9.2.1     +64 -9      db/test/dead005.tcl
    1.10.2.1    +1  -1      db/test/dead006.tcl
    1.11.2.1    +1  -1      db/test/dead007.tcl
    1.9.2.1     +1  -1      db/test/env001.tcl
    1.9.2.1     +1  -1      db/test/env002.tcl
    1.9.2.1     +1  -1      db/test/env003.tcl
    1.9.2.1     +1  -1      db/test/env004.tcl
    1.9.2.1     +1  -1      db/test/env005.tcl
    1.9.2.1     +1  -1      db/test/env006.tcl
    1.9.2.1     +54 -8      db/test/env007.tcl
    1.9.2.1     +1  -1      db/test/env008.tcl
    1.11.2.1    +1  -1      db/test/env009.tcl
    1.10.2.1    +1  -1      db/test/env010.tcl
    1.9.2.1     +1  -1      db/test/env011.tcl
    1.7.2.1     +1  -1      db/test/env012.tcl
    1.5.2.1     +1  -1      db/test/env013.tcl
    1.5.2.1     +1  -1      db/test/env014.tcl
    1.4.2.1     +1  -1      db/test/env015.tcl
    1.6.2.1     +1  -1      db/test/envscript.tcl
    1.8.2.1     +91 -43     db/test/fop001.tcl
    1.8.2.1     +1  -1      db/test/fop002.tcl
    1.8.2.1     +46 -13     db/test/fop003.tcl
    1.8.2.1     +1  -1      db/test/fop004.tcl
    1.8.2.1     +1  -1      db/test/fop005.tcl
    1.8.2.1     +34 -6      db/test/fop006.tcl
    1.5.2.1     +1  -1      db/test/fop007.tcl
    1.5.2.1     +1  -1      db/test/fop008.tcl
    1.8.2.1     +1  -1      db/test/fopscript.tcl
    1.8.2.1     +43 -17     db/test/foputils.tcl
    1.9.2.1     +1  -1      db/test/hsearch.tcl
    1.9.2.1     +1  -1      db/test/join.tcl
    1.9.2.1     +1  -1      db/test/lock001.tcl
    1.9.2.1     +1  -1      db/test/lock002.tcl
    1.9.2.1     +1  -1      db/test/lock003.tcl
    1.11.2.1    +1  -1      db/test/lock004.tcl
    1.10.2.1    +1  -1      db/test/lock005.tcl
    1.8.2.1     +1  -1      db/test/lock006.tcl
    1.9.2.1     +1  -1      db/test/lockscript.tcl
    1.9.2.1     +1  -1      db/test/log001.tcl
    1.9.2.1     +1  -1      db/test/log002.tcl
    1.9.2.1     +1  -1      db/test/log003.tcl
    1.9.2.1     +1  -1      db/test/log004.tcl
    1.9.2.1     +1  -1      db/test/log005.tcl
    1.8.2.1     +2  -2      db/test/log006.tcl
    1.5.2.1     +1  -1      db/test/log007.tcl
    1.4.2.1     +1  -1      db/test/log008.tcl
    1.4.2.1     +1  -1      db/test/log008script.tcl
    1.4.2.1     +1  -1      db/test/log009.tcl
    1.8.2.1     +13 -9      db/test/logtrack.list
    1.9.2.1     +1  -1      db/test/logtrack.tcl
    1.9.2.1     +1  -1      db/test/mdbscript.tcl
    1.9.2.1     +1  -1      db/test/memp001.tcl
    1.9.2.1     +1  -1      db/test/memp002.tcl
    1.9.2.1     +1  -1      db/test/memp003.tcl
    1.8.2.1     +1  -1      db/test/memp004.tcl
    1.9.2.1     +1  -1      db/test/mpoolscript.tcl
    1.9.2.1     +1  -1      db/test/ndbm.tcl
    1.11.2.1    +1  -1      db/test/parallel.tcl
    1.5.2.1     +1  -1      db/test/plat001.tcl
    1.9.2.1     +5  -5      db/test/recd001.tcl
    1.9.2.1     +4  -4      db/test/recd002.tcl
    1.9.2.1     +4  -4      db/test/recd003.tcl
    1.9.2.1     +4  -4      db/test/recd004.tcl
    1.9.2.1     +4  -4      db/test/recd005.tcl
    1.9.2.1     +2  -2      db/test/recd006.tcl
    1.9.2.1     +4  -3      db/test/recd007.tcl
    1.10.2.1    +2  -2      db/test/recd008.tcl
    1.9.2.1     +2  -2      db/test/recd009.tcl
    1.9.2.1     +3  -3      db/test/recd010.tcl
    1.9.2.1     +2  -2      db/test/recd011.tcl
    1.9.2.1     +2  -2      db/test/recd012.tcl
    1.9.2.1     +2  -2      db/test/recd013.tcl
    1.9.2.1     +2  -2      db/test/recd014.tcl
    1.9.2.1     +2  -2      db/test/recd015.tcl
    1.11.2.1    +2  -2      db/test/recd016.tcl
    1.9.2.1     +5  -5      db/test/recd017.tcl
    1.9.2.1     +2  -2      db/test/recd018.tcl
    1.9.2.1     +2  -2      db/test/recd019.tcl
    1.9.2.1     +1  -1      db/test/recd020.tcl
    1.7.2.1     +1  -1      db/test/recd021.tcl
    1.6.2.1     +1  -1      db/test/recd022.tcl
    1.5.2.1     +1  -1      db/test/recd023.tcl
    1.10.2.1    +1  -1      db/test/recd15scr.tcl
    1.9.2.1     +1  -1      db/test/recdscript.tcl
    1.13.2.1    +1  -5      db/test/rep001.tcl
    1.9.2.1     +20 -18     db/test/rep002.tcl
    1.9.2.1     +1  -6      db/test/rep003.tcl
    1.10.2.1    +5  -13     db/test/rep005.tcl
    1.8.2.1     +1  -5      db/test/rep006.tcl
    1.8.2.1     +1  -6      db/test/rep007.tcl
    1.8.2.1     +3  -8      db/test/rep008.tcl
    1.8.2.1     +1  -6      db/test/rep009.tcl
    1.8.2.1     +1  -6      db/test/rep010.tcl
    1.9.2.1     +1  -5      db/test/rep011.tcl
    1.9.2.1     +1  -6      db/test/rep012.tcl
    1.8.2.1     +2  -7      db/test/rep013.tcl
    1.7.2.1     +1  -6      db/test/rep014.tcl
    1.7.2.1     +1  -5      db/test/rep015.tcl
    1.7.2.1     +6  -10     db/test/rep016.tcl
    1.7.2.1     +1  -6      db/test/rep017.tcl
    1.7.2.1     +1  -1      db/test/rep017script.tcl
    1.7.2.1     +1  -6      db/test/rep018.tcl
    1.7.2.1     +1  -1      db/test/rep018script.tcl
    1.7.2.1     +1  -6      db/test/rep019.tcl
    1.7.2.1     +11 -27     db/test/rep020.tcl
    1.7.2.1     +3  -8      db/test/rep021.tcl
    1.7.2.1     +6  -10     db/test/rep022.tcl
    1.7.2.1     +1  -6      db/test/rep023.tcl
    1.7.2.1     +1  -6      db/test/rep024.tcl
    1.5.2.1     +3  -3      db/test/rep025.tcl
    1.7.2.1     +8  -9      db/test/rep026.tcl
    1.7.2.1     +1  -6      db/test/rep027.tcl
    1.7.2.1     +3  -8      db/test/rep028.tcl
    1.8.2.1     +1  -5      db/test/rep029.tcl
    1.7.2.1     +1  -6      db/test/rep030.tcl
    1.7.2.1     +24 -13     db/test/rep031.tcl
    1.7.2.1     +1  -6      db/test/rep032.tcl
    1.7.2.1     +1  -6      db/test/rep033.tcl
    1.7.2.1     +5  -12     db/test/rep034.tcl
    1.8.2.1     +1  -6      db/test/rep035.tcl
    1.7.2.1     +1  -1      db/test/rep035script.tcl
    1.7.2.1     +1  -6      db/test/rep036.tcl
    1.7.2.1     +1  -1      db/test/rep036script.tcl
    1.7.2.1     +53 -11     db/test/rep037.tcl
    1.6.2.1     +4  -9      db/test/rep038.tcl
    1.5.2.1     +1  -1      db/test/rep039.tcl
    1.6.2.1     +1  -6      db/test/rep040.tcl
    1.6.2.1     +2  -2      db/test/rep040script.tcl
    1.5.2.1     +1  -6      db/test/rep041.tcl
    1.5.2.1     +1  -6      db/test/rep042.tcl
    1.5.2.1     +1  -1      db/test/rep042script.tcl
    1.5.2.1     +1  -6      db/test/rep043.tcl
    1.5.2.1     +1  -1      db/test/rep043script.tcl
    1.5.2.1     +1  -6      db/test/rep044.tcl
    1.5.2.1     +1  -6      db/test/rep045.tcl
    1.5.2.1     +17 -9      db/test/rep045script.tcl
    1.5.2.1     +14 -11     db/test/rep046.tcl
    1.5.2.1     +11 -19     db/test/rep047.tcl
    1.5.2.1     +10 -3      db/test/rep048.tcl
    1.5.2.1     +1  -1      db/test/rep048script.tcl
    1.5.2.1     +1  -6      db/test/rep049.tcl
    1.5.2.1     +1  -6      db/test/rep050.tcl
    1.5.2.1     +1  -6      db/test/rep051.tcl
    1.5.2.1     +1  -6      db/test/rep052.tcl
    1.5.2.1     +1  -6      db/test/rep053.tcl
    1.5.2.1     +1  -1      db/test/rep054.tcl
    1.5.2.1     +1  -6      db/test/rep055.tcl
    1.5.2.1     +3  -8      db/test/rep058.tcl
    1.4.2.1     +1  -1      db/test/rep060.tcl
    1.4.2.1     +27 -13     db/test/rep061.tcl
    1.4.2.1     +1  -6      db/test/rep062.tcl
    1.4.2.1     +8  -12     db/test/rep063.tcl
    1.4.2.1     +1  -6      db/test/rep064.tcl
    1.4.2.1     +5  -7      db/test/rep065.tcl
    1.4.2.1     +1  -1      db/test/rep065script.tcl
    1.4.2.1     +1  -6      db/test/rep066.tcl
    1.13.2.1    +291 -178   db/test/reputils.tcl
    1.9.2.1     +1  -1      db/test/rpc001.tcl
    1.9.2.1     +1  -1      db/test/rpc002.tcl
    1.11.2.1    +1  -1      db/test/rpc003.tcl
    1.9.2.1     +1  -1      db/test/rpc004.tcl
    1.9.2.1     +1  -1      db/test/rpc005.tcl
    1.7.2.1     +1  -1      db/test/rpc006.tcl
    1.9.2.1     +1  -1      db/test/rsrc001.tcl
    1.9.2.1     +1  -1      db/test/rsrc002.tcl
    1.9.2.1     +1  -1      db/test/rsrc003.tcl
    1.10.2.1    +1  -1      db/test/rsrc004.tcl
    1.10.2.1    +15 -1      db/test/scr003/chk.define
    1.7.2.1     +4  -1      db/test/scr004/chk.javafiles
    1.10.2.1    +2  -0      db/test/scr006/chk.offt
    1.6.2.1     +1  -0      db/test/scr007/chk.proto
    1.8.2.1     +3  -3      db/test/scr008/chk.pubdef
    1.10.2.1    +2  -0      db/test/scr009/chk.srcfiles
    1.12.4.1    +0  -2      db/test/scr010/spell.ok
    1.8.2.1     +5  -2      db/test/scr012/chk.vx_code
    1.10.2.1    +1  -0      db/test/scr013/chk.stats
    1.10.2.1    +1  -1      db/test/scr015/TestConstruct01.cpp
    1.11.2.1    +1  -1      db/test/scr015/TestGetSetMethods.cpp
    1.10.2.1    +1  -1      db/test/scr015/TestKeyRange.cpp
    1.11.2.1    +1  -1      db/test/scr015/TestLogc.cpp
    1.10.2.1    +1  -1      db/test/scr015/TestSimpleAccess.cpp
    1.10.2.1    +1  -1      db/test/scr015/TestTruncate.cpp
    1.3.2.1     +1  -1      db/test/scr017/t.c
    1.5.2.1     +2  -1      db/test/scr018/chk.comma
    1.4.2.1     +1  -1      db/test/scr018/t.c
    1.8.2.1     +4  -0      db/test/scr019/chk.include
    1.9.2.1     +5  -0      db/test/scr021/chk.flags
    1.5.2.1     +1  -1      db/test/scr021/t.c
    1.3.2.1     +1  -1      db/test/scr023/q.c
    1.5.2.1     +7  -0      db/test/scr024/chk.bdb
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/bind/serial/test/MarshalledObject.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/bind/serial/test/NullClassCatalog.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/bind/serial/test/SerialBindingTest.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/bind/serial/test/TestClassCatalog.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/bind/test/BindingSpeedTest.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/bind/tuple/test/MarshalledObject.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/bind/tuple/test/TupleBindingTest.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/bind/tuple/test/TupleFormatTest.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/bind/tuple/test/TupleOrderingTest.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/KeyRangeTest.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/CollectionTest.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/DbTestUtil.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/IterDeadlockTest.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/JoinTest.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/NullTransactionRunner.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/SecondaryDeadlockTest.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/TestDataBinding.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/TestEntity.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/TestEntityBinding.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/TestEnv.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/TestKeyAssigner.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/TestKeyCreator.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/TestStore.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/TransactionTest.java
    1.5.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/serial/CatalogCornerCaseTest.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/serial/StoredClassCatalogTest.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/serial/StoredClassCatalogTestInit.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/serial/TestSerial.java
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/collections/test/serial/TestSerial.java.original
    1.7.2.1     +1  -1      db/test/scr024/src/com/sleepycat/util/test/ExceptionWrapperTest.java
    1.5.2.1     +1  -1      db/test/scr024/src/com/sleepycat/util/test/FastOutputStreamTest.java
    1.4.2.1     +1  -1      db/test/scr024/src/com/sleepycat/util/test/PackedIntegerTest.java
    1.6.2.1     +1  -1      db/test/scr024/src/com/sleepycat/util/test/UtfTest.java
    1.3.2.1     +1  -1      db/test/scr025/TestMulti.cpp
    1.8.2.1     +2  -2      db/test/scr026/chk.method
    1.3.2.1     +1  -1      db/test/scr028/t.c
    1.2.2.1     +1  -1      db/test/scr029/t.c
    1.1.1.2.2.1 +32 -0      db/test/scr037/BTreeDatabaseTest.cs
    1.1.2.1     +4  -4      db/test/scr038/data/17925.sql
    1.9.2.1     +1  -1      db/test/sdb001.tcl
    1.9.2.1     +1  -1      db/test/sdb002.tcl
    1.9.2.1     +1  -1      db/test/sdb003.tcl
    1.9.2.1     +1  -1      db/test/sdb004.tcl
    1.9.2.1     +1  -1      db/test/sdb005.tcl
    1.9.2.1     +1  -1      db/test/sdb006.tcl
    1.9.2.1     +1  -1      db/test/sdb007.tcl
    1.9.2.1     +1  -1      db/test/sdb008.tcl
    1.9.2.1     +1  -1      db/test/sdb009.tcl
    1.10.2.1    +1  -1      db/test/sdb010.tcl
    1.9.2.1     +1  -1      db/test/sdb011.tcl
    1.9.2.1     +1  -1      db/test/sdb012.tcl
    1.8.2.1     +1  -1      db/test/sdb013.tcl
    1.5.2.1     +1  -1      db/test/sdb014.tcl
    1.5.2.1     +1  -1      db/test/sdb015.tcl
    1.5.2.1     +1  -1      db/test/sdb016.tcl
    1.5.2.1     +1  -1      db/test/sdb017.tcl
    1.5.2.1     +1  -1      db/test/sdb018.tcl
    1.5.2.1     +1  -1      db/test/sdb019.tcl
    1.5.2.1     +1  -1      db/test/sdb020.tcl
    1.9.2.1     +1  -1      db/test/sdbscript.tcl
    1.9.2.1     +1  -1      db/test/sdbtest001.tcl
    1.9.2.1     +1  -1      db/test/sdbtest002.tcl
    1.9.2.1     +1  -1      db/test/sdbutils.tcl
    1.9.2.1     +1  -1      db/test/sec001.tcl
    1.10.2.1    +1  -1      db/test/sec002.tcl
    1.12.2.1    +1  -1      db/test/shelltest.tcl
    1.11.2.1    +1  -1      db/test/si001.tcl
    1.11.2.1    +1  -1      db/test/si002.tcl
    1.11.2.1    +1  -1      db/test/si003.tcl
    1.11.2.1    +1  -1      db/test/si004.tcl
    1.12.2.1    +1  -1      db/test/si005.tcl
    1.9.2.1     +1  -1      db/test/si006.tcl
    1.6.2.1     +1  -1      db/test/si007.tcl
    1.6.2.1     +1  -1      db/test/si008.tcl
    1.9.2.1     +1  -1      db/test/sijointest.tcl
    1.9.2.1     +1  -1      db/test/siutils.tcl
    1.9.2.1     +1  -1      db/test/sysscript.tcl
    1.8.2.1     +1  -1      db/test/t106script.tcl
    1.12.2.1    +96 -88     db/test/test.tcl
    1.9.2.1     +1  -1      db/test/test001.tcl
    1.9.2.1     +1  -1      db/test/test002.tcl
    1.9.2.1     +1  -1      db/test/test003.tcl
    1.9.2.1     +1  -1      db/test/test004.tcl
    1.9.2.1     +1  -1      db/test/test005.tcl
    1.9.2.1     +1  -1      db/test/test006.tcl
    1.9.2.1     +1  -1      db/test/test007.tcl
    1.9.2.1     +1  -1      db/test/test008.tcl
    1.9.2.1     +1  -1      db/test/test009.tcl
    1.9.2.1     +1  -1      db/test/test010.tcl
    1.9.2.1     +1  -1      db/test/test011.tcl
    1.9.2.1     +1  -1      db/test/test012.tcl
    1.9.2.1     +1  -1      db/test/test013.tcl
    1.9.2.1     +1  -1      db/test/test014.tcl
    1.9.2.1     +1  -1      db/test/test015.tcl
    1.9.2.1     +1  -1      db/test/test016.tcl
    1.9.2.1     +2  -2      db/test/test017.tcl
    1.9.2.1     +1  -1      db/test/test018.tcl
    1.9.2.1     +1  -1      db/test/test019.tcl
    1.9.2.1     +1  -1      db/test/test020.tcl
    1.9.2.1     +1  -1      db/test/test021.tcl
    1.9.2.1     +1  -1      db/test/test022.tcl
    1.9.2.1     +1  -1      db/test/test023.tcl
    1.9.2.1     +1  -1      db/test/test024.tcl
    1.9.2.1     +1  -1      db/test/test025.tcl
    1.9.2.1     +1  -1      db/test/test026.tcl
    1.9.2.1     +1  -1      db/test/test027.tcl
    1.9.2.1     +1  -1      db/test/test028.tcl
    1.9.2.1     +1  -1      db/test/test029.tcl
    1.9.2.1     +1  -1      db/test/test030.tcl
    1.9.2.1     +1  -1      db/test/test031.tcl
    1.10.2.1    +1  -1      db/test/test032.tcl
    1.9.2.1     +49 -4      db/test/test033.tcl
    1.10.2.1    +4  -5      db/test/test034.tcl
    1.9.2.1     +14 -5      db/test/test035.tcl
    1.9.2.1     +1  -1      db/test/test036.tcl
    1.9.2.1     +1  -1      db/test/test037.tcl
    1.9.2.1     +1  -1      db/test/test038.tcl
    1.9.2.1     +1  -1      db/test/test039.tcl
    1.9.2.1     +1  -1      db/test/test040.tcl
    1.9.2.1     +1  -1      db/test/test041.tcl
    1.9.2.1     +11 -2      db/test/test042.tcl
    1.9.2.1     +1  -1      db/test/test043.tcl
    1.9.2.1     +1  -1      db/test/test044.tcl
    1.9.2.1     +1  -1      db/test/test045.tcl
    1.9.2.1     +1  -1      db/test/test046.tcl
    1.9.2.1     +1  -1      db/test/test047.tcl
    1.9.2.1     +1  -1      db/test/test048.tcl
    1.9.2.1     +1  -1      db/test/test049.tcl
    1.9.2.1     +1  -1      db/test/test050.tcl
    1.9.2.1     +1  -1      db/test/test051.tcl
    1.9.2.1     +1  -1      db/test/test052.tcl
    1.9.2.1     +1  -1      db/test/test053.tcl
    1.9.2.1     +1  -1      db/test/test054.tcl
    1.9.2.1     +1  -1      db/test/test055.tcl
    1.9.2.1     +1  -1      db/test/test056.tcl
    1.9.2.1     +1  -1      db/test/test057.tcl
    1.9.2.1     +1  -1      db/test/test058.tcl
    1.9.2.1     +1  -1      db/test/test059.tcl
    1.9.2.1     +1  -1      db/test/test060.tcl
    1.9.2.1     +1  -1      db/test/test061.tcl
    1.9.2.1     +1  -1      db/test/test062.tcl
    1.9.2.1     +1  -1      db/test/test063.tcl
    1.9.2.1     +1  -1      db/test/test064.tcl
    1.9.2.1     +1  -1      db/test/test065.tcl
    1.9.2.1     +1  -1      db/test/test066.tcl
    1.9.2.1     +1  -1      db/test/test067.tcl
    1.9.2.1     +1  -1      db/test/test068.tcl
    1.9.2.1     +1  -1      db/test/test069.tcl
    1.9.2.1     +1  -1      db/test/test070.tcl
    1.9.2.1     +1  -1      db/test/test071.tcl
    1.9.2.1     +1  -1      db/test/test072.tcl
    1.9.2.1     +1  -1      db/test/test073.tcl
    1.9.2.1     +1  -1      db/test/test074.tcl
    1.9.2.1     +1  -1      db/test/test076.tcl
    1.9.2.1     +1  -1      db/test/test077.tcl
    1.9.2.1     +1  -1      db/test/test078.tcl
    1.9.2.1     +1  -1      db/test/test079.tcl
    1.9.2.1     +1  -1      db/test/test081.tcl
    1.9.2.1     +1  -1      db/test/test082.tcl
    1.9.2.1     +2  -5      db/test/test083.tcl
    1.9.2.1     +1  -1      db/test/test084.tcl
    1.9.2.1     +1  -1      db/test/test085.tcl
    1.9.2.1     +1  -1      db/test/test086.tcl
    1.9.2.1     +1  -1      db/test/test087.tcl
    1.9.2.1     +1  -1      db/test/test088.tcl
    1.9.2.1     +1  -1      db/test/test089.tcl
    1.9.2.1     +1  -1      db/test/test090.tcl
    1.9.2.1     +1  -1      db/test/test091.tcl
    1.9.2.1     +1  -1      db/test/test092.tcl
    1.9.2.1     +17 -1      db/test/test093.tcl
    1.9.2.1     +1  -1      db/test/test094.tcl
    1.11.2.1    +1  -1      db/test/test095.tcl
    1.12.2.1    +1  -1      db/test/test096.tcl
    1.9.2.1     +1  -1      db/test/test097.tcl
    1.9.2.1     +1  -1      db/test/test098.tcl
    1.9.2.1     +1  -1      db/test/test099.tcl
    1.9.2.1     +1  -1      db/test/test100.tcl
    1.9.2.1     +1  -1      db/test/test101.tcl
    1.8.2.1     +1  -1      db/test/test102.tcl
    1.8.2.1     +1  -1      db/test/test103.tcl
    1.8.2.1     +1  -1      db/test/test106.tcl
    1.7.2.1     +1  -1      db/test/test107.tcl
    1.7.2.1     +1  -1      db/test/test109.tcl
    1.5.2.1     +1  -1      db/test/test110.tcl
    1.7.2.1     +57 -42     db/test/test111.tcl
    1.6.2.1     +36 -29     db/test/test112.tcl
    1.6.2.1     +36 -14     db/test/test113.tcl
    1.6.2.1     +67 -28     db/test/test114.tcl
    1.7.2.1     +11 -29     db/test/test115.tcl
    1.5.2.1     +1  -1      db/test/test116.tcl
    1.5.2.1     +23 -4      db/test/test117.tcl
    1.4.2.1     +1  -1      db/test/test119.tcl
    1.4.2.1     +1  -1      db/test/test120.tcl
    1.4.2.1     +1  -1      db/test/test121.tcl
    1.4.2.1     +1  -1      db/test/test122.tcl
    1.11.2.1    +57 -24     db/test/testparams.tcl
    1.10.2.1    +20 -1      db/test/testutils.tcl
    1.9.2.1     +1  -1      db/test/txn001.tcl
    1.9.2.1     +1  -1      db/test/txn002.tcl
    1.9.2.1     +1  -1      db/test/txn003.tcl
    1.9.2.1     +1  -1      db/test/txn004.tcl
    1.9.2.1     +1  -1      db/test/txn005.tcl
    1.9.2.1     +1  -1      db/test/txn006.tcl
    1.10.2.1    +1  -1      db/test/txn007.tcl
    1.9.2.1     +1  -1      db/test/txn008.tcl
    1.9.2.1     +1  -1      db/test/txn009.tcl
    1.8.2.1     +1  -1      db/test/txn010.tcl
    1.8.2.1     +1  -1      db/test/txn011.tcl
    1.5.2.1     +1  -1      db/test/txn012.tcl
    1.5.2.1     +1  -1      db/test/txn012script.tcl
    1.4.2.1     +1  -1      db/test/txn013.tcl
    1.10.2.1    +1  -1      db/test/txnscript.tcl
    1.9.2.1     +1  -1      db/test/update.tcl
    1.10.2.1    +6  -5      db/test/upgrade.tcl
    1.9.2.1     +1  -1      db/test/wrap.tcl
    1.13.2.1    +360 -39    db/txn/txn.c
    1.9.2.1     +1  -2      db/txn/txn.src
    1.9.2.1     +55 -1186   db/txn/txn_auto.c
    1.7.2.1     +32 -249    db/txn/txn_autop.c
    1.5.2.1     +1  -1      db/txn/txn_chkpt.c
    1.5.2.1     +4  -2      db/txn/txn_failchk.c
    1.10.2.1    +1  -1      db/txn/txn_method.c
    1.9.2.1     +1  -1      db/txn/txn_rec.c
    1.10.2.1    +1  -2      db/txn/txn_recover.c
    1.10.2.1    +1  -1      db/txn/txn_region.c
    1.10.2.1    +6  -2      db/txn/txn_stat.c
    1.10.2.1    +33 -8      db/txn/txn_util.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: db/LICENSE
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 LICENSE
  --- db/LICENSE	16 Sep 2009 19:34:36 -0000	1.9
  +++ db/LICENSE	23 Aug 2010 13:36:22 -0000	1.9.2.1
  @@ -9,7 +9,7 @@
   
   =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   /*
  - * Copyright (c) 1990-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1990, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
  @@ .
  patch -p0 <<'@@ .'
  Index: db/README
  ============================================================================
  $ cvs diff -u -r1.18 -r1.18.2.1 README
  --- db/README	7 Jan 2010 22:02:19 -0000	1.18
  +++ db/README	23 Aug 2010 13:36:22 -0000	1.18.2.1
  @@ -1,5 +1,5 @@
  -Berkeley DB 4.8.26: (December 18, 2009)
  +Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)
   
  -This is version 4.8.26 of Berkeley DB from Oracle.  To view release and
  +This is Berkeley DB 11g Release 2 from Oracle.  To view release and
   installation documentation, load the distribution file docs/index.html
   into your web browser.
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_compact.c
  ============================================================================
  $ cvs diff -u -r1.7 -r1.7.2.1 bt_compact.c
  --- db/btree/bt_compact.c	16 Sep 2009 19:34:37 -0000	1.7
  +++ db/btree/bt_compact.c	23 Aug 2010 13:36:23 -0000	1.7.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1999-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1999, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,14 +12,11 @@
   #include "dbinc/db_page.h"
   #include "dbinc/btree.h"
   #include "dbinc/lock.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   #include "dbinc/txn.h"
   
   static int __bam_compact_dups __P((DBC *,
        PAGE **, u_int32_t, int, DB_COMPACT *, int *));
  -static int __bam_compact_int __P((DBC *,
  -     DBT *, DBT *, u_int32_t, int *, DB_COMPACT *, int *));
   static int __bam_compact_isdone __P((DBC *, DBT *, PAGE *, int *));
   static int __bam_csearch __P((DBC *, DBT *, u_int32_t, int));
   static int __bam_lock_tree __P((DBC *, EPG *, EPG *csp, u_int32_t, u_int32_t));
  @@ -30,276 +27,13 @@
   static int __bam_merge_pages __P((DBC *, DBC *, DB_COMPACT *));
   static int __bam_merge_records __P((DBC *, DBC*,  u_int32_t, DB_COMPACT *));
   static int __bam_truncate_internal_overflow __P((DBC *, PAGE *, DB_COMPACT *));
  -static int __bam_truncate_overflow __P((DBC *,
  -     db_pgno_t, PAGE **, DB_COMPACT *));
  -static int __bam_truncate_page __P((DBC *, PAGE **, PAGE *, int));
   static int __bam_truncate_root_page __P((DBC *,
        PAGE *, u_int32_t, DB_COMPACT *));
   
   #ifdef HAVE_FTRUNCATE
  -static int __bam_free_freelist __P((DB *, DB_THREAD_INFO *, DB_TXN *));
   static int __bam_savekey __P((DBC *, int, DBT *));
  -static int __bam_setup_freelist __P((DB *, db_pglist_t *, u_int32_t));
  -static int __bam_truncate_internal __P((DB *,
  -     DB_THREAD_INFO *, DB_TXN *, DB_COMPACT *));
   #endif
   
  -#define	SAVE_START							\
  -	do {								\
  -		save_data = *c_data;					\
  -		ret = __db_retcopy(env,				\
  -		     &save_start, current.data, current.size,		\
  -		     &save_start.data, &save_start.ulen);		\
  -	} while (0)
  -
  -/*
  - * Only restore those things that are negated by aborting the
  - * transaction.  We don't restore the number of deadlocks, for example.
  - */
  -
  -#define	RESTORE_START							\
  -	do {								\
  -		c_data->compact_pages_free =				\
  -		      save_data.compact_pages_free;			\
  -		c_data->compact_levels = save_data.compact_levels;	\
  -		c_data->compact_truncate = save_data.compact_truncate;	\
  -		ret = __db_retcopy(env, &current,			\
  -		     save_start.data, save_start.size,			\
  -		     &current.data, &current.ulen);			\
  -	} while (0)
  -
  -/*
  - * __bam_compact -- compact a btree.
  - *
  - * PUBLIC: int __bam_compact __P((DB *, DB_THREAD_INFO *, DB_TXN *,
  - * PUBLIC:     DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *));
  - */
  -int
  -__bam_compact(dbp, ip, txn, start, stop, c_data, flags, end)
  -	DB *dbp;
  -	DB_THREAD_INFO *ip;
  -	DB_TXN *txn;
  -	DBT *start, *stop;
  -	DB_COMPACT *c_data;
  -	u_int32_t flags;
  -	DBT *end;
  -{
  -	DBC *dbc;
  -	DBT current, save_start;
  -	DB_COMPACT save_data;
  -	ENV *env;
  -	u_int32_t factor, retry;
  -	int deadlock, have_freelist, isdone, ret, span, t_ret, txn_local;
  -
  -#ifdef HAVE_FTRUNCATE
  -	db_pglist_t *list;
  -	db_pgno_t last_pgno;
  -	u_int32_t nelems, truncated;
  -#endif
  -
  -	env = dbp->env;
  -
  -	memset(&current, 0, sizeof(current));
  -	memset(&save_start, 0, sizeof(save_start));
  -	dbc = NULL;
  -	factor = 0;
  -	have_freelist = deadlock = isdone = ret = span = 0;
  -	ret = retry = 0;
  -
  -#ifdef HAVE_FTRUNCATE
  -	list = NULL;
  -	last_pgno = 0;
  -	nelems = truncated = 0;
  -#endif
  -
  -	/*
  -	 * We pass "current" to the internal routine, indicating where that
  -	 * routine should begin its work and expecting that it will return to
  -	 * us the last key that it processed.
  -	 */
  -	if (start != NULL && (ret = __db_retcopy(env,
  -	     &current, start->data, start->size,
  -	     &current.data, &current.ulen)) != 0)
  -		return (ret);
  -
  -	if (IS_DB_AUTO_COMMIT(dbp, txn))
  -		txn_local = 1;
  -	else
  -		txn_local = 0;
  -	if (!LF_ISSET(DB_FREE_SPACE | DB_FREELIST_ONLY))
  -		goto no_free;
  -	if (LF_ISSET(DB_FREELIST_ONLY))
  -		LF_SET(DB_FREE_SPACE);
  -
  -#ifdef HAVE_FTRUNCATE
  -	/* Sort the freelist and set up the in-memory list representation. */
  -	if (txn_local && (ret = __txn_begin(env, ip, NULL, &txn, 0)) != 0)
  -		goto err;
  -
  -	if ((ret = __db_free_truncate(dbp, ip,
  -	     txn, flags, c_data, &list, &nelems, &last_pgno)) != 0) {
  -		LF_CLR(DB_FREE_SPACE);
  -		goto terr;
  -	}
  -
  -	/* If the freelist is empty and we are not filling, get out. */
  -	if (nelems == 0 && LF_ISSET(DB_FREELIST_ONLY)) {
  -		ret = 0;
  -		LF_CLR(DB_FREE_SPACE);
  -		goto terr;
  -	}
  -	if ((ret = __bam_setup_freelist(dbp, list, nelems)) != 0) {
  -		/* Someone else owns the free list. */
  -		if (ret == EBUSY)
  -			ret = 0;
  -	}
  -	if (ret == 0)
  -		have_freelist = 1;
  -
  -	/* Commit the txn and release the meta page lock. */
  -terr:	if (txn_local) {
  -		if ((t_ret = __txn_commit(txn, DB_TXN_NOSYNC)) != 0 && ret == 0)
  -			ret = t_ret;
  -		txn = NULL;
  -	}
  -	if (ret != 0)
  -		goto err;
  -
  -	/* Save the number truncated so far, we will add what we get below. */
  -	truncated = c_data->compact_pages_truncated;
  -	if (LF_ISSET(DB_FREELIST_ONLY))
  -		goto done;
  -#endif
  -
  -	/*
  -	 * We want factor to be the target number of free bytes on each page,
  -	 * so we know when to stop adding items to a page.   Make sure to
  -	 * subtract the page overhead when computing this target.  This can
  -	 * result in a 1-2% error on the smallest page.
  -	 * First figure out how many bytes we should use:
  -	 */
  -no_free:
  -	factor = dbp->pgsize - SIZEOF_PAGE;
  -	if (c_data->compact_fillpercent != 0) {
  -		factor *= c_data->compact_fillpercent;
  -		factor /= 100;
  -	}
  -	/* Now convert to the number of free bytes to target. */
  -	factor = (dbp->pgsize - SIZEOF_PAGE) - factor;
  -
  -	if (c_data->compact_pages == 0)
  -		c_data->compact_pages = DB_MAX_PAGES;
  -
  -	do {
  -		deadlock = 0;
  -
  -		SAVE_START;
  -		if (ret != 0)
  -			break;
  -
  -		if (txn_local) {
  -			if ((ret = __txn_begin(env, ip, NULL, &txn, 0)) != 0)
  -				break;
  -
  -			if (c_data->compact_timeout != 0 &&
  -			    (ret = __txn_set_timeout(txn,
  -			    c_data->compact_timeout, DB_SET_LOCK_TIMEOUT)) != 0)
  -				goto err;
  -		}
  -
  -		if ((ret = __db_cursor(dbp, ip, txn, &dbc, 0)) != 0)
  -			goto err;
  -
  -		if ((ret = __bam_compact_int(dbc, &current, stop, factor,
  -		     &span, c_data, &isdone)) ==
  -		     DB_LOCK_DEADLOCK && txn_local) {
  -			/*
  -			 * We retry on deadlock.  Cancel the statistics
  -			 * and reset the start point to before this
  -			 * iteration.
  -			 */
  -			deadlock = 1;
  -			c_data->compact_deadlock++;
  -			RESTORE_START;
  -		}
  -		/*
  -		 * If we could not get a lock while holding an internal
  -		 * node latched, commit the current local transaction otherwise
  -		 * report a deadlock.
  -		 */
  -		if (ret == DB_LOCK_NOTGRANTED) {
  -			if (txn_local || retry++ < 5)
  -				ret = 0;
  -			else
  -				ret = DB_LOCK_DEADLOCK;
  -		} else
  -			retry = 0;
  -
  -		if ((t_ret = __dbc_close(dbc)) != 0 && ret == 0)
  -			ret = t_ret;
  -
  -err:		if (txn_local && txn != NULL) {
  -			if (ret == 0 && deadlock == 0)
  -				ret = __txn_commit(txn, DB_TXN_NOSYNC);
  -			else if ((t_ret = __txn_abort(txn)) != 0 && ret == 0)
  -				ret = t_ret;
  -			txn = NULL;
  -		}
  -	} while (ret == 0 && !isdone);
  -
  -	if (ret == 0 && end != NULL)
  -		ret = __db_retcopy(env, end, current.data, current.size,
  -		    &end->data, &end->ulen);
  -	if (current.data != NULL)
  -		__os_free(env, current.data);
  -	if (save_start.data != NULL)
  -		__os_free(env, save_start.data);
  -
  -#ifdef HAVE_FTRUNCATE
  -	/*
  -	 * Finish up truncation work.  If there are pages left in the free
  -	 * list then search the internal nodes of the tree as we may have
  -	 * missed some while walking the leaf nodes.  Then calculate how
  -	 * many pages we have truncated and release the in-memory free list.
  -	 */
  -done:	if (LF_ISSET(DB_FREE_SPACE)) {
  -		DBMETA *meta;
  -		db_pgno_t pgno;
  -
  -		pgno = PGNO_BASE_MD;
  -		isdone = 1;
  -		if (ret == 0 && !LF_ISSET(DB_FREELIST_ONLY) && (t_ret =
  -		    __memp_fget(dbp->mpf, &pgno, ip, txn, 0, &meta)) == 0) {
  -			isdone = meta->free == PGNO_INVALID;
  -			ret = __memp_fput(dbp->mpf, ip, meta, dbp->priority);
  -		}
  -
  -		if (!isdone)
  -			ret = __bam_truncate_internal(dbp, ip, txn, c_data);
  -
  -		/* Clean up the free list. */
  -		if (list != NULL)
  -			__os_free(env, list);
  -
  -		if ((t_ret =
  -		    __memp_fget(dbp->mpf, &pgno, ip, txn, 0, &meta)) == 0) {
  -			c_data->compact_pages_truncated =
  -			    truncated + last_pgno - meta->last_pgno;
  -			if ((t_ret = __memp_fput(dbp->mpf, ip,
  -			    meta, dbp->priority)) != 0 && ret == 0)
  -				ret = t_ret;
  -		} else if (ret == 0)
  -			ret = t_ret;
  -
  -		if (have_freelist && (t_ret =
  -		    __bam_free_freelist(dbp, ip, txn)) != 0 && ret == 0)
  -			t_ret = ret;
  -	}
  -#endif
  -
  -	return (ret);
  -}
  -
   /*
    * __bam_csearch -- isolate search code for bam_compact.
    * This routine hides the differences between searching
  @@ -395,7 +129,7 @@
   			FLD_SET(sflag, SR_MIN);
   
   		if ((ret = __bam_search(dbc,
  -		     cp->root, start, sflag, level, NULL, &not_used)) != 0)
  +		     PGNO_INVALID, start, sflag, level, NULL, &not_used)) != 0)
   			return (ret);
   	}
   
  @@ -407,8 +141,10 @@
    *	Called either with a cursor on the main database
    * or a cursor initialized to the root of an off page duplicate
    * tree.
  + * PUBLIC: int __bam_compact_int __P((DBC *,
  + * PUBLIC:      DBT *, DBT *, u_int32_t, int *, DB_COMPACT *, int *));
    */
  -static int
  +int
   __bam_compact_int(dbc, start, stop, factor, spanp, c_data, donep)
   	DBC *dbc;
   	DBT *start, *stop;
  @@ -428,9 +164,9 @@
   	db_pgno_t metapgno, npgno, nnext_pgno;
   	db_pgno_t pgno, prev_pgno, ppgno, saved_pgno;
   	db_recno_t next_recno;
  -	u_int32_t sflag, pgs_free;
  -	int check_dups, check_trunc, clear_root, isdone;
  -	int merged, nentry, next_p, pgs_done, ret, t_ret, tdone;
  +	u_int32_t nentry, sflag, pgs_free;
  +	int check_dups, check_trunc, clear_root, do_commit, isdone;
  +	int merged, next_p, pgs_done, ret, t_ret, tdone;
   
   #ifdef	DEBUG
   #define	CTRACE(dbc, location, t, start, f) do {				\
  @@ -457,10 +193,12 @@
   	isdone = 0;
   	tdone = 0;
   	pgs_done = 0;
  +	do_commit = 0;
   	next_recno = 0;
   	next_p = 0;
   	clear_root = 0;
   	metapgno = PGNO_BASE_MD;
  +	ppgno = PGNO_INVALID;
   	LOCK_INIT(next_lock);
   	LOCK_INIT(nnext_lock);
   	LOCK_INIT(saved_lock);
  @@ -678,7 +416,7 @@
   		else {
   			npgno = NEXT_PGNO(pg);
   			/* If this is now the root, we are very done. */
  -			if (PGNO(pg) == cp->root)
  +			if (PGNO(pg) == BAM_ROOT_PGNO(dbc))
   				isdone = 1;
   			else {
   				if (npgno != PGNO_INVALID) {
  @@ -723,6 +461,7 @@
   		 */
   		if (ndbc == NULL && (ret = __dbc_dup(dbc, &ndbc, 0)) != 0)
   			goto err;
  +		DB_ASSERT(env, ndbc != NULL);
   		ncp = (BTREE_CURSOR *)ndbc->internal;
   
   		ncp->recno = cp->recno;
  @@ -768,7 +507,7 @@
   		/*
   		 * If this is RECNO then we want to swap the stacks.
   		 */
  -		if (dbp->type == DB_RECNO) {
  +		if (dbc->dbtype == DB_RECNO) {
   			ndbc->internal = (DBC_INTERNAL *)cp;
   			dbc->internal = (DBC_INTERNAL *)ncp;
   			cp = ncp;
  @@ -805,12 +544,14 @@
   			}
   			pgs_done++;
   			/* Get a fresh low numbered page. */
  -			if ((ret = __bam_truncate_page(dbc,
  -			    &pg, ncp->csp->page, 1)) != 0)
  +			if ((ret = __db_exchange_page(dbc,
  +			    &cp->csp->page, ncp->csp->page,
  +			    PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err1;
   			if ((ret = __TLPUT(dbc, prev_lock)) != 0)
  -				goto err;
  +				goto err1;
   			LOCK_INIT(prev_lock);
  +			pg = cp->csp->page;
   		}
   		*spanp = 0;
   		PTRACE(dbc, "SDups", PGNO(ncp->csp->page), start, 0);
  @@ -818,8 +559,10 @@
   		     &ncp->csp->page, factor, 1, c_data, &pgs_done)) != 0)
   			goto err1;
   
  +		DB_ASSERT(env, ndbc != NULL);
   		/* Check to see if the tree collapsed. */
  -		if (PGNO(ncp->csp->page) == ncp->root)
  +		/*lint -e{794} */
  +		if (PGNO(ncp->csp->page) == BAM_ROOT_PGNO(ndbc))
   			goto done;
   
   		pg = cp->csp->page;
  @@ -853,6 +596,8 @@
   				break;
   		}
   
  +		if (ret != 0 && ret != DB_LOCK_NOTGRANTED)
  +			goto err1;
   		/*
   		 * If we merged the parent, then we nolonger span.
   		 * Otherwise if we tried to merge the parent but would
  @@ -871,8 +616,6 @@
   			next_recno = cp->recno;
   			goto next_page;
   		}
  -		if (ret != 0)
  -			goto err1;
   		PTRACE(dbc, "SMerge", PGNO(cp->csp->page), start, 0);
   
   		/* if we remove the next page, then we need its next locked */
  @@ -883,6 +626,7 @@
   			if (ret != 0)
   				goto err1;
   		}
  +		/*lint -e{794} */
   		if ((ret = __bam_merge(dbc,
   		     ndbc, factor, stop, c_data, &isdone)) != 0)
   			goto err1;
  @@ -919,7 +663,15 @@
   		pg = cp->csp->page;
   		DB_ASSERT(env, IS_DIRTY(pg));
   		DB_ASSERT(env,
  -		    PGNO(pg) == cp->root || IS_DIRTY(cp->csp[-1].page));
  +		    PGNO(pg) == BAM_ROOT_PGNO(dbc) ||
  +		    IS_DIRTY(cp->csp[-1].page));
  +
  +		/* Check to see if we moved to a new parent. */
  +		if (PGNO(pg) != BAM_ROOT_PGNO(dbc) &&
  +		    ppgno != PGNO(cp->csp[-1].page) && pgs_done != 0) {
  +			do_commit = 1;
  +			goto next_page;
  +		}
   
   		/* We now have a write lock, recheck the page. */
   		if ((nentry = NUM_ENT(pg)) == 0) {
  @@ -937,7 +689,7 @@
   		npgno = NEXT_PGNO(pg);
   
   		/* Check to see if the tree collapsed. */
  -		if (PGNO(pg) == cp->root)
  +		if (PGNO(pg) == BAM_ROOT_PGNO(dbc))
   			goto err1;
   		DB_ASSERT(env, cp->csp - cp->sp == 1);
   
  @@ -957,10 +709,11 @@
   					if (ret != 0)
   						goto err1;
   				}
  -				pgs_done++;
   				/* Get a fresh low numbered page. */
  -				if ((ret = __bam_truncate_page(dbc,
  -				    &pg, NULL, 1)) != 0)
  +				pgno = PGNO(pg);
  +				if ((ret = __db_exchange_page(dbc,
  +				    &cp->csp->page, NULL,
  +				    PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   					goto err1;
   				if ((ret = __TLPUT(dbc, prev_lock)) != 0)
   					goto err1;
  @@ -968,7 +721,22 @@
   				if ((ret = __TLPUT(dbc, next_lock)) != 0)
   					goto err1;
   				LOCK_INIT(next_lock);
  +				pg = cp->csp->page;
  +				if (pgno != PGNO(pg)) {
  +					pgs_done++;
  +					pgno = PGNO(pg);
  +				}
   			}
  +			/*
  +			 * If we are going to leave this parent commit
  +			 * the current transaction before continuing.
  +			 */
  +			epg = &cp->csp[-1];
  +			if ((ppgno != PGNO(epg->page) &&
  +			    ppgno != PGNO_INVALID) ||
  +			    epg->indx == NUM_ENT(epg->page) - 1)
  +				do_commit = 1;
  +			ppgno = PGNO(epg->page);
   			goto next_page;
   		}
   
  @@ -1021,6 +789,7 @@
   		 */
   		if (epg->indx == NUM_ENT(ppg) - 1) {
   			*spanp = 1;
  +			do_commit = 1;
   			npgno = PGNO(pg);
   			next_recno = cp->recno;
   			epg->page = ppg;
  @@ -1050,14 +819,19 @@
   				if (ret != 0)
   					goto err1;
   			}
  -			pgs_done++;
  +			pgno = PGNO(pg);
   			/* Get a fresh low numbered page. */
  -			if ((ret = __bam_truncate_page(dbc, &pg, npg, 1)) != 0)
  +			if ((ret = __db_exchange_page(dbc, &cp->csp->page,
  +			    npg, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err1;
   			if ((ret = __TLPUT(dbc, prev_lock)) != 0)
   				goto err1;
   			LOCK_INIT(prev_lock);
  -			pgno = PGNO(pg);
  +			pg = cp->csp->page;
  +			if (pgno != PGNO(pg)) {
  +				pgs_done++;
  +				pgno = PGNO(pg);
  +			}
   		}
   		c_data->compact_pages_examine++;
   
  @@ -1136,7 +910,8 @@
   	pg = NULL;
   	if ((ret = __bam_stkrel(dbc, STK_PGONLY)) != 0)
   		goto err;
  -	if ((ret = __db_lget(dbc, 0, npgno, DB_LOCK_READ, 0, &next_lock)) != 0)
  +	if (npgno != PGNO_INVALID &&
  +	    (ret = __db_lget(dbc, 0, npgno, DB_LOCK_READ, 0, &next_lock)) != 0)
   		goto err;
   	if ((ret = __bam_stkrel(dbc, pgs_done == 0 ? STK_NOLOCK : 0)) != 0)
   		goto err;
  @@ -1155,12 +930,12 @@
   		 * If we are at the end of this parent commit the
   		 * transaction so we don't tie things up.
   		 */
  -		if (pgs_done != 0 && *spanp) {
  -deleted:		if (((ret = __bam_stkrel(ndbc, 0)) != 0 ||
  +		if (pgs_done != 0 && do_commit && !F_ISSET(dbc, DBC_OPD)) {
  +deleted:		if (ndbc != NULL &&
  +			     ((ret = __bam_stkrel(ndbc, 0)) != 0 ||
   			     (ret = __dbc_close(ndbc)) != 0))
   				goto err;
  -			*donep = 0;
  -			return (0);
  +			goto out;
   		}
   
   		/* Reget the next page to look at. */
  @@ -1171,6 +946,7 @@
   		cp->csp->lock = next_lock;
   		LOCK_INIT(next_lock);
   		next_p = 1;
  +		do_commit = 0;
   		/* If we did not do anything we can drop the metalock. */
   		if (pgs_done == 0 && (ret = __LPUT(dbc, metalock)) != 0)
   			goto err;
  @@ -1222,7 +998,11 @@
   		  dbc->thread_info, npg, dbc->priority) != 0) && ret == 0)
   		ret = t_ret;
   
  -	*donep = isdone;
  +out:	*donep = isdone;
  +
  +	/* For OPD trees return if we did anything in the span variable. */
  +	if (F_ISSET(dbc, DBC_OPD))
  +		*spanp = pgs_done;
   
   	return (ret);
   }
  @@ -1279,6 +1059,7 @@
   	    P_FREESPACE(dbp, npg))) < (int)factor)
   		ret = __bam_merge_records(dbc, ndbc, factor, c_data);
   	else
  +		/*lint -e{794} */
   free_page:	ret = __bam_merge_pages(dbc, ndbc, c_data);
   
   	return (ret);
  @@ -1311,24 +1092,26 @@
   	cp = (BTREE_CURSOR *)dbc->internal;
   	ncp = (BTREE_CURSOR *)ndbc->internal;
   	pg = cp->csp->page;
  -	npg = ncp->csp->page;
   	memset(&hdr, 0, sizeof(hdr));
   	pind = NUM_ENT(pg);
   	n_ok = 0;
   	adjust = 0;
   	ret = 0;
  -	nent = NUM_ENT(npg);
  -
  -	DB_ASSERT(env, nent != 0);
   
   	/* See if we want to swap out this page. */
   	if (c_data->compact_truncate != PGNO_INVALID &&
  -	     PGNO(npg) > c_data->compact_truncate) {
  +	     PGNO(ncp->csp->page) > c_data->compact_truncate) {
   		/* Get a fresh low numbered page. */
  -		if ((ret = __bam_truncate_page(ndbc, &npg, pg, 1)) != 0)
  +		if ((ret = __db_exchange_page(ndbc,
  +		   &ncp->csp->page, pg, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   			goto err;
   	}
   
  +	npg = ncp->csp->page;
  +	nent = NUM_ENT(npg);
  +
  +	DB_ASSERT(env, nent != 0);
  +
   	ninp = P_INP(dbp, npg);
   
   	/*
  @@ -1591,14 +1374,16 @@
   	BTREE_CURSOR *cp, *ncp;
   	DB *dbp;
   	DBT data, hdr;
  +	DB_LOCK root_lock;
   	DB_MPOOLFILE *dbmp;
   	PAGE *pg, *npg;
   	db_indx_t nent, *ninp, *pinp;
  -	db_pgno_t ppgno;
  +	db_pgno_t pgno, ppgno;
   	u_int8_t *bp;
   	u_int32_t len;
   	int i, level, ret;
   
  +	LOCK_INIT(root_lock);
   	COMPQUIET(ppgno, PGNO_INVALID);
   	dbp = dbc->dbp;
   	dbmp = dbp->mpf;
  @@ -1628,7 +1413,7 @@
   		memset(&data, 0, sizeof(data));
   		data.data = (u_int8_t *)npg + HOFFSET(npg);
   		data.size = len;
  -		if ((ret = __bam_merge_log(dbp,
  +		if ((ret = __db_merge_log(dbp,
   		     dbc->txn, &LSN(pg), 0, PGNO(pg),
   		     &LSN(pg), PGNO(npg), &LSN(npg), &hdr, &data, 0)) != 0)
   			goto err;
  @@ -1676,13 +1461,13 @@
   	 * must be done before hand because we cannot
   	 * hold a page pinned if it might be truncated.
   	 */
  -	if ((ret = __bam_relink(dbc,
  +	if ((ret = __db_relink(dbc,
   	    ncp->csp->page, cp->csp->page, PGNO_INVALID)) != 0)
   		goto err;
   	/* Drop the duplicate reference to the sub tree root. */
   	cp->sp->page = NULL;
   	LOCK_INIT(cp->sp->lock);
  -	if (PGNO(ncp->sp->page) == ncp->root &&
  +	if (PGNO(ncp->sp->page) == BAM_ROOT_PGNO(ndbc) &&
   	    NUM_ENT(ncp->sp->page) == 2) {
   		if ((ret = __bam_stkrel(dbc, STK_CLRDBC | STK_PGONLY)) != 0)
   			goto err;
  @@ -1690,8 +1475,7 @@
   		ppgno = PGNO(ncp->csp[-1].page);
   	} else
   		level = 0;
  -	if (c_data->compact_truncate > PGNO(npg))
  -		c_data->compact_truncate--;
  +	COMPACT_TRUNCATE(c_data);
   	if ((ret = __bam_dpages(ndbc,
   	    0, ndbc->dbtype == DB_RECNO ? 0 : BTD_UPDATE)) != 0)
   		goto err;
  @@ -1699,20 +1483,23 @@
   	c_data->compact_pages_free++;
   	c_data->compact_pages--;
   	if (level != 0) {
  -		if ((ret = __memp_fget(dbmp, &ncp->root,
  -		    dbc->thread_info, dbc->txn, 0, &npg)) != 0)
  +		pgno = PGNO_INVALID;
  +		BAM_GET_ROOT(ndbc, pgno, npg, 0, DB_LOCK_READ, root_lock, ret);
  +		if (ret != 0)
   			goto err;
  +		DB_ASSERT(dbp->env, npg != NULL);
   		if (level == LEVEL(npg))
   			level = 0;
   		if ((ret = __memp_fput(dbmp,
   		     dbc->thread_info, npg, dbc->priority)) != 0)
   			goto err;
  +		if ((ret = __LPUT(ndbc, root_lock)) != 0)
  +			goto err;
   		npg = NULL;
   		if (level != 0) {
   			c_data->compact_levels++;
   			c_data->compact_pages_free++;
  -			if (c_data->compact_truncate > ppgno)
  -				c_data->compact_truncate--;
  +			COMPACT_TRUNCATE(c_data);
   			if (c_data->compact_pages != 0)
   				c_data->compact_pages--;
   		}
  @@ -1736,12 +1523,13 @@
   	BTREE_CURSOR *cp, *ncp;
   	DB *dbp;
   	DBT data, hdr;
  +	DB_LOCK root_lock;
   	DB_MPOOLFILE *dbmp;
   	EPG *epg, *save_csp, *nsave_csp;
   	PAGE *pg, *npg;
   	RINTERNAL *rk;
   	db_indx_t first, indx, pind;
  -	db_pgno_t ppgno;
  +	db_pgno_t pgno, ppgno;
   	int32_t nrecs, trecs;
   	u_int16_t size;
   	u_int32_t freespace, pfree;
  @@ -1751,6 +1539,7 @@
   	COMPQUIET(ppgno, PGNO_INVALID);
   	DB_ASSERT(NULL, dbc != NULL);
   	DB_ASSERT(NULL, ndbc != NULL);
  +	LOCK_INIT(root_lock);
   
   	/*
   	 * ndbc will contain the the dominating parent of the subtree.
  @@ -1988,7 +1777,7 @@
   		cp->csp = save_csp;
   		cp->sp->page = NULL;
   		LOCK_INIT(cp->sp->lock);
  -		if (PGNO(ncp->sp->page) == ncp->root &&
  +		if (PGNO(ncp->sp->page) == BAM_ROOT_PGNO(ndbc) &&
   		    NUM_ENT(ncp->sp->page) == 2) {
   			if ((ret = __bam_stkrel(dbc, STK_CLRDBC)) != 0)
   				goto err;
  @@ -1997,18 +1786,21 @@
   		} else
   			level = 0;
   
  -		if (c_data->compact_truncate > PGNO(npg))
  -			c_data->compact_truncate--;
  +		COMPACT_TRUNCATE(c_data);
   		ret = __bam_dpages(ndbc,
   		     0, ndbc->dbtype == DB_RECNO ?
   		     BTD_RELINK : BTD_UPDATE | BTD_RELINK);
   		c_data->compact_pages_free++;
   		if (ret == 0 && level != 0) {
  -			if ((ret = __memp_fget(dbmp, &ncp->root,
  -			    dbc->thread_info, dbc->txn, 0, &npg)) != 0)
  +			pgno = PGNO_INVALID;
  +			BAM_GET_ROOT(ndbc,
  +			    pgno, npg, 0, DB_LOCK_READ, root_lock, ret);
  +			if (ret != 0)
   				goto err;
   			if (level == LEVEL(npg))
   				level = 0;
  +			if ((ret = __LPUT(ndbc, root_lock)) != 0)
  +				goto err;
   			if ((ret = __memp_fput(dbmp,
   			    dbc->thread_info, npg, dbc->priority)) != 0)
   				goto err;
  @@ -2016,8 +1808,7 @@
   			if (level != 0) {
   				c_data->compact_levels++;
   				c_data->compact_pages_free++;
  -				if (c_data->compact_truncate > ppgno)
  -					c_data->compact_truncate--;
  +				COMPACT_TRUNCATE(c_data);
   				if (c_data->compact_pages != 0)
   					c_data->compact_pages--;
   			}
  @@ -2029,12 +1820,15 @@
   		    c_data->compact_truncate != PGNO_INVALID &&
   		    PGNO(npg) > c_data->compact_truncate &&
   		    ncp->csp != ncp->sp) {
  -			if ((ret = __bam_truncate_page(ndbc, &npg, pg, 1)) != 0)
  +			if ((ret = __db_exchange_page(ndbc, &ncp->csp->page,
  +			    pg, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err;
   		}
   		if (c_data->compact_truncate != PGNO_INVALID &&
   		     PGNO(pg) > c_data->compact_truncate && cp->csp != cp->sp) {
  -			if ((ret = __bam_truncate_page(dbc, &pg, npg, 1)) != 0)
  +			if ((ret = __db_exchange_page(dbc, &cp->csp->page,
  +			    ncp->csp->page,
  +			    PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err;
   		}
   	}
  @@ -2065,28 +1859,20 @@
   	BOVERFLOW *bo;
   	BTREE_CURSOR *cp;
   	DB *dbp;
  -	DBC *opd;
  -	DBT start;
   	DB_MPOOLFILE *dbmp;
  -	ENV *env;
  -	PAGE *dpg, *pg;
   	db_indx_t i;
   	db_pgno_t pgno;
  -	int isdone, level, ret, span, t_ret;
  +	int ret;
   
  -	span = 0;
   	ret = 0;
  -	opd = NULL;
   
   	DB_ASSERT(NULL, dbc != NULL);
   	dbp = dbc->dbp;
  -	env = dbp->env;
   	dbmp = dbp->mpf;
   	cp = (BTREE_CURSOR *)dbc->internal;
  -	pg = *ppg;
   
  -	for (i = 0; i <  NUM_ENT(pg); i++) {
  -		bo = GET_BOVERFLOW(dbp, pg, i);
  +	for (i = 0; i <  NUM_ENT(*ppg); i++) {
  +		bo = GET_BOVERFLOW(dbp, *ppg, i);
   		if (B_TYPE(bo->type) == B_KEYDATA)
   			continue;
   		c_data->compact_pages_examine++;
  @@ -2098,9 +1884,9 @@
   				 * least read locked.  Drop the buffer
   				 * and get the write lock.
   				 */
  -				pgno = PGNO(pg);
  +				pgno = PGNO(*ppg);
   				if ((ret = __memp_fput(dbmp, dbc->thread_info,
  -				     pg, dbc->priority)) != 0)
  +				     *ppg, dbc->priority)) != 0)
   					goto err;
   				*ppg = NULL;
   				if ((ret = __db_lget(dbc, 0, pgno,
  @@ -2111,310 +1897,108 @@
   				    dbc->thread_info,
   				    dbc->txn, DB_MPOOL_DIRTY, ppg)) != 0)
   					goto err;
  -				pg = *ppg;
   			}
  -			if ((ret =
  -			     __bam_truncate_root_page(dbc, pg, i, c_data)) != 0)
  +			if ((ret = __bam_truncate_root_page(dbc,
  +			     *ppg, i, c_data)) != 0)
   				goto err;
   			/* Just in case it should move.  Could it? */
  -			bo = GET_BOVERFLOW(dbp, pg, i);
  +			bo = GET_BOVERFLOW(dbp, *ppg, i);
   		}
   
   		if (B_TYPE(bo->type) == B_OVERFLOW) {
  -			if ((ret = __bam_truncate_overflow(dbc,
  +			if ((ret = __db_truncate_overflow(dbc,
   			    bo->pgno, have_lock ? NULL : ppg, c_data)) != 0)
   				goto err;
   			(*donep)++;
   			continue;
   		}
  -		/*
  -		 * Take a peek at the root.  If it's a leaf then
  -		 * there is no tree here, avoid all the trouble.
  -		 */
  -		if ((ret = __memp_fget(dbmp, &bo->pgno,
  -		     dbc->thread_info, dbc->txn, 0, &dpg)) != 0)
  -			goto err;
  -
  -		level = dpg->level;
  -		if ((ret = __memp_fput(dbmp,
  -		     dbc->thread_info, dpg, dbc->priority)) != 0)
  -			goto err;
  -		if (level == LEAFLEVEL)
  -			continue;
  -		if ((ret = __dbc_newopd(dbc, bo->pgno, NULL, &opd)) != 0)
  -			return (ret);
  -		if (!have_lock) {
  -			/*
  -			 * The caller should have the page at
  -			 * least read locked.  Drop the buffer
  -			 * and get the write lock.
  -			 */
  -			pgno = PGNO(pg);
  -			if ((ret = __memp_fput(dbmp, dbc->thread_info,
  -			     pg, dbc->priority)) != 0)
  -				goto err;
  -			*ppg = NULL;
  -			if ((ret = __db_lget(dbc, 0, pgno,
  -			     DB_LOCK_WRITE, 0, &cp->csp->lock)) != 0)
  -				goto err;
  -			have_lock = 1;
  -			if ((ret = __memp_fget(dbmp, &pgno,
  -			    dbc->thread_info,
  -			    dbc->txn, DB_MPOOL_DIRTY, ppg)) != 0)
  -				goto err;
  -			pg = *ppg;
  -		}
  -		(*donep)++;
  -		memset(&start, 0, sizeof(start));
  -		do {
  -			if ((ret = __bam_compact_int(opd, &start,
  -			     NULL, factor, &span, c_data, &isdone)) != 0)
  -				break;
  -		} while (!isdone);
  -
  -		if (start.data != NULL)
  -			__os_free(env, start.data);
  -
  -		if (ret != 0)
  -			goto err;
  -
  -		ret = __dbc_close(opd);
  -		opd = NULL;
  -		if (ret != 0)
  +		if ((ret = __bam_compact_opd(dbc, bo->pgno,
  +		    have_lock ? NULL : ppg, factor, c_data, donep)) != 0)
   			goto err;
   	}
   
  -err:	if (opd != NULL && (t_ret = __dbc_close(opd)) != 0 && ret == 0)
  -		ret = t_ret;
  +err:
   	return (ret);
   }
   
   /*
  - * __bam_truncate_page -- swap a page with a lower numbered page.
  - *	The cusor has a stack which includes at least the
  - * immediate parent of this page.
  + * __bam_compact_opd -- compact an off page duplicate tree.
  + *
  + * PUBLIC: int __bam_compact_opd __P((DBC *,
  + * PUBLIC:      db_pgno_t, PAGE **, u_int32_t, DB_COMPACT *, int *));
    */
  -static int
  -__bam_truncate_page(dbc, pgp, opg, update_parent)
  +int
  +__bam_compact_opd(dbc, root_pgno, ppg, factor, c_data, donep)
   	DBC *dbc;
  -	PAGE **pgp, *opg;
  -	int update_parent;
  +	db_pgno_t root_pgno;
  +	PAGE **ppg;
  +	u_int32_t factor;
  +	DB_COMPACT *c_data;
  +	int *donep;
   {
   	BTREE_CURSOR *cp;
  -	DB *dbp;
  -	DBT data, hdr;
  -	DB_LSN lsn;
  -	DB_LOCK lock;
  -	EPG *epg;
  -	PAGE *newpage;
  -	db_pgno_t newpgno, oldpgno, *pgnop;
  -	int ret;
  +	DBC *opd;
  +	DBT start;
  +	DB_MPOOLFILE *dbmp;
  +	ENV *env;
  +	PAGE *dpg;
  +	int isdone, level, ret, span, t_ret;
  +	db_pgno_t pgno;
   
  -	DB_ASSERT(NULL, dbc != NULL);
  -	dbp = dbc->dbp;
  -	LOCK_INIT(lock);
  +	opd = NULL;
  +	env = dbc->dbp->env;
  +	dbmp = dbc->dbp->mpf;
  +	cp = (BTREE_CURSOR *)dbc->internal;
   
   	/*
  -	 * We want to free a page that lives in the part of the file that
  -	 * can be truncated, so we're going to move it onto a free page
  -	 * that is in the part of the file that need not be truncated.
  -	 * Since the freelist is ordered now, we can simply call __db_new
  -	 * which will grab the first element off the freelist; we know this
  -	 * is the lowest numbered free page.
  +	 * Take a peek at the root.  If it's a leaf then
  +	 * there is no tree here, avoid all the trouble.
   	 */
  -	if ((ret = __db_new(dbc, P_DONTEXTEND | TYPE(*pgp),
  -	     TYPE(*pgp) == P_LBTREE ? &lock : NULL, &newpage)) != 0)
  -		return (ret);
  +	if ((ret = __memp_fget(dbmp, &root_pgno,
  +	     dbc->thread_info, dbc->txn, 0, &dpg)) != 0)
  +		goto err;
   
  -	/*
  -	 * If newpage is null then __db_new would have had to allocate
  -	 * a new page from the filesystem, so there is no reason
  -	 * to continue this action.
  -	 */
  -	if (newpage == NULL)
  +	level = dpg->level;
  +	if ((ret = __memp_fput(dbmp,
  +	     dbc->thread_info, dpg, dbc->priority)) != 0)
  +		goto err;
  +	if (level == LEAFLEVEL)
   		return (0);
  -
  -	/*
  -	 * It is possible that a higher page is allocated if other threads
  -	 * are allocating at the same time, if so, just put it back.
  -	 */
  -	if (PGNO(newpage) > PGNO(*pgp)) {
  -		/* Its unfortunate but you can't just free a new overflow. */
  -		if (TYPE(newpage) == P_OVERFLOW)
  -			OV_LEN(newpage) = 0;
  -		if ((ret = __LPUT(dbc, lock)) != 0)
  -			return (ret);
  -		return (__db_free(dbc, newpage));
  -	}
  -
  -	/* Log if necessary. */
  -	if (DBC_LOGGING(dbc)) {
  -		memset(&hdr, 0, sizeof(hdr));
  -		hdr.data = *pgp;
  -		hdr.size = P_OVERHEAD(dbp);
  -		memset(&data, 0, sizeof(data));
  -		if (TYPE(*pgp) == P_OVERFLOW) {
  -			data.data = (u_int8_t *)*pgp + P_OVERHEAD(dbp);
  -			data.size = OV_LEN(*pgp);
  -		} else {
  -			data.data = (u_int8_t *)*pgp + HOFFSET(*pgp);
  -			data.size = dbp->pgsize - HOFFSET(*pgp);
  -			hdr.size += NUM_ENT(*pgp) * sizeof(db_indx_t);
  -		}
  -		if ((ret = __bam_merge_log(dbp, dbc->txn,
  -		      &LSN(newpage), 0, PGNO(newpage), &LSN(newpage),
  -		      PGNO(*pgp), &LSN(*pgp), &hdr, &data, 1)) != 0)
  +	if ((ret = __dbc_newopd(dbc, root_pgno, NULL, &opd)) != 0)
  +		goto err;
  +	if (ppg != NULL) {
  +		/*
  +		 * The caller should have the page at
  +		 * least read locked.  Drop the buffer
  +		 * and get the write lock.
  +		 */
  +		pgno = PGNO(*ppg);
  +		if ((ret = __memp_fput(dbmp, dbc->thread_info,
  +		     *ppg, dbc->priority)) != 0)
  +			goto err;
  +		*ppg = NULL;
  +		if ((ret = __db_lget(dbc, 0, pgno,
  +		     DB_LOCK_WRITE, 0, &cp->csp->lock)) != 0)
  +			goto err;
  +		if ((ret = __memp_fget(dbmp, &pgno,
  +		    dbc->thread_info,
  +		    dbc->txn, DB_MPOOL_DIRTY, ppg)) != 0)
   			goto err;
  -	} else
  -		LSN_NOT_LOGGED(LSN(newpage));
  -
  -	oldpgno = PGNO(*pgp);
  -	newpgno = PGNO(newpage);
  -	lsn = LSN(newpage);
  -	memcpy(newpage, *pgp, dbp->pgsize);
  -	PGNO(newpage) = newpgno;
  -	LSN(newpage) = lsn;
  -
  -	/* Empty the old page. */
  -	if ((ret = __memp_dirty(dbp->mpf,
  -	    pgp, dbc->thread_info, dbc->txn, dbc->priority, 0)) != 0)
  -		goto err;
  -	if (TYPE(*pgp) == P_OVERFLOW)
  -		OV_LEN(*pgp) = 0;
  -	else {
  -		HOFFSET(*pgp) = dbp->pgsize;
  -		NUM_ENT(*pgp) = 0;
  -	}
  -	LSN(*pgp) = lsn;
  -
  -	/* Update siblings. */
  -	switch (TYPE(newpage)) {
  -	case P_OVERFLOW:
  -	case P_LBTREE:
  -	case P_LRECNO:
  -	case P_LDUP:
  -		if (NEXT_PGNO(newpage) == PGNO_INVALID &&
  -		    PREV_PGNO(newpage) == PGNO_INVALID)
  -			break;
  -		if ((ret = __bam_relink(dbc, *pgp, opg, PGNO(newpage))) != 0)
  -			goto err;
  -		break;
  -	default:
  -		break;
  -	}
  -	cp = (BTREE_CURSOR *)dbc->internal;
  -
  -	/*
  -	 * Now, if we free this page, it will get truncated, when we free
  -	 * all the pages after it in the file.
  -	 */
  -	ret = __db_free(dbc, *pgp);
  -	/* db_free always puts the page. */
  -	*pgp = newpage;
  -
  -	if (ret != 0)
  -		return (ret);
  -
  -	if (!update_parent)
  -		goto done;
  -
  -	/* Update the parent. */
  -	epg = &cp->csp[-1];
  -
  -	switch (TYPE(epg->page)) {
  -	case P_IBTREE:
  -		pgnop = &GET_BINTERNAL(dbp, epg->page, epg->indx)->pgno;
  -		break;
  -	case P_IRECNO:
  -		pgnop = &GET_RINTERNAL(dbp, epg->page, epg->indx)->pgno;
  -		break;
  -	default:
  -		pgnop = &GET_BOVERFLOW(dbp, epg->page, epg->indx)->pgno;
  -		break;
   	}
  -	DB_ASSERT(dbp->env, oldpgno == *pgnop);
  -	if (DBC_LOGGING(dbc)) {
  -		if ((ret = __bam_pgno_log(dbp, dbc->txn, &LSN(epg->page),
  -		    0, PGNO(epg->page), &LSN(epg->page), (u_int32_t)epg->indx,
  -		    *pgnop, PGNO(newpage))) != 0)
  -			return (ret);
  -	} else
  -		LSN_NOT_LOGGED(LSN(epg->page));
  -
  -	*pgnop = PGNO(newpage);
  -	cp->csp->page = newpage;
  -	if ((ret = __TLPUT(dbc, lock)) != 0)
  -		return (ret);
  -
  -done:	return (0);
  -
  -err:	(void)__memp_fput(dbp->mpf, dbc->thread_info, newpage, dbc->priority);
  -	(void)__TLPUT(dbc, lock);
  -	return (ret);
  -}
  -
  -/*
  - * __bam_truncate_overflow -- find overflow pages to truncate.
  - *	Walk the pages of an overflow chain and swap out
  - * high numbered pages.  We are passed the first page
  - * but only deal with the second and subsequent pages.
  - */
  -
  -static int
  -__bam_truncate_overflow(dbc, pgno, ppg, c_data)
  -	DBC *dbc;
  -	db_pgno_t pgno;
  -	PAGE **ppg;
  -	DB_COMPACT *c_data;
  -{
  -	DB *dbp;
  -	DB_LOCK lock;
  -	PAGE *page;
  -	db_pgno_t ppgno;
  -	int have_lock, ret, t_ret;
  -
  -	dbp = dbc->dbp;
  -	page = NULL;
  -	LOCK_INIT(lock);
  -	have_lock = ppg == NULL;
  -
  -	if ((ret = __memp_fget(dbp->mpf, &pgno,
  -	     dbc->thread_info, dbc->txn, 0, &page)) != 0)
  -		return (ret);
  +	memset(&start, 0, sizeof(start));
  +	do {
  +		span = 0;
  +		if ((ret = __bam_compact_int(opd, &start,
  +		     NULL, factor, &span, c_data, &isdone)) != 0)
  +			break;
  +		/* For OPD the number of pages dirtied is returned in span. */
  +		*donep += span;
  +	} while (!isdone);
   
  -	while ((pgno = NEXT_PGNO(page)) != PGNO_INVALID) {
  -		if ((ret = __memp_fput(dbp->mpf,
  -		     dbc->thread_info, page, dbc->priority)) != 0)
  -			return (ret);
  -		if ((ret = __memp_fget(dbp->mpf, &pgno,
  -		    dbc->thread_info, dbc->txn, 0, &page)) != 0)
  -			return (ret);
  -		if (pgno <= c_data->compact_truncate)
  -			continue;
  -		if (have_lock == 0) {
  -			ppgno = PGNO(*ppg);
  -			if ((ret = __memp_fput(dbp->mpf, dbc->thread_info,
  -			     *ppg, dbc->priority)) != 0)
  -				goto err;
  -			*ppg = NULL;
  -			if ((ret = __db_lget(dbc, 0, ppgno,
  -			     DB_LOCK_WRITE, 0, &lock)) != 0)
  -				goto err;
  -			if ((ret = __memp_fget(dbp->mpf, &ppgno,
  -			    dbc->thread_info,
  -			    dbc->txn, DB_MPOOL_DIRTY, ppg)) != 0)
  -				goto err;
  -			have_lock = 1;
  -		}
  -		if ((ret = __bam_truncate_page(dbc, &page, NULL, 0)) != 0)
  -			break;
  -	}
  +	if (start.data != NULL)
  +		__os_free(env, start.data);
   
  -err:	if (page != NULL &&
  -	    (t_ret = __memp_fput( dbp->mpf,
  -	    dbc->thread_info, page, dbc->priority)) != 0 && ret == 0)
  -		ret = t_ret;
  -	if ((t_ret = __TLPUT(dbc, lock)) != 0 && ret == 0)
  +err:	if (opd != NULL && (t_ret = __dbc_close(opd)) != 0 && ret == 0)
   		ret = t_ret;
   	return (ret);
   }
  @@ -2434,16 +2018,11 @@
   	BINTERNAL *bi;
   	BOVERFLOW *bo;
   	DB *dbp;
  -	DBT orig;
  -	PAGE *page;
  -	db_pgno_t newpgno, *pgnop;
  -	int ret, t_ret;
  +	db_pgno_t *pgnop;
   
   	COMPQUIET(c_data, NULL);
   	COMPQUIET(bo, NULL);
  -	COMPQUIET(newpgno, PGNO_INVALID);
   	dbp = dbc->dbp;
  -	page = NULL;
   	if (TYPE(pg) == P_IBTREE) {
   		bi = GET_BINTERNAL(dbp, pg, indx);
   		if (B_TYPE(bi->type) == B_OVERFLOW) {
  @@ -2458,51 +2037,7 @@
   
   	DB_ASSERT(dbp->env, IS_DIRTY(pg));
   
  -	if ((ret = __memp_fget(dbp->mpf, pgnop,
  -	     dbc->thread_info, dbc->txn, 0, &page)) != 0)
  -		goto err;
  -
  -	/*
  -	 * If this is a multiply reference overflow key, then we will just
  -	 * copy it and decrement the reference count.  This is part of a
  -	 * fix to get rid of multiple references.
  -	 */
  -	if (TYPE(page) == P_OVERFLOW && OV_REF(page) > 1) {
  -		if ((ret = __db_ovref(dbc, bo->pgno)) != 0)
  -			goto err;
  -		memset(&orig, 0, sizeof(orig));
  -		if ((ret = __db_goff(dbc, &orig, bo->tlen, bo->pgno,
  -		    &orig.data, &orig.size)) == 0)
  -			ret = __db_poff(dbc, &orig, &newpgno);
  -		if (orig.data != NULL)
  -			__os_free(dbp->env, orig.data);
  -		if (ret != 0)
  -			goto err;
  -	} else {
  -		if ((ret = __bam_truncate_page(dbc, &page, NULL, 0)) != 0)
  -			goto err;
  -		newpgno = PGNO(page);
  -		/* If we could not allocate from the free list, give up.*/
  -		if (newpgno == *pgnop)
  -			goto err;
  -	}
  -
  -	/* Update the reference. */
  -	if (DBC_LOGGING(dbc)) {
  -		if ((ret = __bam_pgno_log(dbp,
  -		     dbc->txn, &LSN(pg), 0, PGNO(pg),
  -		     &LSN(pg), (u_int32_t)indx, *pgnop, newpgno)) != 0)
  -			goto err;
  -	} else
  -		LSN_NOT_LOGGED(LSN(pg));
  -
  -	*pgnop = newpgno;
  -
  -err:	if (page != NULL && (t_ret =
  -	      __memp_fput(dbp->mpf, dbc->thread_info,
  -		  page, dbc->priority)) != 0 && ret == 0)
  -		ret = t_ret;
  -	return (ret);
  +	return (__db_truncate_root(dbc, pg, indx, pgnop, bo->tlen));
   }
   
   /*
  @@ -2533,7 +2068,7 @@
   		if (bo->pgno > c_data->compact_truncate && (ret =
   		     __bam_truncate_root_page(dbc, page, indx, c_data)) != 0)
   			break;
  -		if ((ret = __bam_truncate_overflow(
  +		if ((ret = __db_truncate_overflow(
   		     dbc, bo->pgno, NULL, c_data)) != 0)
   			break;
   	}
  @@ -2710,7 +2245,7 @@
   		     sizeof(cp->recno), &start->data, &start->ulen));
   
   	}
  -	
  +
   	bi = GET_BINTERNAL(dbp, pg, NUM_ENT(pg) - 1);
   	data = bi->data;
   	len = bi->len;
  @@ -2782,28 +2317,35 @@
   }
   
   /*
  - * bam_truncate_internal --
  + * bam_truncate_ipages --
    *	Find high numbered pages in the internal nodes of a tree and
  - *	swap them.
  + *	swap them for lower numbered pages.
  + * PUBLIC:  int __bam_truncate_ipages __P((DB *,
  + * PUBLIC:    DB_THREAD_INFO *, DB_TXN *, DB_COMPACT *));
    */
  -static int
  -__bam_truncate_internal(dbp, ip, txn, c_data)
  +int
  +__bam_truncate_ipages(dbp, ip, txn, c_data)
   	DB *dbp;
   	DB_THREAD_INFO *ip;
   	DB_TXN *txn;
   	DB_COMPACT *c_data;
   {
  +	BTMETA *meta;
  +	BTREE *bt;
   	BTREE_CURSOR *cp;
   	DBC *dbc;
  +	DBMETA *dbmeta;
   	DBT start;
  -	DB_LOCK meta_lock;
  -	PAGE *pg;
  +	DB_LOCK meta_lock, root_lock;
  +	PAGE *pg, *root;
   	db_pgno_t pgno;
   	u_int32_t sflag;
   	int level, local_txn, ret, t_ret;
   
  +	COMPQUIET(pg, NULL);
   	dbc = NULL;
   	memset(&start, 0, sizeof(start));
  +	LOCK_INIT(root_lock);
   
   	if (IS_DB_AUTO_COMMIT(dbp, txn)) {
   		local_txn = 1;
  @@ -2814,6 +2356,9 @@
   	level = LEAFLEVEL + 1;
   	sflag = CS_READ | CS_GETRECNO;
   	LOCK_INIT(meta_lock);
  +	bt = dbp->bt_internal;
  +	meta = NULL;
  +	root = NULL;
   
   new_txn:
   	if (local_txn &&
  @@ -2828,14 +2373,16 @@
   	 * If the the root is a leaf we have nothing to do.
   	 * Searching an empty RECNO tree will return NOTFOUND below and loop.
   	 */
  -	if ((ret = __memp_fget(dbp->mpf, &cp->root, ip, txn, 0, &pg)) != 0)
  +	pgno = PGNO_INVALID;
  +	BAM_GET_ROOT(dbc, pgno, root, 0, DB_LOCK_READ, root_lock, ret);
  +	if (ret != 0)
   		goto err;
  -	if (LEVEL(pg) == LEAFLEVEL) {
  -		ret = __memp_fput(dbp->mpf, ip, pg, dbp->priority);
  +
  +	if (LEVEL(root) == LEAFLEVEL)
   		goto err;
  -	}
  -	if ((ret = __memp_fput(dbp->mpf, ip, pg, dbp->priority)) != 0)
  +	if ((ret = __memp_fput(dbp->mpf, ip, root, dbp->priority)) != 0)
   		goto err;
  +	root = NULL;
   
   	pgno = PGNO_INVALID;
   	do {
  @@ -2858,16 +2405,16 @@
   
   		sflag = CS_NEXT | CS_GETRECNO;
   		/* Grab info about the page and drop the stack. */
  -		if (pgno != cp->root && (ret = __bam_savekey(dbc,
  +		if (pgno != BAM_ROOT_PGNO(dbc) && (ret = __bam_savekey(dbc,
   		    pgno <= c_data->compact_truncate, &start)) != 0) {
  -		    	if (ret == DB_LOCK_NOTGRANTED)
  +			if (ret == DB_LOCK_NOTGRANTED)
   				continue;
   			goto err;
   		}
   
   		if ((ret = __bam_stkrel(dbc, STK_NOLOCK)) != 0)
   			goto err;
  -		if (pgno == cp->root)
  +		if (pgno == BAM_ROOT_PGNO(dbc))
   			break;
   
   		if (pgno <= c_data->compact_truncate)
  @@ -2886,27 +2433,27 @@
   			}
   			goto err;
   		}
  -		pg = cp->csp->page;
  -		pgno = PGNO(pg);
  +		pgno = PGNO(cp->csp->page);
   
   		if (pgno > c_data->compact_truncate) {
  -			if ((ret = __bam_truncate_page(dbc, &pg, NULL, 1)) != 0)
  +			if ((ret = __db_exchange_page(dbc, &cp->csp->page,
  +			    NULL, PGNO_INVALID, DB_EXCH_DEFAULT)) != 0)
   				goto err;
  -			if (pgno == PGNO(pg)) {
  -				/* We could not allocate.  Give up. */
  -				pgno = cp->root;
  -			}
   		}
   
  +		pg = cp->csp->page;
   		if ((ret = __bam_stkrel(dbc,
  -		     pgno > c_data->compact_truncate ? 0 : STK_NOLOCK)) != 0)
  +		     pgno != PGNO(pg) ? 0 : STK_NOLOCK)) != 0)
   			goto err;
   
   		/* We are locking subtrees, so drop the write locks asap. */
  -		if (local_txn && pgno > c_data->compact_truncate)
  +		if (local_txn && pgno != PGNO(pg))
   			break;
  -	} while (pgno != cp->root);
  +		/* We really break from the loop above on this condition. */
  +	} while (pgno != BAM_ROOT_PGNO(dbc));
   
  +	if ((ret = __LPUT(dbc, root_lock)) != 0)
  +		goto err;
   	if ((ret = __dbc_close(dbc)) != 0)
   		goto err;
   	dbc = NULL;
  @@ -2916,16 +2463,122 @@
   		txn = NULL;
   		LOCK_INIT(meta_lock);
   	}
  -	if (pgno != ((BTREE *)dbp->bt_internal)->bt_root)
  +	if (pgno != bt->bt_root)
   		goto new_txn;
   
  +	/*
  +	 * Attempt to move the subdatabase metadata and/or root pages.
  +	 * Grab the metadata page and verify the revision, if its out
  +	 * of date reopen and try again.
  +	 */
  +again:	if (F_ISSET(dbp, DB_AM_SUBDB) &&
  +	    (bt->bt_root > c_data->compact_truncate ||
  +	    bt->bt_meta > c_data->compact_truncate)) {
  +		if (local_txn &&
  +		    (ret = __txn_begin(dbp->env, ip, NULL, &txn, 0)) != 0)
  +			goto err;
  +		if ((ret = __db_cursor(dbp, ip, txn, &dbc, 0)) != 0)
  +			goto err;
  +		if ((ret = __db_lget(dbc,
  +		     0, bt->bt_meta, DB_LOCK_WRITE, 0, &meta_lock)) != 0)
  +			goto err;
  +		if ((ret = __memp_fget(dbp->mpf, &bt->bt_meta,
  +		     dbc->thread_info, dbc->txn, DB_MPOOL_DIRTY, &meta)) != 0)
  +			goto err;
  +		if (bt->revision != dbp->mpf->mfp->revision) {
  +			if ((ret = __memp_fput(dbp->mpf,
  +			    ip, meta, dbp->priority)) != 0)
  +				goto err;
  +			meta = NULL;
  +			if (local_txn) {
  +				if ((ret = __dbc_close(dbc)) != 0)
  +					goto err;
  +				if ((ret = __txn_abort(txn)) != 0)
  +					goto err;
  +			} else {
  +				if ((ret = __LPUT(dbc, meta_lock)) != 0)
  +					goto err;
  +			}
  +			if ((ret = __db_reopen(dbc)) != 0)
  +				goto err;
  +			goto again;
  +		}
  +		if (PGNO(meta) > c_data->compact_truncate) {
  +			dbmeta = (DBMETA *)meta;
  +			if ((ret = __db_move_metadata(dbc,
  +			    &dbmeta, c_data)) != 0)
  +				goto err;
  +			meta = (BTMETA *)dbmeta;
  +		}
  +		if (bt->bt_root > c_data->compact_truncate) {
  +			if ((ret = __db_lget(dbc, 0,
  +			   bt->bt_root, DB_LOCK_WRITE, 0, &root_lock)) != 0)
  +				goto err;
  +			if ((ret = __memp_fget(dbp->mpf,
  +			     &bt->bt_root, dbc->thread_info,
  +			     dbc->txn, DB_MPOOL_DIRTY, &root)) != 0)
  +				goto err;
  +			c_data->compact_pages_examine++;
  +			/*
  +			 * Bump the revision first since any reader will be
  +			 * blocked on the latch on the old page.  That latch
  +			 * will get dropped when we free the page and the
  +			 * reader will do a __db_reopen and wait till the meta
  +			 * page latch is released.
  +			 */
  +			++dbp->mpf->mfp->revision;
  +			if ((ret = __db_exchange_page(dbc,
  +			    &root, NULL, PGNO_INVALID, DB_EXCH_FREE)) != 0)
  +				goto err;
  +			if (PGNO(root) == bt->bt_root)
  +				goto err;
  +			if (DBC_LOGGING(dbc)) {
  +				if ((ret =
  +				    __bam_root_log(dbp, txn, &LSN(meta), 0,
  +				    PGNO(meta), PGNO(root), &LSN(meta))) != 0)
  +					goto err;
  +			} else
  +				LSN_NOT_LOGGED(LSN(meta));
  +			bt->bt_root = meta->root = PGNO(root);
  +			bt->revision = dbp->mpf->mfp->revision;
  +			if ((ret = __memp_fput(dbp->mpf,
  +			    ip, root, dbp->priority)) != 0)
  +				goto err;
  +			root = NULL;
  +			if (txn == NULL && (ret = __LPUT(dbc, root_lock)) != 0)
  +				goto err;
  +
  +		}
  +		if ((ret = __memp_fput(dbp->mpf, ip, meta, dbp->priority)) != 0)
  +			goto err;
  +		meta = NULL;
  +		if ((ret = __dbc_close(dbc)) != 0)
  +			goto err;
  +		dbc = NULL;
  +		if (local_txn) {
  +			ret = __txn_commit(txn, DB_TXN_NOSYNC);
  +			txn = NULL;
  +			LOCK_INIT(meta_lock);
  +			LOCK_INIT(root_lock);
  +		}
  +	}
  +
   err:	if (txn != NULL && ret != 0)
   		sflag = STK_PGONLY;
   	else
   		sflag = 0;
  -	if (txn == NULL)
  +	if (txn == NULL) {
   		if ((t_ret = __LPUT(dbc, meta_lock)) != 0 && ret == 0)
   			ret = t_ret;
  +		if ((t_ret = __LPUT(dbc, root_lock)) != 0 && ret == 0)
  +			ret = t_ret;
  +	}
  +	if (meta != NULL && (t_ret = __memp_fput(dbp->mpf,
  +	    ip, meta, dbp->priority)) != 0 && ret == 0)
  +		ret = t_ret;
  +	if (root != NULL && (t_ret = __memp_fput(dbp->mpf,
  +	    ip, root, dbp->priority)) != 0 && ret == 0)
  +		ret = t_ret;
   	if (dbc != NULL && (t_ret = __bam_stkrel(dbc, sflag)) != 0 && ret == 0)
   		ret = t_ret;
   	if (dbc != NULL && (t_ret = __dbc_close(dbc)) != 0 && ret == 0)
  @@ -2938,81 +2591,4 @@
   	return (ret);
   }
   
  -static int
  -__bam_setup_freelist(dbp, list, nelems)
  -	DB *dbp;
  -	db_pglist_t *list;
  -	u_int32_t nelems;
  -{
  -	DB_MPOOLFILE *mpf;
  -	db_pgno_t *plist;
  -	int ret;
  -
  -	mpf = dbp->mpf;
  -
  -	if ((ret = __memp_alloc_freelist(mpf, nelems, &plist)) != 0)
  -		return (ret);
  -
  -	while (nelems-- != 0)
  -		*plist++ = list++->pgno;
  -
  -	return (0);
  -}
  -
  -static int
  -__bam_free_freelist(dbp, ip, txn)
  -	DB *dbp;
  -	DB_THREAD_INFO *ip;
  -	DB_TXN *txn;
  -{
  -	DBC *dbc;
  -	DB_LOCK lock;
  -	int auto_commit, ret, t_ret;
  -
  -	LOCK_INIT(lock);
  -	auto_commit = ret = 0;
  -
  -	/*
  -	 * If we are not in a transaction then we need to get
  -	 * a lock on the meta page, otherwise we should already
  -	 * have the lock.
  -	 */
  -
  -	dbc = NULL;
  -	if (IS_DB_AUTO_COMMIT(dbp, txn)) {
  -		/*
  -		 * We must not timeout the lock or we will not free the list.
  -		 * We ignore errors from txn_begin as there is little that
  -		 * the application can do with the error and we want to
  -		 * get the lock and free the list if at all possible.
  -		 */
  -		if (__txn_begin(dbp->env, ip, NULL, &txn, 0) == 0) {
  -			(void)__lock_set_timeout(dbp->env,
  -			    txn->locker, 0, DB_SET_TXN_TIMEOUT);
  -			(void)__lock_set_timeout(dbp->env,
  -			    txn->locker, 0, DB_SET_LOCK_TIMEOUT);
  -			auto_commit = 1;
  -		}
  -		/* Get a cursor so we can call __db_lget. */
  -		if ((ret = __db_cursor(dbp, ip, txn, &dbc, 0)) != 0)
  -			return (ret);
  -
  -		if ((ret = __db_lget(dbc,
  -		     0, PGNO_BASE_MD, DB_LOCK_WRITE, 0, &lock)) != 0)
  -			goto err;
  -	}
  -
  -	ret = __memp_free_freelist(dbp->mpf);
  -
  -err:	if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0)
  -		ret = t_ret;
  -
  -	if (dbc != NULL && (t_ret = __dbc_close(dbc)) != 0 && ret == 0)
  -		ret = t_ret;
  -
  -	if (auto_commit && __txn_abort(txn) != 0 && ret == 0)
  -		ret = t_ret;
  -
  -	return (ret);
  -}
   #endif
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_compare.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_compare.c
  --- db/btree/bt_compare.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_compare.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_conv.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_conv.c
  --- db/btree/bt_conv.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_conv.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_curadj.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_curadj.c
  --- db/btree/bt_curadj.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_curadj.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -14,6 +14,22 @@
   #include "dbinc/mp.h"
   
   static int __bam_opd_cursor __P((DB *, DBC *, db_pgno_t, u_int32_t, u_int32_t));
  +static int __bam_ca_delete_func
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
  +static int __ram_ca_delete_func
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
  +static int __bam_ca_di_func
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
  +static int __bam_ca_dup_func
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
  +static int __bam_ca_undodup_func
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
  +static int __bam_ca_rsplit_func
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
  +static int __bam_ca_split_func
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
  +static int __bam_ca_undosplit_func
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
   
   /*
    * Cursor adjustments are logged if they are for subtransactions.  This is
  @@ -26,27 +42,89 @@
    * locker IDs, and so cannot be affected by adjustments in this transaction.
    */
   
  + /*
  +  * __bam_ca_delete_func
  +  *	Callback function for walking cursors to update them due to a delete.
  +  */
  + static int
  + __bam_ca_delete_func(dbc, my_dbc, countp, pgno, indx, args)
  +	DBC *dbc, *my_dbc;
  +	u_int32_t *countp;
  +	db_pgno_t pgno;
  +	u_int32_t indx;
  +	void *args;
  +{
  +	BTREE_CURSOR *cp;
  +	u_int32_t del;
  +
  +	COMPQUIET(my_dbc, NULL);
  +	del = *(u_int32_t *)args;
  +
  +	cp = (BTREE_CURSOR *)dbc->internal;
  +	if (cp->pgno == pgno && cp->indx == indx &&
  +	    !MVCC_SKIP_CURADJ(dbc, pgno)) {
  +		/*
  +		 * [#8032] This assert is checking for possible race
  +		 * conditions where we hold a cursor position without
  +		 * a lock.  Unfortunately, there are paths in the
  +		 * Btree code that do not satisfy these conditions.
  +		 * None of them are known to be a problem, but this
  +		 * assert should be re-activated when the Btree stack
  +		 * code is re-written.
  +		DB_ASSERT(env, !STD_LOCKING(dbc) ||
  +		    cp->lock_mode != DB_LOCK_NG);
  +		 */
  +		if (del) {
  +			F_SET(cp, C_DELETED);
  +			/*
  +			 * If we're deleting the item, we can't
  +			 * keep a streaming offset cached.
  +			 */
  +			cp->stream_start_pgno = PGNO_INVALID;
  +		} else
  +			F_CLR(cp, C_DELETED);
  +
  +#ifdef HAVE_COMPRESSION
  +		/*
  +		 * We also set the C_COMPRESS_MODIFIED flag, which
  +		 * prompts the compression code to look for it's
  +		 * current entry again if it needs to.
  +		 *
  +		 * The flag isn't cleared, because the compression
  +		 * code still needs to do that even for an entry that
  +		 * becomes undeleted.
  +		 *
  +		 * This flag also needs to be set if an entry is
  +		 * updated, but since the compression code always
  +		 * deletes before an update, setting it here is
  +		 * sufficient.
  +		 */
  +		F_SET(cp, C_COMPRESS_MODIFIED);
  +#endif
  +
  +		++(*countp);
  +	}
  +	return (0);
  +}
  +
   /*
    * __bam_ca_delete --
    *	Update the cursors when items are deleted and when already deleted
    *	items are overwritten.  Return the number of relevant cursors found.
    *
  - * PUBLIC: int __bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int, int *));
  + * PUBLIC: int __bam_ca_delete __P((DB *,
  + * PUBLIC:     db_pgno_t, u_int32_t, int, u_int32_t *));
    */
   int
  -__bam_ca_delete(dbp, pgno, indx, delete, countp)
  +__bam_ca_delete(dbp, pgno, indx, del, countp)
   	DB *dbp;
   	db_pgno_t pgno;
   	u_int32_t indx;
  -	int delete, *countp;
  +	int del;
  +	u_int32_t *countp;
   {
  -	BTREE_CURSOR *cp;
  -	DB *ldbp;
  -	DBC *dbc;
  -	ENV *env;
  -	int count;		/* !!!: Has to contain max number of cursors. */
  -
  -	env = dbp->env;
  +	int ret;
  +	u_int32_t count;
   
   	/*
   	 * Adjust the cursors.  We have the page write locked, so the
  @@ -59,111 +137,91 @@
   	 * Each cursor is single-threaded, so we only need to lock the
   	 * list of DBs and then the list of cursors in each DB.
   	 */
  -	MUTEX_LOCK(env, env->mtx_dblist);
  -	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -	for (count = 0;
  -	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -		MUTEX_LOCK(env, dbp->mutex);
  -		TAILQ_FOREACH(dbc, &ldbp->active_queue, links) {
  -			cp = (BTREE_CURSOR *)dbc->internal;
  -			if (cp->pgno == pgno && cp->indx == indx &&
  -			    !MVCC_SKIP_CURADJ(dbc, pgno)) {
  -				/*
  -				 * [#8032] This assert is checking
  -				 * for possible race conditions where we
  -				 * hold a cursor position without a lock.
  -				 * Unfortunately, there are paths in the
  -				 * Btree code that do not satisfy these
  -				 * conditions. None of them are known to
  -				 * be a problem, but this assert should
  -				 * be re-activated when the Btree stack
  -				 * code is re-written.
  -				DB_ASSERT(env, !STD_LOCKING(dbc) ||
  -				    cp->lock_mode != DB_LOCK_NG);
  -				 */
  -				if (delete) {
  -					F_SET(cp, C_DELETED);
  -					/*
  -					 * If we're deleting the item, we can't
  -					 * keep a streaming offset cached.
  -					 */
  -					cp->stream_start_pgno = PGNO_INVALID;
  -				} else
  -					F_CLR(cp, C_DELETED);
  -
  -#ifdef HAVE_COMPRESSION
  -				/*
  -				 * We also set the C_COMPRESS_MODIFIED flag,
  -				 * which prompts the compression code to look
  -				 * for it's current entry again if it needs to.
  -				 *
  -				 * The flag isn't cleared, because the
  -				 * compression code still needs to do that even
  -				 * for an entry that becomes undeleted.
  -				 *
  -				 * This flag also needs to be set if an entry is
  -				 * updated, but since the compression code
  -				 * always deletes before an update, setting it
  -				 * here is sufficient.
  -				 */
  -				F_SET(cp, C_COMPRESS_MODIFIED);
  -#endif
  -
  -				++count;
  -			}
  -		}
  -		MUTEX_UNLOCK(env, dbp->mutex);
  -	}
  -	MUTEX_UNLOCK(env, env->mtx_dblist);
  +	if ((ret = __db_walk_cursors(dbp, NULL,
  +	    __bam_ca_delete_func, &count, pgno, indx, &del)) != 0)
  +		return (ret);
   
   	if (countp != NULL)
   		*countp = count;
   	return (0);
   }
   
  +static int
  +__ram_ca_delete_func(dbc, my_dbc, countp, root_pgno, indx, args)
  +	DBC *dbc, *my_dbc;
  +	u_int32_t *countp;
  +	db_pgno_t root_pgno;
  +	u_int32_t indx;
  +	void *args;
  +{
  +	COMPQUIET(indx, 0);
  +	COMPQUIET(my_dbc, NULL);
  +	COMPQUIET(args, NULL);
  +
  +	if (dbc->internal->root == root_pgno &&
  +	    !MVCC_SKIP_CURADJ(dbc, root_pgno)) {
  +		(*countp)++;
  +		return (EEXIST);
  +	}
  +	return (0);
  +}
  +
   /*
    * __ram_ca_delete --
    *	Return if any relevant cursors found.
    *
  - * PUBLIC: int __ram_ca_delete __P((DB *, db_pgno_t, int *));
  + * PUBLIC: int __ram_ca_delete __P((DB *, db_pgno_t, u_int32_t *));
    */
   int
   __ram_ca_delete(dbp, root_pgno, foundp)
   	DB *dbp;
   	db_pgno_t root_pgno;
  -	int *foundp;
  +	u_int32_t *foundp;
   {
  -	DB *ldbp;
  -	DBC *dbc;
  -	ENV *env;
  -	int found;
  -
  -	env = dbp->env;
  +	int ret;
   
  -	/*
  -	 * Review the cursors.  See the comment in __bam_ca_delete().
  -	 */
  -	MUTEX_LOCK(env, env->mtx_dblist);
  -	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -	for (found = 0;
  -	    found == 0 && ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -		MUTEX_LOCK(env, dbp->mutex);
  -		TAILQ_FOREACH(dbc, &ldbp->active_queue, links)
  -			if (dbc->internal->root == root_pgno &&
  -			    !MVCC_SKIP_CURADJ(dbc, root_pgno)) {
  -				found = 1;
  -				break;
  -			}
  -		MUTEX_UNLOCK(env, dbp->mutex);
  -	}
  -	MUTEX_UNLOCK(env, env->mtx_dblist);
  +	if ((ret = __db_walk_cursors(dbp, NULL, __ram_ca_delete_func,
  +	    foundp, root_pgno, 0, NULL)) != 0 && ret != EEXIST)
  +		return (ret);
   
  -	*foundp = found;
   	return (0);
   }
   
  +struct __bam_ca_di_args {
  +	int adjust;
  +	DB_TXN *my_txn;
  +};
  +
  +static int
  +__bam_ca_di_func(dbc, my_dbc, foundp, pgno, indx, vargs)
  +	DBC *dbc, *my_dbc;
  +	u_int32_t *foundp;
  +	db_pgno_t pgno;
  +	u_int32_t indx;
  +	void *vargs;
  +{
  +	DBC_INTERNAL *cp;
  +	struct __bam_ca_di_args *args;
  +
  +	if (dbc->dbtype == DB_RECNO)
  +		return (0);
  +
  +	cp = dbc->internal;
  +	args = vargs;
  +	if (cp->pgno == pgno && cp->indx >= indx &&
  +	    (dbc == my_dbc || !MVCC_SKIP_CURADJ(dbc, pgno))) {
  +		/* Cursor indices should never be negative. */
  +		DB_ASSERT(dbc->dbp->env, cp->indx != 0 || args->adjust > 0);
  +		/* [#8032]
  +		DB_ASSERT(env, !STD_LOCKING(dbc) ||
  +		    cp->lock_mode != DB_LOCK_NG);
  +		*/
  +		cp->indx += args->adjust;
  +		if (args->my_txn != NULL && args->my_txn != dbc->txn)
  +			*foundp = 1;
  +	}
  +	return (0);
  +}
   /*
    * __bam_ca_di --
    *	Adjust the cursors during a delete or insert.
  @@ -177,48 +235,22 @@
   	u_int32_t indx;
   	int adjust;
   {
  -	DB *dbp, *ldbp;
  -	DBC *dbc;
  -	DBC_INTERNAL *cp;
  +	DB *dbp;
   	DB_LSN lsn;
  -	DB_TXN *my_txn;
  -	ENV *env;
  -	int found, ret;
  +	int ret;
  +	u_int32_t found;
  +	struct __bam_ca_di_args args;
   
   	dbp = my_dbc->dbp;
  -	env = dbp->env;
  -
  -	my_txn = IS_SUBTRANSACTION(my_dbc->txn) ? my_dbc->txn : NULL;
  +	args.adjust = adjust;
  +	args.my_txn = IS_SUBTRANSACTION(my_dbc->txn) ? my_dbc->txn : NULL;
   
   	/*
   	 * Adjust the cursors.  See the comment in __bam_ca_delete().
   	 */
  -	MUTEX_LOCK(env, env->mtx_dblist);
  -	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -	for (found = 0;
  -	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -		MUTEX_LOCK(env, dbp->mutex);
  -		TAILQ_FOREACH(dbc, &ldbp->active_queue, links) {
  -			if (dbc->dbtype == DB_RECNO)
  -				continue;
  -			cp = dbc->internal;
  -			if (cp->pgno == pgno && cp->indx >= indx &&
  -			    (dbc == my_dbc || !MVCC_SKIP_CURADJ(dbc, pgno))) {
  -				/* Cursor indices should never be negative. */
  -				DB_ASSERT(env, cp->indx != 0 || adjust > 0);
  -				/* [#8032]
  -				DB_ASSERT(env, !STD_LOCKING(dbc) ||
  -				    cp->lock_mode != DB_LOCK_NG);
  -				*/
  -				cp->indx += adjust;
  -				if (my_txn != NULL && dbc->txn != my_txn)
  -					found = 1;
  -			}
  -		}
  -		MUTEX_UNLOCK(env, dbp->mutex);
  -	}
  -	MUTEX_UNLOCK(env, env->mtx_dblist);
  +	if ((ret = __db_walk_cursors(dbp, my_dbc, __bam_ca_di_func,
  +	    &found, pgno, indx, &args)) != 0)
  +		return (ret);
   
   	if (found != 0 && DBC_LOGGING(my_dbc)) {
   		if ((ret = __bam_curadj_log(dbp, my_dbc->txn, &lsn, 0,
  @@ -287,6 +319,57 @@
   	return (0);
   }
   
  +struct __bam_ca_dup_args {
  +	db_pgno_t tpgno;
  +	db_indx_t first, ti;
  +	DB_TXN *my_txn;
  +};
  +
  +static int
  +__bam_ca_dup_func(dbc, my_dbc, foundp, fpgno, fi, vargs)
  +	DBC *dbc;
  +	DBC *my_dbc;
  +	u_int32_t *foundp;
  +	db_pgno_t fpgno;
  +	u_int32_t fi;
  +	void *vargs;
  +{
  +	BTREE_CURSOR *orig_cp;
  +	DB *dbp;
  +	int ret;
  +	struct __bam_ca_dup_args *args;
  +
  +	COMPQUIET(my_dbc, NULL);
  +
  +	/*
  +	 * Since we rescan the list see if this is already
  +	 * converted.
  +	 */
  +	orig_cp = (BTREE_CURSOR *)dbc->internal;
  +	if (orig_cp->opd != NULL)
  +		return (0);
  +
  +	/* Find cursors pointing to this record. */
  +	if (orig_cp->pgno != fpgno || orig_cp->indx != fi ||
  +	    MVCC_SKIP_CURADJ(dbc, fpgno))
  +		return (0);
  +
  +	dbp = dbc->dbp;
  +	args = vargs;
  +
  +	MUTEX_UNLOCK(dbp->env, dbp->mutex);
  +
  +	if ((ret = __bam_opd_cursor(dbp,
  +	    dbc, args->first, args->tpgno, args->ti)) != 0) {
  +		MUTEX_LOCK(dbp->env, dbp->mutex);
  +		return (ret);
  +	}
  +	if (args->my_txn != NULL && args->my_txn != dbc->txn)
  +		*foundp = 1;
  +	/* We released the mutex to get a cursor, start over. */
  +	return (DB_LOCK_NOTGRANTED);
  +}
  +
   /*
    * __bam_ca_dup --
    *	Adjust the cursors when moving items from a leaf page to a duplicates
  @@ -301,58 +384,22 @@
   	db_pgno_t fpgno, tpgno;
   	u_int32_t first, fi, ti;
   {
  -	BTREE_CURSOR *orig_cp;
  -	DB *dbp, *ldbp;
  -	DBC *dbc;
  +	DB *dbp;
   	DB_LSN lsn;
  -	DB_TXN *my_txn;
  -	ENV *env;
  -	int found, ret, t_ret;
  +	int ret, t_ret;
  +	u_int32_t found;
  +	struct __bam_ca_dup_args args;
   
   	dbp = my_dbc->dbp;
  -	env = dbp->env;
  -	my_txn = IS_SUBTRANSACTION(my_dbc->txn) ? my_dbc->txn : NULL;
  -	ret = 0;
  -
  -	/*
  -	 * Adjust the cursors.  See the comment in __bam_ca_delete().
  -	 */
  -	MUTEX_LOCK(env, env->mtx_dblist);
  -	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -	for (found = 0;
  -	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -loop:		MUTEX_LOCK(env, dbp->mutex);
  -		TAILQ_FOREACH(dbc, &ldbp->active_queue, links) {
  -			/* Find cursors pointing to this record. */
  -			orig_cp = (BTREE_CURSOR *)dbc->internal;
  -			if (orig_cp->pgno != fpgno || orig_cp->indx != fi ||
  -			    MVCC_SKIP_CURADJ(dbc, fpgno))
  -				continue;
   
  -			/*
  -			 * Since we rescan the list see if this is already
  -			 * converted.
  -			 */
  -			if (orig_cp->opd != NULL)
  -				continue;
  +	args.first = first;
  +	args.tpgno = tpgno;
  +	args.ti = ti;
  +	args.my_txn = IS_SUBTRANSACTION(my_dbc->txn) ? my_dbc->txn : NULL;
   
  -			MUTEX_UNLOCK(env, dbp->mutex);
  -			/* [#8032]
  -			DB_ASSERT(env, !STD_LOCKING(dbc) ||
  -			    orig_cp->lock_mode != DB_LOCK_NG);
  -			*/
  -			if ((ret = __bam_opd_cursor(dbp,
  -			    dbc, first, tpgno, ti)) != 0)
  -				goto err;
  -			if (my_txn != NULL && dbc->txn != my_txn)
  -				found = 1;
  -			/* We released the mutex to get a cursor, start over. */
  -			goto loop;
  -		}
  -		MUTEX_UNLOCK(env, dbp->mutex);
  -	}
  -err:	MUTEX_UNLOCK(env, env->mtx_dblist);
  +	if ((ret = __db_walk_cursors(dbp,
  +	    my_dbc, __bam_ca_dup_func, &found, fpgno, fi, &args)) != 0)
  +		return (ret);
   
   	if (found != 0 && DBC_LOGGING(my_dbc)) {
   		if ((t_ret = __bam_curadj_log(dbp, my_dbc->txn,
  @@ -364,6 +411,53 @@
   	return (ret);
   }
   
  +static int
  +__bam_ca_undodup_func(dbc, my_dbc, countp, fpgno, fi, vargs)
  +	DBC *dbc;
  +	DBC *my_dbc;
  +	u_int32_t *countp;
  +	db_pgno_t fpgno;
  +	u_int32_t fi;
  +	void *vargs;
  +{
  +	BTREE_CURSOR *orig_cp;
  +	DB *dbp;
  +	int ret;
  +	struct __bam_ca_dup_args *args;
  +
  +	COMPQUIET(my_dbc, NULL);
  +	COMPQUIET(countp, NULL);
  +
  +	orig_cp = (BTREE_CURSOR *)dbc->internal;
  +	dbp = dbc->dbp;
  +	args = vargs;
  +	/*
  +	 * A note on the orig_cp->opd != NULL requirement here:
  +	 * it's possible that there's a cursor that refers to
  +	 * the same duplicate set, but which has no opd cursor,
  +	 * because it refers to a different item and we took
  +	 * care of it while processing a previous record.
  +	 */
  +	if (orig_cp->pgno != fpgno ||
  +	    orig_cp->indx != args->first ||
  +	    orig_cp->opd == NULL || ((BTREE_CURSOR *)
  +	    orig_cp->opd->internal)->indx != args->ti ||
  +	    MVCC_SKIP_CURADJ(dbc, fpgno))
  +		return (0);
  +	MUTEX_UNLOCK(dbp->env, dbp->mutex);
  +	if ((ret = __dbc_close(orig_cp->opd)) != 0) {
  +		MUTEX_LOCK(dbp->env, dbp->mutex);
  +		return (ret);
  +	}
  +	orig_cp->opd = NULL;
  +	orig_cp->indx = fi;
  +	/*
  +	 * We released the mutex to free a cursor,
  +	 * start over.
  +	 */
  +	return (DB_LOCK_NOTGRANTED);
  +}
  +
   /*
    * __bam_ca_undodup --
    *	Adjust the cursors when returning items to a leaf page
  @@ -379,56 +473,44 @@
   	db_pgno_t fpgno;
   	u_int32_t first, fi, ti;
   {
  -	BTREE_CURSOR *orig_cp;
  -	DB *ldbp;
  +	u_int32_t count;
  +	struct __bam_ca_dup_args args;
  +
  +	args.first = first;
  +	args.ti = ti;
  +	return (__db_walk_cursors(dbp, NULL,
  +	    __bam_ca_undodup_func, &count, fpgno, fi, &args));
  +
  +}
  +
  +static int
  +__bam_ca_rsplit_func(dbc, my_dbc, foundp, fpgno, indx, args)
   	DBC *dbc;
  -	ENV *env;
  -	int ret;
  +	DBC *my_dbc;
  +	u_int32_t *foundp;
  +	db_pgno_t fpgno;
  +	u_int32_t indx;
  +	void *args;
  +{
  +	db_pgno_t tpgno;
   
  -	env = dbp->env;
  -	ret = 0;
  +	COMPQUIET(indx, 0);
   
  -	/*
  -	 * Adjust the cursors.  See the comment in __bam_ca_delete().
  -	 */
  -	MUTEX_LOCK(env, env->mtx_dblist);
  -	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -	for (;
  -	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -loop:		MUTEX_LOCK(env, dbp->mutex);
  -		TAILQ_FOREACH(dbc, &ldbp->active_queue, links) {
  -			orig_cp = (BTREE_CURSOR *)dbc->internal;
  +	if (dbc->dbtype == DB_RECNO)
  +		return (0);
   
  -			/*
  -			 * A note on the orig_cp->opd != NULL requirement here:
  -			 * it's possible that there's a cursor that refers to
  -			 * the same duplicate set, but which has no opd cursor,
  -			 * because it refers to a different item and we took
  -			 * care of it while processing a previous record.
  -			 */
  -			if (orig_cp->pgno != fpgno ||
  -			    orig_cp->indx != first ||
  -			    orig_cp->opd == NULL || ((BTREE_CURSOR *)
  -			    orig_cp->opd->internal)->indx != ti ||
  -			    MVCC_SKIP_CURADJ(dbc, fpgno))
  -				continue;
  -			MUTEX_UNLOCK(env, dbp->mutex);
  -			if ((ret = __dbc_close(orig_cp->opd)) != 0)
  -				goto err;
  -			orig_cp->opd = NULL;
  -			orig_cp->indx = fi;
  -			/*
  -			 * We released the mutex to free a cursor,
  -			 * start over.
  -			 */
  -			goto loop;
  -		}
  -		MUTEX_UNLOCK(env, dbp->mutex);
  +	tpgno = *(db_pgno_t *)args;
  +	if (dbc->internal->pgno == fpgno &&
  +	    !MVCC_SKIP_CURADJ(dbc, fpgno)) {
  +		dbc->internal->pgno = tpgno;
  +		/* [#8032]
  +		DB_ASSERT(env, !STD_LOCKING(dbc) ||
  +		    dbc->internal->lock_mode != DB_LOCK_NG);
  +		*/
  +		if (IS_SUBTRANSACTION(my_dbc->txn) && dbc->txn != my_dbc->txn)
  +			*foundp = 1;
   	}
  -err:	MUTEX_UNLOCK(env, env->mtx_dblist);
  -
  -	return (ret);
  +	return (0);
   }
   
   /*
  @@ -442,43 +524,16 @@
   	DBC* my_dbc;
   	db_pgno_t fpgno, tpgno;
   {
  -	DB *dbp, *ldbp;
  -	DBC *dbc;
  +	DB *dbp;
   	DB_LSN lsn;
  -	DB_TXN *my_txn;
  -	ENV *env;
  -	int found, ret;
  +	int ret;
  +	u_int32_t found;
   
   	dbp = my_dbc->dbp;
  -	env = dbp->env;
  -	my_txn = IS_SUBTRANSACTION(my_dbc->txn) ? my_dbc->txn : NULL;
   
  -	/*
  -	 * Adjust the cursors.  See the comment in __bam_ca_delete().
  -	 */
  -	MUTEX_LOCK(env, env->mtx_dblist);
  -	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -	for (found = 0;
  -	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -		MUTEX_LOCK(env, dbp->mutex);
  -		TAILQ_FOREACH(dbc, &ldbp->active_queue, links) {
  -			if (dbc->dbtype == DB_RECNO)
  -				continue;
  -			if (dbc->internal->pgno == fpgno &&
  -			    !MVCC_SKIP_CURADJ(dbc, fpgno)) {
  -				dbc->internal->pgno = tpgno;
  -				/* [#8032]
  -				DB_ASSERT(env, !STD_LOCKING(dbc) ||
  -				    dbc->internal->lock_mode != DB_LOCK_NG);
  -				*/
  -				if (my_txn != NULL && dbc->txn != my_txn)
  -					found = 1;
  -			}
  -		}
  -		MUTEX_UNLOCK(env, dbp->mutex);
  -	}
  -	MUTEX_UNLOCK(env, env->mtx_dblist);
  +	if ((ret = __db_walk_cursors(dbp, my_dbc,
  +	    __bam_ca_rsplit_func, &found, fpgno, 0, &tpgno)) != 0)
  +		return (ret);
   
   	if (found != 0 && DBC_LOGGING(my_dbc)) {
   		if ((ret = __bam_curadj_log(dbp, my_dbc->txn,
  @@ -488,6 +543,49 @@
   	return (0);
   }
   
  +struct __bam_ca_split_args {
  +	db_pgno_t lpgno, rpgno;
  +	int cleft;
  +	DB_TXN *my_txn;
  +};
  +
  +static int
  +__bam_ca_split_func(dbc, my_dbc, foundp, ppgno, split_indx, vargs)
  +	DBC *dbc;
  +	DBC *my_dbc;
  +	u_int32_t *foundp;
  +	db_pgno_t ppgno;
  +	u_int32_t split_indx;
  +	void *vargs;
  +{
  +	DBC_INTERNAL *cp;
  +	struct __bam_ca_split_args *args;
  +
  +	COMPQUIET(my_dbc, NULL);
  +
  +	if (dbc->dbtype == DB_RECNO)
  +		return (0);
  +	cp = dbc->internal;
  +	args = vargs;
  +	if (cp->pgno == ppgno &&
  +	    !MVCC_SKIP_CURADJ(dbc, ppgno)) {
  +		/* [#8032]
  +		DB_ASSERT(env, !STD_LOCKING(dbc) ||
  +		    cp->lock_mode != DB_LOCK_NG);
  +		*/
  +		if (args->my_txn != NULL && args->my_txn != dbc->txn)
  +			*foundp = 1;
  +		if (cp->indx < split_indx) {
  +			if (args->cleft)
  +				cp->pgno = args->lpgno;
  +		} else {
  +			cp->pgno = args->rpgno;
  +			cp->indx -= split_indx;
  +		}
  +	}
  +	return (0);
  +}
  +
   /*
    * __bam_ca_split --
    *	Adjust the cursors when splitting a page.
  @@ -502,21 +600,15 @@
   	u_int32_t split_indx;
   	int cleft;
   {
  -	DB *dbp, *ldbp;
  -	DBC *dbc;
  -	DBC_INTERNAL *cp;
  +	DB *dbp;
   	DB_LSN lsn;
  -	DB_TXN *my_txn;
  -	ENV *env;
  -	int found, ret;
  +	int ret;
  +	u_int32_t found;
  +	struct __bam_ca_split_args args;
   
   	dbp = my_dbc->dbp;
  -	env = dbp->env;
  -	my_txn = IS_SUBTRANSACTION(my_dbc->txn) ? my_dbc->txn : NULL;
   
   	/*
  -	 * Adjust the cursors.  See the comment in __bam_ca_delete().
  -	 *
   	 * If splitting the page that a cursor was on, the cursor has to be
   	 * adjusted to point to the same record as before the split.  Most
   	 * of the time we don't adjust pointers to the left page, because
  @@ -524,36 +616,13 @@
   	 * the cursor is on the right page, it is decremented by the number of
   	 * records split to the left page.
   	 */
  -	MUTEX_LOCK(env, env->mtx_dblist);
  -	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -	for (found = 0;
  -	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -		MUTEX_LOCK(env, dbp->mutex);
  -		TAILQ_FOREACH(dbc, &ldbp->active_queue, links) {
  -			if (dbc->dbtype == DB_RECNO)
  -				continue;
  -			cp = dbc->internal;
  -			if (cp->pgno == ppgno &&
  -			    !MVCC_SKIP_CURADJ(dbc, ppgno)) {
  -				/* [#8032]
  -				DB_ASSERT(env, !STD_LOCKING(dbc) ||
  -				    cp->lock_mode != DB_LOCK_NG);
  -				*/
  -				if (my_txn != NULL && dbc->txn != my_txn)
  -					found = 1;
  -				if (cp->indx < split_indx) {
  -					if (cleft)
  -						cp->pgno = lpgno;
  -				} else {
  -					cp->pgno = rpgno;
  -					cp->indx -= split_indx;
  -				}
  -			}
  -		}
  -		MUTEX_UNLOCK(env, dbp->mutex);
  -	}
  -	MUTEX_UNLOCK(env, env->mtx_dblist);
  +	args.lpgno = lpgno;
  +	args.rpgno = rpgno;
  +	args.cleft = cleft;
  +	args.my_txn = IS_SUBTRANSACTION(my_dbc->txn) ? my_dbc->txn : NULL;
  +	if ((ret = __db_walk_cursors(dbp, my_dbc,
  +	    __bam_ca_split_func, &found, ppgno, split_indx, &args)) != 0)
  +		return (ret);
   
   	if (found != 0 && DBC_LOGGING(my_dbc)) {
   		if ((ret = __bam_curadj_log(dbp,
  @@ -565,6 +634,36 @@
   	return (0);
   }
   
  +static int
  +__bam_ca_undosplit_func(dbc, my_dbc, foundp, frompgno, split_indx, vargs)
  +	DBC *dbc;
  +	DBC *my_dbc;
  +	u_int32_t *foundp;
  +	db_pgno_t frompgno;
  +	u_int32_t split_indx;
  +	void *vargs;
  +{
  +	DBC_INTERNAL *cp;
  +	struct __bam_ca_split_args *args;
  +
  +	COMPQUIET(my_dbc, NULL);
  +	COMPQUIET(foundp, NULL);
  +
  +	if (dbc->dbtype == DB_RECNO)
  +		return (0);
  +	cp = dbc->internal;
  +	args = vargs;
  +	if (cp->pgno == args->rpgno &&
  +	    !MVCC_SKIP_CURADJ(dbc, args->rpgno)) {
  +		cp->pgno = frompgno;
  +		cp->indx += split_indx;
  +	} else if (cp->pgno == args->lpgno &&
  +	    !MVCC_SKIP_CURADJ(dbc, args->lpgno))
  +		cp->pgno = frompgno;
  +
  +	return (0);
  +}
  +
   /*
    * __bam_ca_undosplit --
    *	Adjust the cursors when undoing a split of a page.
  @@ -581,40 +680,15 @@
   	db_pgno_t frompgno, topgno, lpgno;
   	u_int32_t split_indx;
   {
  -	DB *ldbp;
  -	DBC *dbc;
  -	DBC_INTERNAL *cp;
  -	ENV *env;
  -
  -	env = dbp->env;
  +	u_int32_t count;
  +	struct __bam_ca_split_args args;
   
   	/*
  -	 * Adjust the cursors.  See the comment in __bam_ca_delete().
  -	 *
   	 * When backing out a split, we move the cursor back
   	 * to the original offset and bump it by the split_indx.
   	 */
  -	MUTEX_LOCK(env, env->mtx_dblist);
  -	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -	for (;
  -	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -		MUTEX_LOCK(env, dbp->mutex);
  -		TAILQ_FOREACH(dbc, &ldbp->active_queue, links) {
  -			if (dbc->dbtype == DB_RECNO)
  -				continue;
  -			cp = dbc->internal;
  -			if (cp->pgno == topgno &&
  -			    !MVCC_SKIP_CURADJ(dbc, topgno)) {
  -				cp->pgno = frompgno;
  -				cp->indx += split_indx;
  -			} else if (cp->pgno == lpgno &&
  -			    !MVCC_SKIP_CURADJ(dbc, lpgno))
  -				cp->pgno = frompgno;
  -		}
  -		MUTEX_UNLOCK(env, dbp->mutex);
  -	}
  -	MUTEX_UNLOCK(env, env->mtx_dblist);
  -
  -	return (0);
  +	args.lpgno = lpgno;
  +	args.rpgno = topgno;
  +	return (__db_walk_cursors(dbp, NULL,
  +	    __bam_ca_undosplit_func, &count, frompgno, split_indx, &args));
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_cursor.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_cursor.c
  --- db/btree/bt_cursor.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_cursor.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -248,9 +248,9 @@
   	/*
   	 * If our caller set the root page number, it's because the root was
   	 * known.  This is always the case for off page dup cursors.  Else,
  -	 * pull it out of our internal information.
  +	 * pull it out of our internal information, unless this is a subdb.
   	 */
  -	if (cp->root == PGNO_INVALID)
  +	if (cp->root == PGNO_INVALID && t->bt_meta == PGNO_BASE_MD)
   		cp->root = t->bt_root;
   
   	LOCK_INIT(cp->lock);
  @@ -323,7 +323,8 @@
   	DB_MPOOLFILE *mpf;
   	ENV *env;
   	PAGE *h;
  -	int cdb_lock, count, ret;
  +	int cdb_lock, ret;
  +	u_int32_t count;
   
   	dbp = dbc->dbp;
   	env = dbp->env;
  @@ -479,7 +480,7 @@
   				goto err;
   			cdb_lock = 1;
   		}
  -		goto delete;
  +		goto do_del;
   	}
   
   	/*
  @@ -492,7 +493,7 @@
   	 * is responsible for acquiring any necessary locks before calling us.
   	 */
   	if (F_ISSET(dbc, DBC_OPD))
  -		goto delete;
  +		goto do_del;
   
   	/*
   	 * Otherwise, acquire a write lock on the primary database's page.
  @@ -530,7 +531,7 @@
   		    LCK_COUPLE, cp->pgno, DB_LOCK_WRITE, 0, &cp->lock)) != 0)
   			goto err;
   
  -delete:	/*
  +do_del:	/*
   	 * If the delete occurred in a Btree, we're going to look at the page
   	 * to see if the item has to be physically deleted.  Otherwise, we do
   	 * not need the actual page (and it may not even exist, it might have
  @@ -785,7 +786,8 @@
   	BTREE_CURSOR *cp;
   	DB *dbp;
   	DB_MPOOLFILE *mpf;
  -	int count, ret, t_ret;
  +	int ret, t_ret;
  +	u_int32_t count;
   
   	dbp = dbc->dbp;
   	mpf = dbp->mpf;
  @@ -1891,7 +1893,7 @@
   				ret = __bam_get_prev(dbc);
   			}
   		}
  -	} else if(data != NULL) {
  +	} else if (data != NULL) {
   		/*
   		 * If we got an exact match with on-page duplicates, we need to
   		 * search in them.
  @@ -2846,7 +2848,7 @@
   	 * the last leaf page of off-page duplicate trees, but that's handled
   	 * by our caller, not down here.)
   	 */
  -	if (delete_page && cp->pgno == cp->root)
  +	if (delete_page && cp->pgno == BAM_ROOT_PGNO(dbc))
   		delete_page = 0;
   
   	/*
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_delete.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_delete.c
  --- db/btree/bt_delete.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_delete.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ -262,7 +262,7 @@
   	 * leaf page chain.
   	 */
   	if (LF_ISSET(BTD_RELINK) && LEVEL(cp->csp->page) == 1 &&
  -	    (ret = __bam_relink(dbc, cp->csp->page, NULL, PGNO_INVALID)) != 0)
  +	    (ret = __db_relink(dbc, cp->csp->page, NULL, PGNO_INVALID)) != 0)
   		goto discard;
   
   	/*
  @@ -369,9 +369,13 @@
   	 * tree can collapse one or more levels.  While there remains only a
   	 * single item on the root page, write lock the last page referenced
   	 * by the root page and copy it over the root page.
  +	 * Note that if pgno is the root of a btree database then the root
  +	 * cannot change as we have it locked.
   	 */
  -	root_pgno = cp->root;
  -	if (pgno != root_pgno || nitems != 1)
  +	if (nitems != 1)
  +		return (0);
  +	root_pgno = BAM_ROOT_PGNO(dbc);
  +	if (pgno != root_pgno)
   		return (0);
   
   	for (done = 0; !done;) {
  @@ -380,16 +384,13 @@
   		LOCK_INIT(p_lock);
   		LOCK_INIT(c_lock);
   
  -		/* Lock the root. */
  -		pgno = root_pgno;
  -		if ((ret =
  -		    __db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &p_lock)) != 0)
  -			goto stop;
  -		if ((ret = __memp_fget(mpf, &pgno, dbc->thread_info, dbc->txn,
  -		    DB_MPOOL_DIRTY, &parent)) != 0)
  -			goto stop;
  +		/* Get the root. */
  +		root_pgno = cp->root;
  +		BAM_GET_ROOT(dbc, root_pgno,
  +		    parent, DB_MPOOL_DIRTY, DB_LOCK_WRITE, p_lock, ret);
   
  -		if (NUM_ENT(parent) != 1)
  +		DB_ASSERT(dbp->env, parent != NULL);
  +		if (ret != 0 || NUM_ENT(parent) != 1)
   			goto stop;
   
   		switch (TYPE(parent)) {
  @@ -491,114 +492,6 @@
   }
   
   /*
  - * __bam_relink --
  - *	Relink around a deleted page.
  - *
  - * PUBLIC: int __bam_relink __P((DBC *, PAGE *, PAGE *, db_pgno_t));
  - *	Otherp can be either the previous or the next page to use if
  - * the caller already holds that page.
  - */
  -int
  -__bam_relink(dbc, pagep, otherp, new_pgno)
  -	DBC *dbc;
  -	PAGE *pagep, *otherp;
  -	db_pgno_t new_pgno;
  -{
  -	DB *dbp;
  -	DB_LOCK npl, ppl;
  -	DB_LSN *nlsnp, *plsnp, ret_lsn;
  -	DB_MPOOLFILE *mpf;
  -	PAGE *np, *pp;
  -	int ret, t_ret;
  -
  -	dbp = dbc->dbp;
  -	np = pp = NULL;
  -	LOCK_INIT(npl);
  -	LOCK_INIT(ppl);
  -	nlsnp = plsnp = NULL;
  -	mpf = dbp->mpf;
  -	ret = 0;
  -
  -	/*
  -	 * Retrieve the one/two pages.  The caller must have them locked
  -	 * because the parent is latched. For a remove, we may need
  -	 * two pages (the before and after).  For an add, we only need one
  -	 * because, the split took care of the prev.
  -	 */
  -	if (pagep->next_pgno != PGNO_INVALID) {
  -		if (((np = otherp) == NULL ||
  -		    PGNO(otherp) != pagep->next_pgno) &&
  -		    (ret = __memp_fget(mpf, &pagep->next_pgno,
  -		    dbc->thread_info, dbc->txn, DB_MPOOL_DIRTY, &np)) != 0) {
  -			ret = __db_pgerr(dbp, pagep->next_pgno, ret);
  -			goto err;
  -		}
  -		nlsnp = &np->lsn;
  -	}
  -	if (pagep->prev_pgno != PGNO_INVALID) {
  -		if (((pp = otherp) == NULL ||
  -		    PGNO(otherp) != pagep->prev_pgno) &&
  -		    (ret = __memp_fget(mpf, &pagep->prev_pgno,
  -		    dbc->thread_info, dbc->txn, DB_MPOOL_DIRTY, &pp)) != 0) {
  -			ret = __db_pgerr(dbp, pagep->prev_pgno, ret);
  -			goto err;
  -		}
  -		plsnp = &pp->lsn;
  -	}
  -
  -	/* Log the change. */
  -	if (DBC_LOGGING(dbc)) {
  -		if ((ret = __bam_relink_log(dbp, dbc->txn, &ret_lsn, 0,
  -		    pagep->pgno, new_pgno, pagep->prev_pgno, plsnp,
  -		    pagep->next_pgno, nlsnp)) != 0)
  -			goto err;
  -	} else
  -		LSN_NOT_LOGGED(ret_lsn);
  -	if (np != NULL)
  -		np->lsn = ret_lsn;
  -	if (pp != NULL)
  -		pp->lsn = ret_lsn;
  -
  -	/*
  -	 * Modify and release the two pages.
  -	 */
  -	if (np != NULL) {
  -		if (new_pgno == PGNO_INVALID)
  -			np->prev_pgno = pagep->prev_pgno;
  -		else
  -			np->prev_pgno = new_pgno;
  -		if (np != otherp)
  -			ret = __memp_fput(mpf,
  -			    dbc->thread_info, np, dbc->priority);
  -		if ((t_ret = __TLPUT(dbc, npl)) != 0 && ret == 0)
  -			ret = t_ret;
  -		if (ret != 0)
  -			goto err;
  -	}
  -
  -	if (pp != NULL) {
  -		if (new_pgno == PGNO_INVALID)
  -			pp->next_pgno = pagep->next_pgno;
  -		else
  -			pp->next_pgno = new_pgno;
  -		if (pp != otherp)
  -			ret = __memp_fput(mpf,
  -			    dbc->thread_info, pp, dbc->priority);
  -		if ((t_ret = __TLPUT(dbc, ppl)) != 0 && ret == 0)
  -			ret = t_ret;
  -		if (ret != 0)
  -			goto err;
  -	}
  -	return (0);
  -
  -err:	if (np != NULL && np != otherp)
  -		(void)__memp_fput(mpf, dbc->thread_info, np, dbc->priority);
  -	if (pp != NULL && pp != otherp)
  -		(void)__memp_fput(mpf, dbc->thread_info, pp, dbc->priority);
  -	return (ret);
  -}
  -
  -/*
    * __bam_pupdate --
    *	Update parent key pointers up the tree.
    *
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_method.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_method.c
  --- db/btree/bt_method.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_method.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1999-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1999, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -178,7 +178,7 @@
   		DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE | DB_OK_HASH);
   
   	if (LF_ISSET(DB_RECNUM | DB_REVSPLITOFF))
  -		DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE);
  +		DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE | DB_OK_HASH);
   
   	/* DB_DUP/DB_DUPSORT is incompatible with DB_RECNUM. */
   	if (LF_ISSET(DB_DUP | DB_DUPSORT) && F_ISSET(dbp, DB_AM_RECNUM))
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_open.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_open.c
  --- db/btree/bt_open.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_open.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ -49,7 +49,6 @@
   #include "dbinc/db_swap.h"
   #include "dbinc/btree.h"
   #include "dbinc/lock.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   #include "dbinc/partition.h"
   #include "dbinc/fop.h"
  @@ -340,11 +339,8 @@
   
   		t->bt_meta = base_pgno;
   		t->bt_root = meta->root;
  -#ifndef HAVE_FTRUNCATE
  -		if (PGNO(meta) == PGNO_BASE_MD &&
  -		    !F_ISSET(dbp, DB_AM_RECOVER) && !IS_VERSION(dbp, meta))
  +		if (PGNO(meta) == PGNO_BASE_MD && !F_ISSET(dbp, DB_AM_RECOVER))
   			__memp_set_last_pgno(mpf, meta->dbmeta.last_pgno);
  -#endif
   	} else {
   		DB_ASSERT(dbp->env,
   		    IS_RECOVERING(dbp->env) || F_ISSET(dbp, DB_AM_RECOVER));
  @@ -487,8 +483,8 @@
   	if (F_ISSET(dbp, DB_AM_INMEM)) {
   		/* Build the meta-data page. */
   		pgno = PGNO_BASE_MD;
  -		if ((ret = __memp_fget(mpf, &pgno, ip, txn,
  -		    DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &meta)) != 0)
  +		if ((ret = __memp_fget(mpf, &pgno,
  +		    ip, txn, DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &meta)) != 0)
   			return (ret);
   		LSN_NOT_LOGGED(lsn);
   		__bam_init_meta(dbp, meta, PGNO_BASE_MD, &lsn);
  @@ -505,7 +501,7 @@
   		/* Build the root page. */
   		pgno = 1;
   		if ((ret = __memp_fget(mpf, &pgno,
  -		    ip, txn, DB_MPOOL_CREATE, &root)) != 0)
  +		    ip, txn, DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &root)) != 0)
   			goto err;
   		P_INIT(root, dbp->pgsize, 1, PGNO_INVALID, PGNO_INVALID,
   		    LEAFLEVEL, dbp->type == DB_RECNO ? P_LRECNO : P_LBTREE);
  @@ -614,7 +610,7 @@
   	    0, dbp->meta_pgno, DB_LOCK_WRITE, 0, &metalock)) != 0)
   		goto err;
   	if ((ret = __memp_fget(mpf, &dbp->meta_pgno,
  -	    ip, txn, DB_MPOOL_CREATE, &meta)) != 0)
  +	    ip, txn, DB_MPOOL_CREATE | DB_MPOOL_DIRTY, &meta)) != 0)
   		goto err;
   
   	/* Build meta-data page. */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_put.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 bt_put.c
  --- db/btree/bt_put.c	16 Sep 2009 19:34:37 -0000	1.10
  +++ db/btree/bt_put.c	23 Aug 2010 13:36:23 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ -675,43 +675,25 @@
   	u_int32_t typeflag;
   {
   	BKEYDATA *bk;
  -	BINTERNAL *bi;
   	DB *dbp;
   	DBT orig, repl;
  -	db_indx_t cnt, lo, ln, min, off, prefix, suffix;
  -	int32_t nbytes;
  +	db_indx_t min, prefix, suffix;
   	u_int32_t len;
   	int ret;
  -	db_indx_t *inp;
   	u_int8_t *dp, *p, *t, type;
   
   	dbp = dbc->dbp;
  -	bi = NULL;
  -	bk = NULL;
   
   	/*
   	 * Replace a single item onto a page.  The logic figuring out where
   	 * to insert and whether it fits is handled in the caller.  All we do
   	 * here is manage the page shuffling.
   	 */
  -	if (TYPE(h) == P_IBTREE) {
  -		/* Point at the part of the internal struct past the type. */
  -		bi = GET_BINTERNAL(dbp, h, indx);
  -		if (B_TYPE(bi->type) == B_OVERFLOW)
  -			len = BOVERFLOW_SIZE;
  -		else
  -			len = bi->len;
  -		len += SSZA(BINTERNAL, data) - SSZ(BINTERNAL, unused);
  -		dp = &bi->unused;
  -		type = typeflag == 0 ? bi->type :
  -			(bi->type == B_KEYDATA ? B_OVERFLOW : B_KEYDATA);
  -	} else {
  -		bk = GET_BKEYDATA(dbp, h, indx);
  -		len = bk->len;
  -		dp = bk->data;
  -		type = bk->type;
  -		typeflag = B_DISSET(type);
  -	}
  +	bk = GET_BKEYDATA(dbp, h, indx);
  +	len = bk->len;
  +	dp = bk->data;
  +	type = bk->type;
  +	typeflag = B_DISSET(type);
   
   	/* Log the change. */
   	if (DBC_LOGGING(dbc)) {
  @@ -745,6 +727,33 @@
   	} else
   		LSN_NOT_LOGGED(LSN(h));
   
  +	return (__bam_ritem_nolog(dbc, h, indx, NULL, data, type));
  +}
  +
  +/*
  + * __bam_ritem_nolog --
  + *	Replace an item on a page.
  + *
  + * PUBLIC: int __bam_ritem_nolog __P((DBC *,
  + * PUBLIC:      PAGE *, u_int32_t, DBT *, DBT *, u_int32_t));
  + */
  +int
  +__bam_ritem_nolog(dbc, h, indx, hdr, data, type)
  +	DBC *dbc;
  +	PAGE *h;
  +	u_int32_t indx;
  +	DBT *hdr, *data;
  +	u_int32_t type;
  +{
  +	BKEYDATA *bk;
  +	BINTERNAL *bi;
  +	DB *dbp;
  +	db_indx_t cnt, off, lo, ln;
  +	db_indx_t *inp;
  +	int32_t nbytes;
  +	u_int8_t *p, *t;
  +
  +	dbp = dbc->dbp;
   	/*
   	 * Set references to the first in-use byte on the page and the
   	 * first byte of the item being replaced.
  @@ -752,11 +761,18 @@
   	inp = P_INP(dbp, h);
   	p = (u_int8_t *)h + HOFFSET(h);
   	if (TYPE(h) == P_IBTREE) {
  +		bi = GET_BINTERNAL(dbp, h, indx);
   		t = (u_int8_t *)bi;
   		lo = (db_indx_t)BINTERNAL_SIZE(bi->len);
  -		ln = (db_indx_t)BINTERNAL_SIZE(data->size -
  -		    (SSZA(BINTERNAL, data) - SSZ(BINTERNAL, unused)));
  +		if (data == NULL) {
  +			DB_ASSERT(dbp->env, hdr != NULL);
  +			bi = (BINTERNAL*)hdr->data;
  +			P_16_COPY(&bi->len, &cnt);
  +			ln = (db_indx_t)BINTERNAL_SIZE(cnt);
  +		} else
  +			ln = (db_indx_t)BINTERNAL_SIZE(data->size);
   	} else {
  +		bk = GET_BKEYDATA(dbp, h, indx);
   		t = (u_int8_t *)bk;
   		lo = (db_indx_t)BKEYDATA_SIZE(bk->len);
   		ln = (db_indx_t)BKEYDATA_SIZE(data->size);
  @@ -769,33 +785,37 @@
   	 * the regions overlap.
   	 */
   	if (lo != ln) {
  -		nbytes = lo - ln;		/* Signed difference. */
  +		nbytes = (int32_t)(lo - ln);	/* Signed difference. */
   		if (p == t)			/* First index is fast. */
  -			inp[indx] += nbytes;
  +			inp[indx] += (u_int32_t)nbytes;
   		else {				/* Else, shift the page. */
   			memmove(p + nbytes, p, (size_t)(t - p));
   
   			/* Adjust the indices' offsets. */
  -			off = inp[indx];
  +			off = (u_int32_t)inp[indx];
   			for (cnt = 0; cnt < NUM_ENT(h); ++cnt)
   				if (inp[cnt] <= off)
  -					inp[cnt] += nbytes;
  +					inp[cnt] += (u_int32_t)nbytes;
   		}
   
   		/* Clean up the page and adjust the item's reference. */
  -		HOFFSET(h) += nbytes;
  +		HOFFSET(h) += (u_int32_t)nbytes;
   		t += nbytes;
   	}
   
   	/* Copy the new item onto the page. */
  -	bk = (BKEYDATA *)t;
  -	bk->len = data->size;
  -	B_TSET(bk->type, type);
  -	memcpy(bk->data, data->data, bk->len);
  -
  -	/* Remove the length of the internal header elements. */
  -	if (TYPE(h) == P_IBTREE)
  -		bk->len -= SSZA(BINTERNAL, data) - SSZ(BINTERNAL, unused);
  +	if (TYPE(h) == P_IBTREE) {
  +		DB_ASSERT(dbp->env, hdr != NULL);
  +		memcpy(t, hdr->data, hdr->size);
  +		bi = (BINTERNAL *)t;
  +		if (data != NULL && data->size != 0)
  +			memcpy(bi->data, data->data, data->size);
  +	} else {
  +		bk = (BKEYDATA *)t;
  +		bk->len = data->size;
  +		B_TSET(bk->type, type);
  +		memcpy(bk->data, data->data, bk->len);
  +	}
   
   	return (0);
   }
  @@ -828,20 +848,16 @@
   	    (ret = __db_doff(dbc, ((BOVERFLOW *)bi->data)->pgno)) != 0)
   		return (ret);
   
  -	memset(&dbt, 0, sizeof(dbt));
  -	dbt.size = hdr->size + data->size - SSZ(BINTERNAL, unused);
  -	if ((ret = __os_malloc(dbp->env, dbt.size, &dbt.data)) != 0)
  -		return (ret);
  -	memcpy(dbt.data,
  -	     (u_int8_t *)hdr->data + SSZ(BINTERNAL, unused),
  -	     hdr->size - SSZ(BINTERNAL, unused));
  -	memcpy((u_int8_t *)dbt.data +
  -	    hdr->size - SSZ(BINTERNAL, unused), data->data, data->size);
  -
  -	ret = __bam_ritem(dbc, h, indx, &dbt, bi->type != bn->type);
  +	if (DBC_LOGGING(dbc)) {
  +		dbt.data = bi;
  +		dbt.size = BINTERNAL_SIZE(bi->len);
  +		if ((ret = __bam_irep_log(dbp, dbc->txn, &LSN(h), 0, PGNO(h),
  +		    &LSN(h), (u_int32_t)indx, TYPE(h), hdr, data, &dbt)) != 0)
  +			return (ret);
  +	} else
  +		LSN_NOT_LOGGED(LSN(h));
   
  -	__os_free(dbp->env, dbt.data);
  -	return (ret);
  +	return (__bam_ritem_nolog(dbc, h, indx, hdr, data, bn->type));
   }
   
   /*
  @@ -875,10 +891,8 @@
   	sz += B_TYPE(bk->type) == B_KEYDATA ?
   	    BKEYDATA_PSIZE(bk->len) : BOVERFLOW_PSIZE;
   
  -	/* Sum up all the data items. */
  -	first = indx;
  -
   	/*
  +	 * Sum up all the data items.
   	 * Account for the record being inserted.  If we are replacing it,
   	 * don't count it twice.
   	 *
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_rec.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_rec.c
  --- db/btree/bt_rec.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_rec.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,6 @@
   #include "dbinc/db_page.h"
   #include "dbinc/btree.h"
   #include "dbinc/lock.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   
   #define	IS_BTREE_PAGE(pagep)						\
  @@ -42,7 +41,7 @@
   	DB_MPOOLFILE *mpf;
   	PAGE *_lp, *lp, *np, *pp, *_rp, *rp, *sp;
   	db_pgno_t pgno, parent_pgno;
  -	u_int32_t ptype, size;
  +	u_int32_t opflags, size;
   	int cmp, l_update, p_update, r_update, ret, rootsplit, t_ret;
   
   	ip = ((DB_TXNHEAD *)info)->thread_info;
  @@ -53,11 +52,12 @@
   
   	REC_INTRO(__bam_split_read, ip, 0);
   
  +	opflags = OP_MODE_GET(argp->opflags);
   	if ((ret = __db_cursor_int(file_dbp, ip, NULL,
  -	    (argp->opflags & SPL_RECNO) ?  DB_RECNO : DB_BTREE,
  +	    (opflags & SPL_RECNO) ?  DB_RECNO : DB_BTREE,
   	    PGNO_INVALID, 0, NULL, &dbc)) != 0)
   		goto out;
  -	if (argp->opflags & SPL_NRECS)
  +	if (opflags & SPL_NRECS)
   		F_SET((BTREE_CURSOR *)dbc->internal, C_RECNUM);
   	F_SET(dbc, DBC_RECOVER);
   
  @@ -179,21 +179,21 @@
   		rp = NULL;
   		/*
   		 * If the parent page is wrong, update it.
  -		 * Initialize the page.  If it is a root page update
  -		 * the record counts if needed and put the first record in.
  +		 * For recno the insert into an existing parent
  +		 * was logged separately.
  +		 * If it is a root page update initialize the page and
  +		 * update the record counts if needed.  
   		 * Then insert the record for the right hand child page.
   		 */
   		if (p_update) {
   			REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  -			if (argp->opflags & SPL_RECNO)
  -				ptype = P_IRECNO;
  -			else
  -				ptype = P_IBTREE;
   
   			if (rootsplit) {
   				P_INIT(pp, file_dbp->pgsize, pgno, PGNO_INVALID,
  -				    PGNO_INVALID, _lp->level + 1, ptype);
  -				if (argp->opflags & SPL_NRECS) {
  +				    PGNO_INVALID, _lp->level + 1,
  +				    (opflags & SPL_RECNO) ?
  +				    P_IRECNO : P_IBTREE);
  +				if (opflags & SPL_NRECS) {
   					RE_NREC_SET(pp,
   					    __bam_total(file_dbp, _lp) +
   					    __bam_total(file_dbp, _rp));
  @@ -203,11 +203,12 @@
   				    &argp->pentry, NULL)) != 0)
   					goto out;
   
  -			}
  +			} else if (opflags & SPL_NRECS)
  +				goto recno;
   			if ((ret = __db_pitem_nolog(dbc, pp, argp->pindx + 1,
   			    argp->rentry.size, &argp->rentry, NULL)) != 0)
   				goto out;
  -			pp->lsn = *lsnp;
  +recno:			pp->lsn = *lsnp;
   		}
   
   check_next:	/*
  @@ -281,6 +282,7 @@
   
   		/*
   		 * Next we can update the parent removing the new index.
  +		 * If this has record numbers, then we log this separately.
   		 */
   		if (pp != NULL) {
   			DB_ASSERT(env, !rootsplit);
  @@ -288,16 +290,15 @@
   			CHECK_ABORT(env, op, cmp, &LSN(pp), lsnp);
   			if (cmp == 0) {
   				REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  -				if (argp->opflags & SPL_RECNO)
  -					size = RINTERNAL_SIZE;
  -				else
  +				if ((opflags & SPL_NRECS) == 0) {
   					size  = BINTERNAL_SIZE(
   					    GET_BINTERNAL(file_dbp,
   					    pp, argp->pindx + 1)->len);
   
  -				if ((ret = __db_ditem(dbc, pp,
  -				    argp->pindx + 1, size)) != 0)
  -					goto out;
  +					if ((ret = __db_ditem(dbc, pp,
  +					    argp->pindx + 1, size)) != 0)
  +						goto out;
  +				}
   				pp->lsn = argp->plsn;
   			}
   		}
  @@ -352,29 +353,30 @@
   	REC_CLOSE;
   }
   /*
  - * __bam_split_recover --
  + * __bam_split_48_recover --
    *	Recovery function for split.
    *
  - * PUBLIC: int __bam_split_42_recover
  + * PUBLIC: int __bam_split_48_recover
    * PUBLIC:   __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
    */
   int
  -__bam_split_42_recover(env, dbtp, lsnp, op, info)
  +__bam_split_48_recover(env, dbtp, lsnp, op, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops op;
   	void *info;
   {
  -	__bam_split_42_args *argp;
  +	__bam_split_48_args *argp;
   	DB_THREAD_INFO *ip;
   	DB *file_dbp;
   	DBC *dbc;
  +	DB_LSN *plsnp;
   	DB_MPOOLFILE *mpf;
   	PAGE *_lp, *lp, *np, *pp, *_rp, *rp, *sp;
  -	db_pgno_t pgno, root_pgno;
  -	u_int32_t ptype;
  -	int cmp, l_update, p_update, r_update, rc, ret, rootsplit, t_ret;
  +	db_pgno_t pgno, parent_pgno;
  +	u_int32_t ptype, size;
  +	int cmp, l_update, p_update, r_update, ret, rootsplit, t_ret;
   
   	ip = ((DB_TXNHEAD *)info)->thread_info;
   	REC_PRINT(__bam_split_print);
  @@ -382,7 +384,15 @@
   	_lp = lp = np = pp = _rp = rp = NULL;
   	sp = NULL;
   
  -	REC_INTRO(__bam_split_42_read, ip, 0);
  +	REC_INTRO(__bam_split_48_read, ip, 0);
  +
  +	if ((ret = __db_cursor_int(file_dbp, ip, NULL,
  +	    (argp->opflags & SPL_RECNO) ?  DB_RECNO : DB_BTREE,
  +	    PGNO_INVALID, 0, NULL, &dbc)) != 0)
  +		goto out;
  +	if (argp->opflags & SPL_NRECS)
  +		F_SET((BTREE_CURSOR *)dbc->internal, C_RECNUM);
  +	F_SET(dbc, DBC_RECOVER);
   
   	/*
   	 * There are two kinds of splits that we have to recover from.  The
  @@ -403,9 +413,12 @@
   	memcpy(sp, argp->pg.data, argp->pg.size);
   
   	pgno = PGNO(sp);
  -	root_pgno = argp->root_pgno;
  -	rootsplit = root_pgno != PGNO_INVALID;
  -	REC_FGET(mpf, ip, argp->left, &lp, right);
  +	parent_pgno = argp->ppgno;
  +	rootsplit = parent_pgno == pgno;
  +
  +	/* Get the pages going down the tree. */
  +	REC_FGET(mpf, ip, parent_pgno, &pp, left);
  +left:	REC_FGET(mpf, ip, argp->left, &lp, right);
   right:	REC_FGET(mpf, ip, argp->right, &rp, redo);
   
   redo:	if (DB_REDO(op)) {
  @@ -416,15 +429,18 @@
   		 * If this is a root split, then the root has to exist unless
   		 * we have truncated it due to a future deallocation.
   		 */
  -		if (rootsplit) {
  -			REC_FGET(mpf, ip, root_pgno, &pp, do_left);
  -			cmp = LOG_COMPARE(&LSN(pp), &LSN(argp->pg.data));
  -			CHECK_LSN(env, op,
  -			    cmp, &LSN(pp), &LSN(argp->pg.data));
  -			p_update = cmp  == 0;
  +		if (pp != NULL) {
  +			if (rootsplit)
  +				plsnp = &LSN(argp->pg.data);
  +			else
  +				plsnp = &argp->plsn;
  +			cmp = LOG_COMPARE(&LSN(pp), plsnp);
  +			CHECK_LSN(env, op, cmp, &LSN(pp), plsnp);
  +			if (cmp == 0)
  +				p_update = 1;
   		}
   
  -do_left:	if (lp != NULL) {
  +		if (lp != NULL) {
   			cmp = LOG_COMPARE(&LSN(lp), &argp->llsn);
   			CHECK_LSN(env, op, cmp, &LSN(lp), &argp->llsn);
   			if (cmp == 0)
  @@ -474,48 +490,57 @@
   			REC_DIRTY(mpf, ip, file_dbp->priority, &lp);
   			memcpy(lp, _lp, file_dbp->pgsize);
   			lp->lsn = *lsnp;
  -			if ((ret = __memp_fput(mpf,
  -			     ip, lp, file_dbp->priority)) != 0)
  -				goto out;
  -			lp = NULL;
   		}
   
   		if (r_update) {
   			REC_DIRTY(mpf, ip, file_dbp->priority, &rp);
   			memcpy(rp, _rp, file_dbp->pgsize);
   			rp->lsn = *lsnp;
  -			if ((ret = __memp_fput(mpf,
  -			    ip, rp, file_dbp->priority)) != 0)
  -				goto out;
  -			rp = NULL;
   		}
   
   		/*
  -		 * If the parent page is wrong, update it.  This is of interest
  -		 * only if it was a root split, since root splits create parent
  -		 * pages.  All other splits modify a parent page, but those are
  -		 * separately logged and recovered.
  +		 * Drop the latches on the lower level pages before
  +		 * getting an exclusive latch on the higher level page.
   		 */
  -		if (rootsplit && p_update) {
  -			if (IS_BTREE_PAGE(sp)) {
  -				ptype = P_IBTREE;
  -				rc = argp->opflags & SPL_NRECS ? 1 : 0;
  -			} else {
  +		if (lp != NULL && (ret = __memp_fput(mpf,
  +		    ip, lp, file_dbp->priority)) && ret == 0)
  +			goto out;
  +		lp = NULL;
  +		if (rp != NULL && (ret = __memp_fput(mpf,
  +		    ip, rp, file_dbp->priority)) && ret == 0)
  +			goto out;
  +		rp = NULL;
  +		/*
  +		 * If the parent page is wrong, update it.
  +		 * Initialize the page.  If it is a root page update
  +		 * the record counts if needed and put the first record in.
  +		 * Then insert the record for the right hand child page.
  +		 */
  +		if (p_update) {
  +			REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  +			if (argp->opflags & SPL_RECNO)
   				ptype = P_IRECNO;
  -				rc = 1;
  -			}
  +			else
  +				ptype = P_IBTREE;
   
  -			REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  -			P_INIT(pp, file_dbp->pgsize, root_pgno,
  -			    PGNO_INVALID, PGNO_INVALID, _lp->level + 1, ptype);
  -			RE_NREC_SET(pp, rc ? __bam_total(file_dbp, _lp) +
  -			    __bam_total(file_dbp, _rp) : 0);
  +			if (rootsplit) {
  +				P_INIT(pp, file_dbp->pgsize, pgno, PGNO_INVALID,
  +				    PGNO_INVALID, _lp->level + 1, ptype);
  +				if (argp->opflags & SPL_NRECS) {
  +					RE_NREC_SET(pp,
  +					    __bam_total(file_dbp, _lp) +
  +					    __bam_total(file_dbp, _rp));
  +				}
  +				if ((ret = __db_pitem_nolog(dbc, pp,
  +				    argp->pindx, argp->pentry.size,
  +				    &argp->pentry, NULL)) != 0)
  +					goto out;
   
  -			pp->lsn = *lsnp;
  -			if ((ret = __memp_fput(mpf,
  -			     ip, pp, file_dbp->priority)) != 0)
  +			}
  +			if ((ret = __db_pitem_nolog(dbc, pp, argp->pindx + 1,
  +			    argp->rentry.size, &argp->rentry, NULL)) != 0)
   				goto out;
  -			pp = NULL;
  +			pp->lsn = *lsnp;
   		}
   
   check_next:	/*
  @@ -526,75 +551,87 @@
   		 * page must exist because we're redoing the operation.
   		 */
   		if (!rootsplit && argp->npgno != PGNO_INVALID) {
  -			if ((ret = __memp_fget(mpf, &argp->npgno,
  -			    ip, NULL, 0, &np)) != 0) {
  -				if (ret != DB_PAGE_NOTFOUND) {
  -					ret = __db_pgerr(
  -					    file_dbp, argp->npgno, ret);
  -					goto out;
  -				} else
  -					goto done;
  -			}
  +			REC_FGET(mpf, ip, argp->npgno, &np, done);
   			cmp = LOG_COMPARE(&LSN(np), &argp->nlsn);
   			CHECK_LSN(env, op, cmp, &LSN(np), &argp->nlsn);
   			if (cmp == 0) {
   				REC_DIRTY(mpf, ip, file_dbp->priority, &np);
   				PREV_PGNO(np) = argp->right;
   				np->lsn = *lsnp;
  -				if ((ret = __memp_fput(mpf, ip,
  -				    np, file_dbp->priority)) != 0)
  -					goto out;
  -				np = NULL;
   			}
   		}
   	} else {
   		/*
  -		 * If the split page is wrong, replace its contents with the
  -		 * logged page contents.  If the page doesn't exist, it means
  -		 * that the create of the page never happened, nor did any of
  -		 * the adds onto the page that caused the split, and there's
  -		 * really no undo-ing to be done.
  +		 * If it's a root split and the left child ever existed, update
  +		 * its LSN.   Otherwise its the split page. If
  +		 * right child ever existed, root split or not, update its LSN.
  +		 * The undo of the page allocation(s) will restore them to the
  +		 * free list.
   		 */
  -		if ((ret = __memp_fget(mpf, &pgno, ip, NULL,
  -		    DB_MPOOL_EDIT, &pp)) != 0) {
  -			pp = NULL;
  -			goto lrundo;
  +		if (rootsplit && lp != NULL &&
  +		    LOG_COMPARE(lsnp, &LSN(lp)) == 0) {
  +			REC_DIRTY(mpf, ip, file_dbp->priority, &lp);
  +			lp->lsn = argp->llsn;
   		}
  -		if (LOG_COMPARE(lsnp, &LSN(pp)) == 0) {
  -			REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  -			memcpy(pp, argp->pg.data, argp->pg.size);
  -			if ((ret = __memp_fput(mpf,
  -			     ip, pp, file_dbp->priority)) != 0)
  -				goto out;
  -			pp = NULL;
  +		if (rp != NULL &&
  +		    LOG_COMPARE(lsnp, &LSN(rp)) == 0) {
  +			REC_DIRTY(mpf, ip, file_dbp->priority, &rp);
  +			rp->lsn = argp->rlsn;
   		}
  +		/*
  +		 * Drop the lower level pages before getting an exclusive
  +		 * latch on  the parent.
  +		 */
  +		if (rp != NULL && (ret = __memp_fput(mpf,
  +		    ip, rp, file_dbp->priority)))
  +			goto out;
  +		rp = NULL;
   
   		/*
  -		 * If it's a root split and the left child ever existed, update
  -		 * its LSN.  (If it's not a root split, we've updated the left
  -		 * page already -- it's the same as the split page.) If the
  -		 * right child ever existed, root split or not, update its LSN.
  -		 * The undo of the page allocation(s) will restore them to the
  -		 * free list.
  +		 * Check the state of the split page.  If its a rootsplit
  +		 * then thats the rootpage otherwise its the left page.
   		 */
  -lrundo:		if ((rootsplit && lp != NULL) || rp != NULL) {
  -			if (rootsplit && lp != NULL &&
  -			    LOG_COMPARE(lsnp, &LSN(lp)) == 0) {
  +		if (rootsplit) {
  +			DB_ASSERT(env, pgno == argp->ppgno);
  +			if (lp != NULL && (ret = __memp_fput(mpf, ip,
  +			     lp, file_dbp->priority)) != 0)
  +				goto out;
  +			lp = pp;
  +			pp = NULL;
  +		}
  +		if (lp != NULL) {
  +			cmp = LOG_COMPARE(lsnp, &LSN(lp));
  +			CHECK_ABORT(env, op, cmp, &LSN(lp), lsnp);
  +			if (cmp == 0) {
   				REC_DIRTY(mpf, ip, file_dbp->priority, &lp);
  -				lp->lsn = argp->llsn;
  -				if ((ret = __memp_fput(mpf, ip,
  -				    lp, file_dbp->priority)) != 0)
  +				memcpy(lp, argp->pg.data, argp->pg.size);
  +				if ((ret = __memp_fput(mpf,
  +				    ip, lp, file_dbp->priority)))
   					goto out;
   				lp = NULL;
   			}
  -			if (rp != NULL &&
  -			    LOG_COMPARE(lsnp, &LSN(rp)) == 0) {
  -				REC_DIRTY(mpf, ip, file_dbp->priority, &rp);
  -				rp->lsn = argp->rlsn;
  -				if ((ret = __memp_fput(mpf, ip,
  -				     rp, file_dbp->priority)) != 0)
  +		}
  +
  +		/*
  +		 * Next we can update the parent removing the new index.
  +		 */
  +		if (pp != NULL) {
  +			DB_ASSERT(env, !rootsplit);
  +			cmp = LOG_COMPARE(lsnp, &LSN(pp));
  +			CHECK_ABORT(env, op, cmp, &LSN(pp), lsnp);
  +			if (cmp == 0) {
  +				REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  +				if (argp->opflags & SPL_RECNO)
  +					size = RINTERNAL_SIZE;
  +				else
  +					size  = BINTERNAL_SIZE(
  +					    GET_BINTERNAL(file_dbp,
  +					    pp, argp->pindx + 1)->len);
  +
  +				if ((ret = __db_ditem(dbc, pp,
  +				    argp->pindx + 1, size)) != 0)
   					goto out;
  -				rp = NULL;
  +				pp->lsn = argp->plsn;
   			}
   		}
   
  @@ -616,10 +653,6 @@
   				REC_DIRTY(mpf, ip, file_dbp->priority, &np);
   				PREV_PGNO(np) = argp->left;
   				np->lsn = argp->nlsn;
  -				if (__memp_fput(mpf,
  -				     ip, np, file_dbp->priority))
  -					goto out;
  -				np = NULL;
   			}
   		}
   	}
  @@ -627,10 +660,7 @@
   done:	*lsnp = argp->prev_lsn;
   	ret = 0;
   
  -out:	/* Free any pages that weren't dirtied. */
  -	if (pp != NULL && (t_ret = __memp_fput(mpf,
  -	    ip, pp, file_dbp->priority)) != 0 && ret == 0)
  -		ret = t_ret;
  +out:	/* Free any pages that are left. */
   	if (lp != NULL && (t_ret = __memp_fput(mpf,
   	    ip, lp, file_dbp->priority)) != 0 && ret == 0)
   		ret = t_ret;
  @@ -640,6 +670,9 @@
   	if (rp != NULL && (t_ret = __memp_fput(mpf,
   	     ip, rp, file_dbp->priority)) != 0 && ret == 0)
   		ret = t_ret;
  +	if (pp != NULL && (t_ret = __memp_fput(mpf,
  +	    ip, pp, file_dbp->priority)) != 0 && ret == 0)
  +		ret = t_ret;
   
   	/* Free any allocated space. */
   	if (_lp != NULL)
  @@ -651,10 +684,310 @@
   
   	REC_CLOSE;
   }
  -
   /*
  - * __bam_rsplit_recover --
  - *	Recovery function for a reverse split.
  + * __bam_split_recover --
  + *	Recovery function for split.
  + *
  + * PUBLIC: int __bam_split_42_recover
  + * PUBLIC:   __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
  + */
  +int
  +__bam_split_42_recover(env, dbtp, lsnp, op, info)
  +	ENV *env;
  +	DBT *dbtp;
  +	DB_LSN *lsnp;
  +	db_recops op;
  +	void *info;
  +{
  +	__bam_split_42_args *argp;
  +	DB_THREAD_INFO *ip;
  +	DB *file_dbp;
  +	DBC *dbc;
  +	DB_MPOOLFILE *mpf;
  +	PAGE *_lp, *lp, *np, *pp, *_rp, *rp, *sp;
  +	db_pgno_t pgno, root_pgno;
  +	u_int32_t ptype;
  +	int cmp, l_update, p_update, r_update, rc, ret, rootsplit, t_ret;
  +
  +	ip = ((DB_TXNHEAD *)info)->thread_info;
  +	REC_PRINT(__bam_split_print);
  +
  +	_lp = lp = np = pp = _rp = rp = NULL;
  +	sp = NULL;
  +
  +	REC_INTRO(__bam_split_42_read, ip, 0);
  +
  +	/*
  +	 * There are two kinds of splits that we have to recover from.  The
  +	 * first is a root-page split, where the root page is split from a
  +	 * leaf page into an internal page and two new leaf pages are created.
  +	 * The second is where a page is split into two pages, and a new key
  +	 * is inserted into the parent page.
  +	 *
  +	 * DBTs are not aligned in log records, so we need to copy the page
  +	 * so that we can access fields within it throughout this routine.
  +	 * Although we could hardcode the unaligned copies in this routine,
  +	 * we will be calling into regular btree functions with this page,
  +	 * so it's got to be aligned.  Copying it into allocated memory is
  +	 * the only way to guarantee this.
  +	 */
  +	if ((ret = __os_malloc(env, argp->pg.size, &sp)) != 0)
  +		goto out;
  +	memcpy(sp, argp->pg.data, argp->pg.size);
  +
  +	pgno = PGNO(sp);
  +	root_pgno = argp->root_pgno;
  +	rootsplit = root_pgno != PGNO_INVALID;
  +	REC_FGET(mpf, ip, argp->left, &lp, right);
  +right:	REC_FGET(mpf, ip, argp->right, &rp, redo);
  +
  +redo:	if (DB_REDO(op)) {
  +		l_update = r_update = p_update = 0;
  +		/*
  +		 * Decide if we need to resplit the page.
  +		 *
  +		 * If this is a root split, then the root has to exist unless
  +		 * we have truncated it due to a future deallocation.
  +		 */
  +		if (rootsplit) {
  +			REC_FGET(mpf, ip, root_pgno, &pp, do_left);
  +			cmp = LOG_COMPARE(&LSN(pp), &LSN(argp->pg.data));
  +			CHECK_LSN(env, op,
  +			    cmp, &LSN(pp), &LSN(argp->pg.data));
  +			p_update = cmp  == 0;
  +		}
  +
  +do_left:	if (lp != NULL) {
  +			cmp = LOG_COMPARE(&LSN(lp), &argp->llsn);
  +			CHECK_LSN(env, op, cmp, &LSN(lp), &argp->llsn);
  +			if (cmp == 0)
  +				l_update = 1;
  +		}
  +
  +		if (rp != NULL) {
  +			cmp = LOG_COMPARE(&LSN(rp), &argp->rlsn);
  +			CHECK_LSN(env, op, cmp, &LSN(rp), &argp->rlsn);
  +			if (cmp == 0)
  +				r_update = 1;
  +		}
  +
  +		if (!p_update && !l_update && !r_update)
  +			goto check_next;
  +
  +		/* Allocate and initialize new left/right child pages. */
  +		if ((ret = __os_malloc(env, file_dbp->pgsize, &_lp)) != 0 ||
  +		    (ret = __os_malloc(env, file_dbp->pgsize, &_rp)) != 0)
  +			goto out;
  +		if (rootsplit) {
  +			P_INIT(_lp, file_dbp->pgsize, argp->left,
  +			    PGNO_INVALID,
  +			    ISINTERNAL(sp) ? PGNO_INVALID : argp->right,
  +			    LEVEL(sp), TYPE(sp));
  +			P_INIT(_rp, file_dbp->pgsize, argp->right,
  +			    ISINTERNAL(sp) ?  PGNO_INVALID : argp->left,
  +			    PGNO_INVALID, LEVEL(sp), TYPE(sp));
  +		} else {
  +			P_INIT(_lp, file_dbp->pgsize, PGNO(sp),
  +			    ISINTERNAL(sp) ? PGNO_INVALID : PREV_PGNO(sp),
  +			    ISINTERNAL(sp) ? PGNO_INVALID : argp->right,
  +			    LEVEL(sp), TYPE(sp));
  +			P_INIT(_rp, file_dbp->pgsize, argp->right,
  +			    ISINTERNAL(sp) ? PGNO_INVALID : sp->pgno,
  +			    ISINTERNAL(sp) ? PGNO_INVALID : NEXT_PGNO(sp),
  +			    LEVEL(sp), TYPE(sp));
  +		}
  +
  +		/* Split the page. */
  +		if ((ret = __bam_copy(file_dbp, sp, _lp, 0, argp->indx)) != 0 ||
  +		    (ret = __bam_copy(file_dbp, sp, _rp, argp->indx,
  +		    NUM_ENT(sp))) != 0)
  +			goto out;
  +
  +		if (l_update) {
  +			REC_DIRTY(mpf, ip, file_dbp->priority, &lp);
  +			memcpy(lp, _lp, file_dbp->pgsize);
  +			lp->lsn = *lsnp;
  +			if ((ret = __memp_fput(mpf,
  +			     ip, lp, file_dbp->priority)) != 0)
  +				goto out;
  +			lp = NULL;
  +		}
  +
  +		if (r_update) {
  +			REC_DIRTY(mpf, ip, file_dbp->priority, &rp);
  +			memcpy(rp, _rp, file_dbp->pgsize);
  +			rp->lsn = *lsnp;
  +			if ((ret = __memp_fput(mpf,
  +			    ip, rp, file_dbp->priority)) != 0)
  +				goto out;
  +			rp = NULL;
  +		}
  +
  +		/*
  +		 * If the parent page is wrong, update it.  This is of interest
  +		 * only if it was a root split, since root splits create parent
  +		 * pages.  All other splits modify a parent page, but those are
  +		 * separately logged and recovered.
  +		 */
  +		if (rootsplit && p_update) {
  +			if (IS_BTREE_PAGE(sp)) {
  +				ptype = P_IBTREE;
  +				rc = argp->opflags & SPL_NRECS ? 1 : 0;
  +			} else {
  +				ptype = P_IRECNO;
  +				rc = 1;
  +			}
  +
  +			REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  +			P_INIT(pp, file_dbp->pgsize, root_pgno,
  +			    PGNO_INVALID, PGNO_INVALID, _lp->level + 1, ptype);
  +			RE_NREC_SET(pp, rc ? __bam_total(file_dbp, _lp) +
  +			    __bam_total(file_dbp, _rp) : 0);
  +
  +			pp->lsn = *lsnp;
  +			if ((ret = __memp_fput(mpf,
  +			     ip, pp, file_dbp->priority)) != 0)
  +				goto out;
  +			pp = NULL;
  +		}
  +
  +check_next:	/*
  +		 * Finally, redo the next-page link if necessary.  This is of
  +		 * interest only if it wasn't a root split -- inserting a new
  +		 * page in the tree requires that any following page have its
  +		 * previous-page pointer updated to our new page.  The next
  +		 * page must exist because we're redoing the operation.
  +		 */
  +		if (!rootsplit && argp->npgno != PGNO_INVALID) {
  +			if ((ret = __memp_fget(mpf, &argp->npgno,
  +			    ip, NULL, 0, &np)) != 0) {
  +				if (ret != DB_PAGE_NOTFOUND) {
  +					ret = __db_pgerr(
  +					    file_dbp, argp->npgno, ret);
  +					goto out;
  +				} else
  +					goto done;
  +			}
  +			cmp = LOG_COMPARE(&LSN(np), &argp->nlsn);
  +			CHECK_LSN(env, op, cmp, &LSN(np), &argp->nlsn);
  +			if (cmp == 0) {
  +				REC_DIRTY(mpf, ip, file_dbp->priority, &np);
  +				PREV_PGNO(np) = argp->right;
  +				np->lsn = *lsnp;
  +				if ((ret = __memp_fput(mpf, ip,
  +				    np, file_dbp->priority)) != 0)
  +					goto out;
  +				np = NULL;
  +			}
  +		}
  +	} else {
  +		/*
  +		 * If the split page is wrong, replace its contents with the
  +		 * logged page contents.  If the page doesn't exist, it means
  +		 * that the create of the page never happened, nor did any of
  +		 * the adds onto the page that caused the split, and there's
  +		 * really no undo-ing to be done.
  +		 */
  +		if ((ret = __memp_fget(mpf, &pgno, ip, NULL,
  +		    DB_MPOOL_EDIT, &pp)) != 0) {
  +			pp = NULL;
  +			goto lrundo;
  +		}
  +		if (LOG_COMPARE(lsnp, &LSN(pp)) == 0) {
  +			REC_DIRTY(mpf, ip, file_dbp->priority, &pp);
  +			memcpy(pp, argp->pg.data, argp->pg.size);
  +			if ((ret = __memp_fput(mpf,
  +			     ip, pp, file_dbp->priority)) != 0)
  +				goto out;
  +			pp = NULL;
  +		}
  +
  +		/*
  +		 * If it's a root split and the left child ever existed, update
  +		 * its LSN.  (If it's not a root split, we've updated the left
  +		 * page already -- it's the same as the split page.) If the
  +		 * right child ever existed, root split or not, update its LSN.
  +		 * The undo of the page allocation(s) will restore them to the
  +		 * free list.
  +		 */
  +lrundo:		if ((rootsplit && lp != NULL) || rp != NULL) {
  +			if (rootsplit && lp != NULL &&
  +			    LOG_COMPARE(lsnp, &LSN(lp)) == 0) {
  +				REC_DIRTY(mpf, ip, file_dbp->priority, &lp);
  +				lp->lsn = argp->llsn;
  +				if ((ret = __memp_fput(mpf, ip,
  +				    lp, file_dbp->priority)) != 0)
  +					goto out;
  +				lp = NULL;
  +			}
  +			if (rp != NULL &&
  +			    LOG_COMPARE(lsnp, &LSN(rp)) == 0) {
  +				REC_DIRTY(mpf, ip, file_dbp->priority, &rp);
  +				rp->lsn = argp->rlsn;
  +				if ((ret = __memp_fput(mpf, ip,
  +				     rp, file_dbp->priority)) != 0)
  +					goto out;
  +				rp = NULL;
  +			}
  +		}
  +
  +		/*
  +		 * Finally, undo the next-page link if necessary.  This is of
  +		 * interest only if it wasn't a root split -- inserting a new
  +		 * page in the tree requires that any following page have its
  +		 * previous-page pointer updated to our new page.  Since it's
  +		 * possible that the next-page never existed, we ignore it as
  +		 * if there's nothing to undo.
  +		 */
  +		if (!rootsplit && argp->npgno != PGNO_INVALID) {
  +			if ((ret = __memp_fget(mpf, &argp->npgno,
  +			    ip, NULL, DB_MPOOL_EDIT, &np)) != 0) {
  +				np = NULL;
  +				goto done;
  +			}
  +			if (LOG_COMPARE(lsnp, &LSN(np)) == 0) {
  +				REC_DIRTY(mpf, ip, file_dbp->priority, &np);
  +				PREV_PGNO(np) = argp->left;
  +				np->lsn = argp->nlsn;
  +				if (__memp_fput(mpf,
  +				     ip, np, file_dbp->priority))
  +					goto out;
  +				np = NULL;
  +			}
  +		}
  +	}
  +
  +done:	*lsnp = argp->prev_lsn;
  +	ret = 0;
  +
  +out:	/* Free any pages that weren't dirtied. */
  +	if (pp != NULL && (t_ret = __memp_fput(mpf,
  +	    ip, pp, file_dbp->priority)) != 0 && ret == 0)
  +		ret = t_ret;
  +	if (lp != NULL && (t_ret = __memp_fput(mpf,
  +	    ip, lp, file_dbp->priority)) != 0 && ret == 0)
  +		ret = t_ret;
  +	if (np != NULL && (t_ret = __memp_fput(mpf,
  +	    ip, np, file_dbp->priority)) != 0 && ret == 0)
  +		ret = t_ret;
  +	if (rp != NULL && (t_ret = __memp_fput(mpf,
  +	     ip, rp, file_dbp->priority)) != 0 && ret == 0)
  +		ret = t_ret;
  +
  +	/* Free any allocated space. */
  +	if (_lp != NULL)
  +		__os_free(env, _lp);
  +	if (_rp != NULL)
  +		__os_free(env, _rp);
  +	if (sp != NULL)
  +		__os_free(env, sp);
  +
  +	REC_CLOSE;
  +}
  +
  +/*
  + * __bam_rsplit_recover --
  + *	Recovery function for a reverse split.
    *
    * PUBLIC: int __bam_rsplit_recover
    * PUBLIC:   __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
  @@ -1010,7 +1343,6 @@
   	__bam_repl_args *argp;
   	DB_THREAD_INFO *ip;
   	BKEYDATA *bk;
  -	BINTERNAL *bi;
   	DB *file_dbp;
   	DBC *dbc;
   	DBT dbt;
  @@ -1045,17 +1377,9 @@
   		 * Re-build the replacement item.
   		 */
   		REC_DIRTY(mpf, ip, dbc->priority, &pagep);
  -		if (TYPE(pagep) == P_IBTREE) {
  -			/* Point at the internal struct past the type. */
  -			bi = GET_BINTERNAL(file_dbp, pagep, argp->indx);
  -			dp = &bi->unused;
  -			len = bi->len +
  -			     SSZA(BINTERNAL, data) - SSZ(BINTERNAL, unused);
  -		} else  {
  -			bk = GET_BKEYDATA(file_dbp, pagep, argp->indx);
  -			dp = bk->data;
  -			len = bk->len;
  -		}
  +		bk = GET_BKEYDATA(file_dbp, pagep, argp->indx);
  +		dp = bk->data;
  +		len = bk->len;
   		memset(&dbt, 0, sizeof(dbt));
   		dbt.size = argp->prefix + argp->suffix + argp->repl.size;
   		if ((ret = __os_malloc(env, dbt.size, &dbt.data)) != 0)
  @@ -1067,9 +1391,7 @@
   		p += argp->repl.size;
   		memcpy(p, dp + (len - argp->suffix), argp->suffix);
   
  -		/* isdeleted has become the type flag for non-leaf replace */
  -		ret = __bam_ritem(dbc,
  -		     pagep, argp->indx, &dbt, argp->isdeleted);
  +		ret = __bam_ritem(dbc, pagep, argp->indx, &dbt, 0);
   		__os_free(env, dbt.data);
   		if (ret != 0)
   			goto out;
  @@ -1082,17 +1404,9 @@
   		 * Re-build the original item.
   		 */
   		REC_DIRTY(mpf, ip, dbc->priority, &pagep);
  -		if (TYPE(pagep) == P_IBTREE) {
  -			/* Point at the internal struct past the type. */
  -			bi = GET_BINTERNAL(file_dbp, pagep, argp->indx);
  -			dp = &bi->unused;
  -			len = bi->len +
  -			     SSZA(BINTERNAL, data) - SSZ(BINTERNAL, unused);
  -		} else  {
  -			bk = GET_BKEYDATA(file_dbp, pagep, argp->indx);
  -			dp = bk->data;
  -			len = bk->len;
  -		}
  +		bk = GET_BKEYDATA(file_dbp, pagep, argp->indx);
  +		dp = bk->data;
  +		len = bk->len;
   		memset(&dbt, 0, sizeof(dbt));
   		dbt.size = argp->prefix + argp->suffix + argp->orig.size;
   		if ((ret = __os_malloc(env, dbt.size, &dbt.data)) != 0)
  @@ -1104,14 +1418,13 @@
   		p += argp->orig.size;
   		memcpy(p, dp + (len - argp->suffix), argp->suffix);
   
  -		ret = __bam_ritem(dbc,
  -		     pagep, argp->indx, &dbt, argp->isdeleted);
  +		ret = __bam_ritem(dbc, pagep, argp->indx, &dbt, 0);
   		__os_free(env, dbt.data);
   		if (ret != 0)
   			goto out;
   
   		/* Reset the deleted flag, if necessary. */
  -		if (argp->isdeleted && LEVEL(pagep) == LEAFLEVEL)
  +		if (argp->isdeleted)
   			B_DSET(GET_BKEYDATA(file_dbp, pagep, argp->indx)->type);
   
   		LSN(pagep) = argp->lsn;
  @@ -1129,6 +1442,76 @@
   }
   
   /*
  + * __bam_irep_recover --
  + *	Recovery function for internal page item replacement.
  + *
  + * PUBLIC: int __bam_irep_recover
  + * PUBLIC:   __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
  + */
  +int
  +__bam_irep_recover(env, dbtp, lsnp, op, info)
  +	ENV *env;
  +	DBT *dbtp;
  +	DB_LSN *lsnp;
  +	db_recops op;
  +	void *info;
  +{
  +	__bam_irep_args *argp;
  +	BINTERNAL *bn;
  +	DB_THREAD_INFO *ip;
  +	DB *file_dbp;
  +	DBC *dbc;
  +	DB_MPOOLFILE *mpf;
  +	PAGE *pagep;
  +	int cmp_n, cmp_p, ret;
  +
  +	ip = ((DB_TXNHEAD *)info)->thread_info;
  +	pagep = NULL;
  +	REC_PRINT(__bam_irep_print);
  +	REC_INTRO(__bam_irep_read, ip, 1);
  +
  +	/* Get the page; if it never existed and we're undoing, we're done. */
  +	if ((ret = __memp_fget(mpf, &argp->pgno, ip, NULL, 0, &pagep)) != 0) {
  +		if (ret != DB_PAGE_NOTFOUND) {
  +			ret = __db_pgerr(file_dbp, argp->pgno, ret);
  +			goto out;
  +		} else
  +			goto done;
  +	}
  +
  +	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
  +	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn);
  +	CHECK_LSN(env, op, cmp_p, &LSN(pagep), &argp->lsn);
  +	CHECK_ABORT(env, op, cmp_n, &LSN(pagep), lsnp);
  +	if (cmp_p == 0 && DB_REDO(op)) {
  +		REC_DIRTY(mpf, ip, dbc->priority, &pagep);
  +		bn = (BINTERNAL *)argp->hdr.data;
  +		if ((ret = __bam_ritem_nolog(dbc,
  +		    pagep, argp->indx, &argp->hdr, &argp->data, bn->type)) != 0)
  +			goto out;
  +		LSN(pagep) = *lsnp;
  +	} else if (cmp_n == 0 && DB_UNDO(op)) {
  +		REC_DIRTY(mpf, ip, dbc->priority, &pagep);
  +		bn = (BINTERNAL *)argp->old.data;
  +		if ((ret = __bam_ritem_nolog(dbc,
  +		    pagep, argp->indx, &argp->old, NULL, bn->type)) != 0)
  +			goto out;
  +		LSN(pagep) = argp->lsn;
  +	}
  +
  +	if ((ret = __memp_fput(mpf, ip, pagep, dbc->priority)) != 0)
  +		goto out;
  +	pagep = NULL;
  +
  +done:	*lsnp = argp->prev_lsn;
  +	ret = 0;
  +
  +out:	if (pagep != NULL)
  +		(void)__memp_fput(mpf, ip, pagep, dbc->priority);
  +	REC_CLOSE;
  +}
  +
  +/*
    * __bam_root_recover --
    *	Recovery function for setting the root page on the meta-data page.
    *
  @@ -1296,159 +1679,47 @@
   	 * of a reasonable type.  It's certainly unset, so if this is
   	 * an offpage dup set, we don't have an OPD cursor.  The
   	 * simplest solution is just to allocate a whole new cursor
  -	 * for our use;  we're only really using it to hold pass some
  -	 * state into __ram_ca, and this way we don't need to make
  -	 * this function know anything about how offpage dups work.
  -	 */
  -	if ((ret = __db_cursor_int(file_dbp, NULL,
  -		NULL, DB_RECNO, argp->root, 0, NULL, &rdbc)) != 0)
  -		goto out;
  -
  -	cp = (BTREE_CURSOR *)rdbc->internal;
  -	F_SET(cp, C_RENUMBER);
  -	cp->recno = argp->recno;
  -
  -	switch (argp->mode) {
  -	case CA_DELETE:
  -		/*
  -		 * The way to undo a delete is with an insert.  Since
  -		 * we're undoing it, the delete flag must be set.
  -		 */
  -		F_SET(cp, C_DELETED);
  -		F_SET(cp, C_RENUMBER);	/* Just in case. */
  -		cp->order = argp->order;
  -		if ((ret = __ram_ca(rdbc, CA_ICURRENT, NULL)) != 0)
  -			goto out;
  -		break;
  -	case CA_IAFTER:
  -	case CA_IBEFORE:
  -	case CA_ICURRENT:
  -		/*
  -		 * The way to undo an insert is with a delete.  The delete
  -		 * flag is unset to start with.
  -		 */
  -		F_CLR(cp, C_DELETED);
  -		cp->order = INVALID_ORDER;
  -		if ((ret = __ram_ca(rdbc, CA_DELETE, NULL)) != 0)
  -			goto out;
  -		break;
  -	}
  -
  -done:	*lsnp = argp->prev_lsn;
  -out:	if (rdbc != NULL && (t_ret = __dbc_close(rdbc)) != 0 && ret == 0)
  -		ret = t_ret;
  -	REC_CLOSE;
  -}
  -
  -/*
  - * __bam_relink_recover --
  - *	Recovery function for relink.
  - *
  - * PUBLIC: int __bam_relink_recover
  - * PUBLIC:   __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
  - */
  -int
  -__bam_relink_recover(env, dbtp, lsnp, op, info)
  -	ENV *env;
  -	DBT *dbtp;
  -	DB_LSN *lsnp;
  -	db_recops op;
  -	void *info;
  -{
  -	__bam_relink_args *argp;
  -	DB_THREAD_INFO *ip;
  -	DB *file_dbp;
  -	DBC *dbc;
  -	DB_MPOOLFILE *mpf;
  -	PAGE *pagep;
  -	int cmp_n, cmp_p, ret;
  -
  -	ip = ((DB_TXNHEAD *)info)->thread_info;
  -	pagep = NULL;
  -	REC_PRINT(__bam_relink_print);
  -	REC_INTRO(__bam_relink_read, ip, 0);
  -
  -	/*
  -	 * There are up to three pages we need to check -- the page, and the
  -	 * previous and next pages, if they existed.  For a page add operation,
  -	 * the current page is the result of a split and is being recovered
  -	 * elsewhere, so all we need do is recover the next page.
  -	 */
  -	if (argp->next == PGNO_INVALID)
  -		goto prev;
  -	if ((ret = __memp_fget(mpf, &argp->next, ip, NULL, 0, &pagep)) != 0) {
  -		if (ret != DB_PAGE_NOTFOUND) {
  -			ret = __db_pgerr(file_dbp, argp->next, ret);
  -			goto out;
  -		} else
  -			goto prev;
  -	}
  -
  -	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
  -	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn_next);
  -	CHECK_LSN(env, op, cmp_p, &LSN(pagep), &argp->lsn_next);
  -	CHECK_ABORT(env, op, cmp_n, &LSN(pagep), lsnp);
  -	if (cmp_p == 0 && DB_REDO(op)) {
  -		/* Redo the remove or replace. */
  -		REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
  -		if (argp->new_pgno == PGNO_INVALID)
  -			pagep->prev_pgno = argp->prev;
  -		else
  -			pagep->prev_pgno = argp->new_pgno;
  -
  -		pagep->lsn = *lsnp;
  -	} else if (cmp_n == 0 && DB_UNDO(op)) {
  -		/* Undo the remove or replace. */
  -		REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
  -		pagep->prev_pgno = argp->pgno;
  -
  -		pagep->lsn = argp->lsn_next;
  -	}
  -
  -	if ((ret = __memp_fput(mpf, ip, pagep, file_dbp->priority)) != 0)
  -		goto out;
  -	pagep = NULL;
  -
  -prev:	if (argp->prev == PGNO_INVALID)
  -		goto done;
  -	if ((ret = __memp_fget(mpf, &argp->prev, ip, NULL, 0, &pagep)) != 0) {
  -		if (ret != DB_PAGE_NOTFOUND) {
  -			ret = __db_pgerr(file_dbp, argp->prev, ret);
  -			goto out;
  -		} else
  -			goto done;
  -	}
  +	 * for our use;  we're only really using it to hold pass some
  +	 * state into __ram_ca, and this way we don't need to make
  +	 * this function know anything about how offpage dups work.
  +	 */
  +	if ((ret = __db_cursor_int(file_dbp, NULL,
  +		NULL, DB_RECNO, argp->root, 0, NULL, &rdbc)) != 0)
  +		goto out;
   
  -	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
  -	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn_prev);
  -	CHECK_LSN(env, op, cmp_p, &LSN(pagep), &argp->lsn_prev);
  -	CHECK_ABORT(env, op, cmp_n, &LSN(pagep), lsnp);
  -	if (cmp_p == 0 && DB_REDO(op)) {
  -		/* Redo the relink. */
  -		REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
  -		if (argp->new_pgno == PGNO_INVALID)
  -			pagep->next_pgno = argp->next;
  -		else
  -			pagep->next_pgno = argp->new_pgno;
  +	cp = (BTREE_CURSOR *)rdbc->internal;
  +	F_SET(cp, C_RENUMBER);
  +	cp->recno = argp->recno;
   
  -		pagep->lsn = *lsnp;
  -	} else if (cmp_n == 0 && DB_UNDO(op)) {
  -		/* Undo the relink. */
  -		REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
  -		pagep->next_pgno = argp->pgno;
  -		pagep->lsn = argp->lsn_prev;
  +	switch (argp->mode) {
  +	case CA_DELETE:
  +		/*
  +		 * The way to undo a delete is with an insert.  Since
  +		 * we're undoing it, the delete flag must be set.
  +		 */
  +		F_SET(cp, C_DELETED);
  +		F_SET(cp, C_RENUMBER);	/* Just in case. */
  +		cp->order = argp->order;
  +		if ((ret = __ram_ca(rdbc, CA_ICURRENT, NULL)) != 0)
  +			goto out;
  +		break;
  +	case CA_IAFTER:
  +	case CA_IBEFORE:
  +	case CA_ICURRENT:
  +		/*
  +		 * The way to undo an insert is with a delete.  The delete
  +		 * flag is unset to start with.
  +		 */
  +		F_CLR(cp, C_DELETED);
  +		cp->order = INVALID_ORDER;
  +		if ((ret = __ram_ca(rdbc, CA_DELETE, NULL)) != 0)
  +			goto out;
  +		break;
   	}
   
  -	if ((ret = __memp_fput(mpf,
  -	     ip, pagep, file_dbp->priority)) != 0)
  -		goto out;
  -	pagep = NULL;
  -
   done:	*lsnp = argp->prev_lsn;
  -	ret = 0;
  -
  -out:	if (pagep != NULL)
  -		(void)__memp_fput(mpf, ip, pagep, file_dbp->priority);
  +out:	if (rdbc != NULL && (t_ret = __dbc_close(rdbc)) != 0 && ret == 0)
  +		ret = t_ret;
   	REC_CLOSE;
   }
   
  @@ -1631,275 +1902,6 @@
   }
   
   /*
  - * __bam_merge_recover --
  - *	Recovery function for merge.
  - *
  - * PUBLIC: int __bam_merge_recover
  - * PUBLIC:   __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
  - */
  -int
  -__bam_merge_recover(env, dbtp, lsnp, op, info)
  -	ENV *env;
  -	DBT *dbtp;
  -	DB_LSN *lsnp;
  -	db_recops op;
  -	void *info;
  -{
  -	__bam_merge_args *argp;
  -	DB_THREAD_INFO *ip;
  -	BKEYDATA *bk;
  -	DB *file_dbp;
  -	DBC *dbc;
  -	DB_MPOOLFILE *mpf;
  -	PAGE *pagep;
  -	db_indx_t indx, *ninp, *pinp;
  -	u_int32_t size;
  -	u_int8_t *bp;
  -	int cmp_n, cmp_p, i, ret;
  -
  -	ip = ((DB_TXNHEAD *)info)->thread_info;
  -	REC_PRINT(__bam_merge_print);
  -	REC_INTRO(__bam_merge_read, ip, 1);
  -
  -	if ((ret = __memp_fget(mpf, &argp->pgno, ip, NULL, 0, &pagep)) != 0) {
  -		if (ret != DB_PAGE_NOTFOUND) {
  -			ret = __db_pgerr(file_dbp, argp->pgno, ret);
  -			goto out;
  -		} else
  -			goto next;
  -	}
  -
  -	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
  -	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn);
  -	CHECK_LSN(file_dbp->env, op, cmp_p, &LSN(pagep), &argp->lsn);
  -	CHECK_ABORT(file_dbp->env, op, cmp_n, &LSN(pagep), lsnp);
  -
  -	if (cmp_p == 0 && DB_REDO(op)) {
  -		/*
  -		 * When pg_copy is set, we are copying onto a new page.
  -		 */
  -		DB_ASSERT(env, !argp->pg_copy || NUM_ENT(pagep) == 0);
  -		REC_DIRTY(mpf, ip, dbc->priority, &pagep);
  -		if (argp->pg_copy) {
  -			P_INIT(pagep, file_dbp->pgsize, pagep->pgno,
  -			     PREV_PGNO(argp->hdr.data),
  -			     NEXT_PGNO(argp->hdr.data),
  -			     LEVEL(argp->hdr.data), TYPE(argp->hdr.data));
  -		}
  -		if (TYPE(pagep) == P_OVERFLOW) {
  -			OV_REF(pagep) = OV_REF(argp->hdr.data);
  -			OV_LEN(pagep) = OV_LEN(argp->hdr.data);
  -			bp = (u_int8_t *)pagep + P_OVERHEAD(file_dbp);
  -			memcpy(bp, argp->data.data, argp->data.size);
  -		} else {
  -			/* Copy the data segment. */
  -			bp = (u_int8_t *)pagep +
  -			     (db_indx_t)(HOFFSET(pagep) - argp->data.size);
  -			memcpy(bp, argp->data.data, argp->data.size);
  -
  -			/* Copy index table offset past the current entries. */
  -			pinp = P_INP(file_dbp, pagep) + NUM_ENT(pagep);
  -			ninp = P_INP(file_dbp, argp->hdr.data);
  -			for (i = 0; i < NUM_ENT(argp->hdr.data); i++)
  -				*pinp++ = *ninp++
  -				      - (file_dbp->pgsize - HOFFSET(pagep));
  -			HOFFSET(pagep) -= argp->data.size;
  -			NUM_ENT(pagep) += i;
  -		}
  -		pagep->lsn = *lsnp;
  -	} else if (cmp_n == 0 && !DB_REDO(op)) {
  -		REC_DIRTY(mpf, ip, dbc->priority, &pagep);
  -		if (TYPE(pagep) == P_OVERFLOW) {
  -			HOFFSET(pagep) = file_dbp->pgsize;
  -			goto setlsn;
  -		}
  -
  -		/*
  -		 * Since logging is logical at the page level we cannot just
  -		 * truncate the data space.  Delete the proper number of items
  -		 * from the logical end of the page.
  -		 */
  -		for (i = 0; i < NUM_ENT(argp->hdr.data); i++) {
  -			indx = NUM_ENT(pagep) - 1;
  -			if (P_INP(file_dbp, pagep)[indx] ==
  -			     P_INP(file_dbp, pagep)[indx - P_INDX]) {
  -				NUM_ENT(pagep)--;
  -				continue;
  -			}
  -			switch (TYPE(pagep)) {
  -			case P_LBTREE:
  -			case P_LRECNO:
  -			case P_LDUP:
  -				bk = GET_BKEYDATA(file_dbp, pagep, indx);
  -				size = BITEM_SIZE(bk);
  -				break;
  -
  -			case P_IBTREE:
  -				size = BINTERNAL_SIZE(
  -				     GET_BINTERNAL(file_dbp, pagep, indx)->len);
  -				break;
  -			case P_IRECNO:
  -				size = RINTERNAL_SIZE;
  -				break;
  -
  -			default:
  -				ret = __db_pgfmt(env, PGNO(pagep));
  -				goto out;
  -			}
  -			if ((ret = __db_ditem(dbc, pagep, indx, size)) != 0)
  -				goto out;
  -		}
  -setlsn:		pagep->lsn = argp->lsn;
  -	}
  -
  -	if ((ret = __memp_fput(mpf, ip, pagep, dbc->priority)) != 0)
  -		goto out;
  -
  -next:	if ((ret = __memp_fget(mpf, &argp->npgno, ip, NULL, 0, &pagep)) != 0) {
  -		if (ret != DB_PAGE_NOTFOUND) {
  -			ret = __db_pgerr(file_dbp, argp->pgno, ret);
  -			goto out;
  -		} else
  -			goto done;
  -	}
  -
  -	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
  -	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->nlsn);
  -	CHECK_LSN(file_dbp->env, op, cmp_p, &LSN(pagep), &argp->nlsn);
  -
  -	if (cmp_p == 0 && DB_REDO(op)) {
  -		/* Need to truncate the page. */
  -		REC_DIRTY(mpf, ip, dbc->priority, &pagep);
  -		HOFFSET(pagep) = file_dbp->pgsize;
  -		NUM_ENT(pagep) = 0;
  -		pagep->lsn = *lsnp;
  -	} else if (cmp_n == 0 && !DB_REDO(op)) {
  -		/* Need to put the data back on the page. */
  -		REC_DIRTY(mpf, ip, dbc->priority, &pagep);
  -		if (TYPE(pagep) == P_OVERFLOW) {
  -			OV_REF(pagep) = OV_REF(argp->hdr.data);
  -			OV_LEN(pagep) = OV_LEN(argp->hdr.data);
  -			bp = (u_int8_t *)pagep + P_OVERHEAD(file_dbp);
  -			memcpy(bp, argp->data.data, argp->data.size);
  -		} else {
  -			bp = (u_int8_t *)pagep +
  -			     (db_indx_t)(HOFFSET(pagep) - argp->data.size);
  -			memcpy(bp, argp->data.data, argp->data.size);
  -
  -			/* Copy index table. */
  -			pinp = P_INP(file_dbp, pagep) + NUM_ENT(pagep);
  -			ninp = P_INP(file_dbp, argp->hdr.data);
  -			for (i = 0; i < NUM_ENT(argp->hdr.data); i++)
  -				*pinp++ = *ninp++;
  -			HOFFSET(pagep) -= argp->data.size;
  -			NUM_ENT(pagep) += i;
  -		}
  -		pagep->lsn = argp->nlsn;
  -	}
  -
  -	if ((ret = __memp_fput(mpf,
  -	     ip, pagep, dbc->priority)) != 0)
  -		goto out;
  -done:
  -	*lsnp = argp->prev_lsn;
  -	ret = 0;
  -
  -out:	REC_CLOSE;
  -}
  -
  -/*
  - * __bam_pgno_recover --
  - *	Recovery function for page number replacment.
  - *
  - * PUBLIC: int __bam_pgno_recover
  - * PUBLIC:   __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
  - */
  -int
  -__bam_pgno_recover(env, dbtp, lsnp, op, info)
  -	ENV *env;
  -	DBT *dbtp;
  -	DB_LSN *lsnp;
  -	db_recops op;
  -	void *info;
  -{
  -	BINTERNAL *bi;
  -	__bam_pgno_args *argp;
  -	DB_THREAD_INFO *ip;
  -	DB *file_dbp;
  -	DBC *dbc;
  -	DB_MPOOLFILE *mpf;
  -	PAGE *pagep, *npagep;
  -	db_pgno_t *pgnop;
  -	int cmp_n, cmp_p, ret;
  -
  -	ip = ((DB_TXNHEAD *)info)->thread_info;
  -	REC_PRINT(__bam_pgno_print);
  -	REC_INTRO(__bam_pgno_read, ip, 0);
  -
  -	REC_FGET(mpf, ip, argp->pgno, &pagep, done);
  -
  -	cmp_n = LOG_COMPARE(lsnp, &LSN(pagep));
  -	cmp_p = LOG_COMPARE(&LSN(pagep), &argp->lsn);
  -	CHECK_LSN(file_dbp->env, op, cmp_p, &LSN(pagep), &argp->lsn);
  -	CHECK_ABORT(file_dbp->env, op, cmp_n, &LSN(pagep), lsnp);
  -
  -	if ((cmp_p == 0 && DB_REDO(op)) || (cmp_n == 0 && !DB_REDO(op))) {
  -		switch (TYPE(pagep)) {
  -		case P_IBTREE:
  -			/*
  -			 * An internal record can have both a overflow
  -			 * and child pointer.  Fetch the page to see
  -			 * which it is.
  -			 */
  -			bi = GET_BINTERNAL(file_dbp, pagep, argp->indx);
  -			if (B_TYPE(bi->type) == B_OVERFLOW) {
  -				REC_FGET(mpf, ip, argp->npgno, &npagep, out);
  -
  -				if (TYPE(npagep) == P_OVERFLOW)
  -					pgnop =
  -					     &((BOVERFLOW *)(bi->data))->pgno;
  -				else
  -					pgnop = &bi->pgno;
  -				if ((ret = __memp_fput(mpf, ip,
  -				    npagep, file_dbp->priority)) != 0)
  -					goto out;
  -				break;
  -			}
  -			pgnop = &bi->pgno;
  -			break;
  -		case P_IRECNO:
  -			pgnop =
  -			     &GET_RINTERNAL(file_dbp, pagep, argp->indx)->pgno;
  -			break;
  -		default:
  -			pgnop =
  -			     &GET_BOVERFLOW(file_dbp, pagep, argp->indx)->pgno;
  -			break;
  -		}
  -
  -		if (DB_REDO(op)) {
  -			/* Need to redo update described. */
  -			REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
  -			*pgnop = argp->npgno;
  -			pagep->lsn = *lsnp;
  -		} else {
  -			REC_DIRTY(mpf, ip, file_dbp->priority, &pagep);
  -			*pgnop = argp->opgno;
  -			pagep->lsn = argp->lsn;
  -		}
  -	}
  -
  -	if ((ret = __memp_fput(mpf, ip, pagep, file_dbp->priority)) != 0)
  -		goto out;
  -
  -done:
  -	*lsnp = argp->prev_lsn;
  -	ret = 0;
  -
  -out:	REC_CLOSE;
  -}
  -
  -/*
    * __bam_relink_43_recover --
    *	Recovery function for relink.
    *
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_reclaim.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_reclaim.c
  --- db/btree/bt_reclaim.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_reclaim.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1998-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1998, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -43,7 +43,7 @@
   
   	/* Walk the tree, freeing pages. */
   	ret = __bam_traverse(dbc,
  -	    DB_LOCK_WRITE, dbc->internal->root, __db_reclaim_callback, NULL);
  +	    DB_LOCK_WRITE, PGNO_INVALID, __db_reclaim_callback, NULL);
   
   	if ((t_ret = __TLPUT(dbc, meta_lock)) != 0 && ret == 0)
   		ret = t_ret;
  @@ -82,7 +82,7 @@
   
   	/* Walk the tree, freeing pages. */
   	ret = __bam_traverse(dbc,
  -	    DB_LOCK_WRITE, dbc->internal->root, __db_truncate_callback, &count);
  +	    DB_LOCK_WRITE, PGNO_INVALID, __db_truncate_callback, &count);
   
   #ifdef HAVE_COMPRESSION
   	if (DB_IS_COMPRESSED(dbc->dbp)) {
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_recno.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_recno.c
  --- db/btree/bt_recno.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_recno.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -18,7 +18,10 @@
   static int  __ram_source __P((DB *));
   static int  __ram_sread __P((DBC *, db_recno_t));
   static int  __ram_update __P((DBC *, db_recno_t, int));
  -
  +static int __ram_ca_getorder
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
  +static int __ram_ca_setorder
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
   /*
    * In recno, there are two meanings to the on-page "deleted" flag.  If we're
    * re-numbering records, it means the record was implicitly created.  We skip
  @@ -257,8 +260,8 @@
   
   	if (F_ISSET(cp, C_RENUMBER)) {
   		/* If we are going to drop the page, lock its neighbors. */
  -		if (STD_LOCKING(dbc) &&
  -		    NUM_ENT(cp->page) == 1 && PGNO(cp->page) != cp->root) {
  +		if (STD_LOCKING(dbc) && NUM_ENT(cp->page) == 1 &&
  +		    PGNO(cp->page) != BAM_ROOT_PGNO(dbc)) {
   			if ((npgno = NEXT_PGNO(cp->page)) != PGNO_INVALID)
   				TRY_LOCK(dbc, npgno, save_npgno,
   				    next_lock, DB_LOCK_WRITE, retry);
  @@ -277,9 +280,9 @@
   			goto err;
   		if ((ret = __ram_ca(dbc, CA_DELETE, &nc)) != 0)
   			goto err;
  -		if (nc > 0 &&
  -		    CURADJ_LOG(dbc) && (ret = __bam_rcuradj_log(dbp, dbc->txn,
  -		    &lsn, 0, CA_DELETE, cp->root, cp->recno, cp->order)) != 0)
  +		if (nc > 0 && CURADJ_LOG(dbc) &&
  +		    (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0,
  +		    CA_DELETE, BAM_ROOT_PGNO(dbc), cp->recno, cp->order)) != 0)
   			goto err;
   
   		/*
  @@ -295,7 +298,8 @@
   		 * around until the last cursor referencing the empty tree is
   		 * are closed, and then clean it up.
   		 */
  -		if (NUM_ENT(cp->page) == 0 && PGNO(cp->page) != cp->root) {
  +		if (NUM_ENT(cp->page) == 0 &&
  +		    PGNO(cp->page) != BAM_ROOT_PGNO(dbc)) {
   			/*
   			 * We want to delete a single item out of the last page
   			 * that we're not deleting.
  @@ -629,8 +633,9 @@
   			    &cp->recno, data, DB_APPEND, 0)) != 0)
   				return (ret);
   			if (CURADJ_LOG(dbc) &&
  -			    (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0,
  -			    CA_ICURRENT, cp->root, cp->recno, cp->order)) != 0)
  +			    (ret = __bam_rcuradj_log(dbp, dbc->txn,
  +			    &lsn, 0, CA_ICURRENT,
  +			    BAM_ROOT_PGNO(dbc), cp->recno, cp->order)) != 0)
   				return (ret);
   			return (0);
   		default:
  @@ -706,7 +711,7 @@
   		/* Only log if __ram_ca found any relevant cursors. */
   		if (nc > 0 && CURADJ_LOG(dbc) &&
   		    (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0, CA_IAFTER,
  -		    cp->root, cp->recno, cp->order)) != 0)
  +		    BAM_ROOT_PGNO(dbc), cp->recno, cp->order)) != 0)
   			goto err;
   		break;
   	case DB_BEFORE:
  @@ -717,7 +722,7 @@
   		/* Only log if __ram_ca found any relevant cursors. */
   		if (nc > 0 && CURADJ_LOG(dbc) &&
   		    (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0, CA_IBEFORE,
  -		    cp->root, cp->recno, cp->order)) != 0)
  +		    BAM_ROOT_PGNO(dbc), cp->recno, cp->order)) != 0)
   			goto err;
   		break;
   	case DB_CURRENT:
  @@ -732,9 +737,9 @@
   		/* Only log if __ram_ca found any relevant cursors. */
   		if ((ret = __ram_ca(dbc, CA_ICURRENT, &nc)) != 0)
   			goto err;
  -		if (nc > 0 && CURADJ_LOG(dbc) &&
  -		    (ret = __bam_rcuradj_log(dbp, dbc->txn, &lsn, 0,
  -		    CA_ICURRENT, cp->root, cp->recno, cp->order)) != 0)
  +		if (nc > 0 && CURADJ_LOG(dbc) && (ret = __bam_rcuradj_log(dbp,
  +		    dbc->txn, &lsn, 0, CA_ICURRENT,
  +		    BAM_ROOT_PGNO(dbc), cp->recno, cp->order)) != 0)
   			goto err;
   		break;
   	default:
  @@ -753,6 +758,122 @@
   	return (ret);
   }
   
  +static int
  +__ram_ca_getorder(dbc, my_dbc, orderp, root_pgno, recno, args)
  +	DBC *dbc, *my_dbc;
  +	u_int32_t *orderp;
  +	db_pgno_t root_pgno;
  +	u_int32_t recno;
  +	void *args;
  +{
  +	BTREE_CURSOR *cp;
  +
  +	COMPQUIET(my_dbc, NULL);
  +	COMPQUIET(args, NULL);
  +
  +	cp = (BTREE_CURSOR *)dbc->internal;
  +	if (root_pgno == BAM_ROOT_PGNO(dbc) &&
  +	    recno == cp->recno && CD_ISSET(cp) &&
  +	    *orderp <= cp->order &&
  +	    !MVCC_SKIP_CURADJ(dbc, BAM_ROOT_PGNO(dbc)))
  +		*orderp = cp->order;
  +	return (0);
  +}
  +
  +static int
  +__ram_ca_setorder(dbc, my_dbc, foundp, pgno, order, args)
  +	DBC *dbc, *my_dbc;
  +	u_int32_t *foundp;
  +	db_pgno_t pgno;
  +	u_int32_t order;
  +	void *args;
  +{
  +	BTREE_CURSOR *cp, *cp_arg;
  +	int adjusted;
  +	ca_recno_arg op;
  +	db_recno_t recno;
  +
  +	COMPQUIET(pgno, 0);
  +
  +	cp = (BTREE_CURSOR *)dbc->internal;
  +	cp_arg = (BTREE_CURSOR *)my_dbc->internal;
  +	op = *(ca_recno_arg *)args;
  +
  +	if (cp_arg->root != cp->root ||
  +	    MVCC_SKIP_CURADJ(dbc, BAM_ROOT_PGNO(dbc)))
  +		return (0);
  +	++(*foundp);
  +	adjusted = 0;
  +	recno = cp_arg->recno;
  +	switch (op) {
  +	case CA_DELETE:
  +		if (recno < cp->recno) {
  +			--cp->recno;
  +			/*
  +			 * If the adjustment made them equal,
  +			 * we have to merge the orders.
  +			 */
  +			if (recno == cp->recno && CD_ISSET(cp))
  +				cp->order += order;
  +		} else if (recno == cp->recno &&
  +		    !CD_ISSET(cp)) {
  +			CD_SET(cp);
  +			cp->order = order;
  +			/*
  +			 * If we're deleting the item, we can't
  +			 * keep a streaming offset cached.
  +			 */
  +			cp->stream_start_pgno = PGNO_INVALID;
  +		}
  +		break;
  +	case CA_IBEFORE:
  +		/*
  +		 * IBEFORE is just like IAFTER, except that we
  +		 * adjust cursors on the current record too.
  +		 */
  +		if (C_EQUAL(cp_arg, cp)) {
  +			++cp->recno;
  +			adjusted = 1;
  +		}
  +		goto iafter;
  +	case CA_ICURRENT:
  +
  +		/*
  +		 * If the original cursor wasn't deleted, we
  +		 * just did a replacement and so there's no
  +		 * need to adjust anything--we shouldn't have
  +		 * gotten this far.  Otherwise, we behave
  +		 * much like an IAFTER, except that all
  +		 * cursors pointing to the current item get
  +		 * marked undeleted and point to the new
  +		 * item.
  +		 */
  +		DB_ASSERT(dbc->dbp->env, CD_ISSET(cp_arg));
  +		if (C_EQUAL(cp_arg, cp)) {
  +			CD_CLR(cp);
  +			break;
  +		}
  +		/* FALLTHROUGH */
  +	case CA_IAFTER:
  +iafter:		if (!adjusted && C_LESSTHAN(cp_arg, cp)) {
  +			++cp->recno;
  +			adjusted = 1;
  +		}
  +		if (recno == cp->recno && adjusted)
  +			/*
  +			 * If we've moved this cursor's recno,
  +			 * split its order number--i.e.,
  +			 * decrement it by enough so that
  +			 * the lowest cursor moved has order 1.
  +			 * cp_arg->order is the split point,
  +			 * so decrement by one less than that.
  +			 */
  +			cp->order -= (cp_arg->order - 1);
  +		break;
  +	}
  +	return (0);
  +}
  +
   /*
    * __ram_ca --
    *	Adjust cursors.  Returns the number of relevant cursors.
  @@ -765,13 +886,12 @@
   	ca_recno_arg op;
   	int *foundp;
   {
  -	BTREE_CURSOR *cp, *cp_arg;
  -	DB *dbp, *ldbp;
  -	DBC *dbc;
  +	BTREE_CURSOR *cp_arg;
  +	DB *dbp;
   	ENV *env;
   	db_recno_t recno;
  -	u_int32_t order;
  -	int adjusted, found;
  +	u_int32_t found, order;
  +	int ret;
   
   	dbp = dbc_arg->dbp;
   	env = dbp->env;
  @@ -784,7 +904,6 @@
   	 */
   	DB_ASSERT(env, F_ISSET(cp_arg, C_RENUMBER));
   
  -	MUTEX_LOCK(env, env->mtx_dblist);
   	/*
   	 * Adjust the cursors.  See the comment in __bam_ca_delete().
   	 *
  @@ -795,110 +914,18 @@
   	 * the cursor list.
   	 */
   	if (op == CA_DELETE) {
  -		FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -		for (order = 1;
  -		    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -		    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -			MUTEX_LOCK(env, dbp->mutex);
  -			TAILQ_FOREACH(dbc, &ldbp->active_queue, links) {
  -				cp = (BTREE_CURSOR *)dbc->internal;
  -				if (cp_arg->root == cp->root &&
  -				    recno == cp->recno && CD_ISSET(cp) &&
  -				    order <= cp->order &&
  -				    !MVCC_SKIP_CURADJ(dbc, cp->root))
  -					order = cp->order + 1;
  -			}
  -			MUTEX_UNLOCK(env, dbp->mutex);
  -		}
  +		if ((ret = __db_walk_cursors(dbp, NULL, __ram_ca_getorder,
  +		    &order, BAM_ROOT_PGNO(dbc_arg), recno, NULL)) != 0)
  +			return (ret);
  +		order++;
   	} else
   		order = INVALID_ORDER;
   
  -	/* Now go through and do the actual adjustments. */
  -	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  -	for (found = 0;
  -	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  -	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  -		MUTEX_LOCK(env, dbp->mutex);
  -		TAILQ_FOREACH(dbc, &ldbp->active_queue, links) {
  -			cp = (BTREE_CURSOR *)dbc->internal;
  -			if (cp_arg->root != cp->root ||
  -			    MVCC_SKIP_CURADJ(dbc, cp->root))
  -				continue;
  -			++found;
  -			adjusted = 0;
  -			switch (op) {
  -			case CA_DELETE:
  -				if (recno < cp->recno) {
  -					--cp->recno;
  -					/*
  -					 * If the adjustment made them equal,
  -					 * we have to merge the orders.
  -					 */
  -					if (recno == cp->recno && CD_ISSET(cp))
  -						cp->order += order;
  -				} else if (recno == cp->recno &&
  -				    !CD_ISSET(cp)) {
  -					CD_SET(cp);
  -					cp->order = order;
  -					/*
  -					 * If we're deleting the item, we can't
  -					 * keep a streaming offset cached.
  -					 */
  -					cp->stream_start_pgno = PGNO_INVALID;
  -				}
  -				break;
  -			case CA_IBEFORE:
  -				/*
  -				 * IBEFORE is just like IAFTER, except that we
  -				 * adjust cursors on the current record too.
  -				 */
  -				if (C_EQUAL(cp_arg, cp)) {
  -					++cp->recno;
  -					adjusted = 1;
  -				}
  -				goto iafter;
  -			case CA_ICURRENT:
  -
  -				/*
  -				 * If the original cursor wasn't deleted, we
  -				 * just did a replacement and so there's no
  -				 * need to adjust anything--we shouldn't have
  -				 * gotten this far.  Otherwise, we behave
  -				 * much like an IAFTER, except that all
  -				 * cursors pointing to the current item get
  -				 * marked undeleted and point to the new
  -				 * item.
  -				 */
  -				DB_ASSERT(env, CD_ISSET(cp_arg));
  -				if (C_EQUAL(cp_arg, cp)) {
  -					CD_CLR(cp);
  -					break;
  -				}
  -				/* FALLTHROUGH */
  -			case CA_IAFTER:
  -iafter:				if (!adjusted && C_LESSTHAN(cp_arg, cp)) {
  -					++cp->recno;
  -					adjusted = 1;
  -				}
  -				if (recno == cp->recno && adjusted)
  -					/*
  -					 * If we've moved this cursor's recno,
  -					 * split its order number--i.e.,
  -					 * decrement it by enough so that
  -					 * the lowest cursor moved has order 1.
  -					 * cp_arg->order is the split point,
  -					 * so decrement by one less than that.
  -					 */
  -					cp->order -= (cp_arg->order - 1);
  -				break;
  -			}
  -		}
  -		MUTEX_UNLOCK(dbp->env, dbp->mutex);
  -	}
  -	MUTEX_UNLOCK(env, env->mtx_dblist);
  -
  +	if ((ret = __db_walk_cursors(dbp, dbc_arg,
  +	    __ram_ca_setorder, &found, 0, order, &op)) != 0)
  +		return (ret);
   	if (foundp != NULL)
  -		*foundp = found;
  +		*foundp = (int)found;
   	return (0);
   }
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_rsearch.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_rsearch.c
  --- db/btree/bt_rsearch.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_rsearch.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ -98,7 +98,7 @@
   	 * Retrieve the root page.
   	 */
   
  -	if ((ret = __bam_get_root(dbc, cp->root, stop, flags, &stack)) != 0)
  +	if ((ret = __bam_get_root(dbc, PGNO_INVALID, stop, flags, &stack)) != 0)
   		return (ret);
   	lock_mode = cp->csp->lock_mode;
   	get_mode = lock_mode == DB_LOCK_WRITE ? DB_MPOOL_DIRTY : 0;
  @@ -382,7 +382,7 @@
   	dbp = dbc->dbp;
   	mpf = dbp->mpf;
   	cp = (BTREE_CURSOR *)dbc->internal;
  -	root_pgno = cp->root;
  +	root_pgno = BAM_ROOT_PGNO(dbc);
   
   	/* Update the record counts for the tree. */
   	for (epg = cp->sp; epg <= cp->csp; ++epg) {
  @@ -435,20 +435,21 @@
   	db_pgno_t pgno;
   	int ret, t_ret;
   
  +	COMPQUIET(h, NULL);
   	dbp = dbc->dbp;
   	mpf = dbp->mpf;
  +	LOCK_INIT(lock);
   
  -	pgno = dbc->internal->root;
  -	if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0)
  -		return (ret);
  -	if ((ret = __memp_fget(mpf, &pgno,
  -	     dbc->thread_info, dbc->txn, 0, &h)) != 0)
  -		return (ret);
  +	pgno = PGNO_INVALID;
  +	BAM_GET_ROOT(dbc, pgno, h, 0, DB_LOCK_READ, lock, ret);
  +	if (ret != 0)
  +		goto err;
  +	DB_ASSERT(dbp->env, h != NULL);
   
   	*rep = RE_NREC(h);
   
   	ret = __memp_fput(mpf, dbc->thread_info, h, dbc->priority);
  -	if ((t_ret = __TLPUT(dbc, lock)) != 0 && ret == 0)
  +err:	if ((t_ret = __TLPUT(dbc, lock)) != 0 && ret == 0)
   		ret = t_ret;
   
   	return (ret);
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_search.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 bt_search.c
  --- db/btree/bt_search.c	16 Sep 2009 19:34:37 -0000	1.10
  +++ db/btree/bt_search.c	23 Aug 2010 13:36:23 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ -57,9 +57,9 @@
    * PUBLIC: int __bam_get_root __P((DBC *, db_pgno_t, int, u_int32_t, int *));
    */
   int
  -__bam_get_root(dbc, pg, slevel, flags, stack)
  +__bam_get_root(dbc, root_pgno, slevel, flags, stack)
   	DBC *dbc;
  -	db_pgno_t pg;
  +	db_pgno_t root_pgno;
   	int slevel;
   	u_int32_t flags;
   	int *stack;
  @@ -73,6 +73,7 @@
   	u_int32_t get_mode;
   	int ret, t_ret;
   
  +	COMPQUIET(h, NULL);
   	LOCK_INIT(lock);
   	dbp = dbc->dbp;
   	mpf = dbp->mpf;
  @@ -93,11 +94,6 @@
   	if (*stack ||
   	    LF_ISSET(SR_DEL) || (LF_ISSET(SR_NEXT) && LF_ISSET(SR_WRITE)))
   		lock_mode = DB_LOCK_WRITE;
  -	if ((lock_mode == DB_LOCK_WRITE || F_ISSET(dbc, DBC_DOWNREV) ||
  -	    dbc->dbtype == DB_RECNO || F_ISSET(cp, C_RECNUM))) {
  -lock_it:	if ((ret = __db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0)
  -			return (ret);
  -	}
   
   	/*
   	 * Get the root.  If the root happens to be a leaf page then
  @@ -106,21 +102,31 @@
   	 * If we can't get the root shared, then get a lock on it and
   	 * then wait for the latch.
   	 */
  -	if (lock_mode == DB_LOCK_WRITE)
  +retry:	if (lock_mode == DB_LOCK_WRITE)
   		get_mode = DB_MPOOL_DIRTY;
  -	else if (LOCK_ISSET(lock) || !STD_LOCKING(dbc))
  +	else if (LOCK_ISSET(lock) || !STD_LOCKING(dbc) ||
  +	    F_ISSET(dbc, DBC_DOWNREV) ||
  +	    dbc->dbtype == DB_RECNO || F_ISSET(cp, C_RECNUM))
   		get_mode = 0;
   	else
   		get_mode = DB_MPOOL_TRY;
   
  -	if ((ret = __memp_fget(mpf, &pg,
  -	    dbc->thread_info, dbc->txn, get_mode, &h)) != 0) {
  -		if (ret == DB_LOCK_NOTGRANTED)
  -			goto lock_it;
  +	BAM_GET_ROOT(dbc, root_pgno, h, get_mode, lock_mode, lock, ret);
  +	if (ret == DB_LOCK_NOTGRANTED && get_mode == DB_MPOOL_TRY) {
  +		DB_ASSERT(dbp->env, !LOCK_ISSET(lock));
  +		if ((ret = __db_lget(dbc, 0,
  +		    root_pgno == PGNO_INVALID ? BAM_ROOT_PGNO(dbc) : root_pgno,
  +		    lock_mode, 0, &lock)) != 0)
  +			return (ret);
  +		goto retry;
  +	}
  +	if (ret != 0) {
   		/* Did not read it, so we can release the lock */
   		(void)__LPUT(dbc, lock);
   		return (ret);
   	}
  +	DB_ASSERT(dbp->env, TYPE(h) == P_IBTREE || TYPE(h) == P_IRECNO ||
  +	    TYPE(h) == P_LBTREE || TYPE(h) == P_LRECNO || TYPE(h) == P_LDUP);
   
   	/*
   	 * Decide if we need to dirty and/or lock this page.
  @@ -141,7 +147,7 @@
   
   		/*
   		 * Now that we know what level the root is at, do we need a
  -		 * write lock?  If not and we got the lock before latching
  +		 * write lock?  If not or we got the lock before latching
   		 * we are done.
   		 */
   		if (LEVEL(h) != LEAFLEVEL || LF_ISSET(SR_WRITE)) {
  @@ -163,8 +169,8 @@
   			}
   		} else {
   			/* Try to lock the page without waiting first. */
  -			if ((ret = __db_lget(dbc,
  -			    0, pg, lock_mode, DB_LOCK_NOWAIT, &lock)) == 0) {
  +			if ((ret = __db_lget(dbc, 0, root_pgno,
  +			    lock_mode, DB_LOCK_NOWAIT, &lock)) == 0) {
   				if (lock_mode == DB_LOCK_WRITE && (ret =
   				    __memp_dirty(mpf, &h, dbc->thread_info,
   				    dbc->txn, dbc->priority, 0)) != 0) {
  @@ -188,12 +194,15 @@
   
   			if (ret != 0)
   				return (ret);
  +			get_mode = 0;
  +			if (lock_mode == DB_LOCK_WRITE)
  +				get_mode = DB_MPOOL_DIRTY;
   
   			if ((ret = __db_lget(dbc,
  -			     0, pg, lock_mode, 0, &lock)) != 0)
  +			     0, root_pgno, lock_mode, 0, &lock)) != 0)
   				return (ret);
   			if ((ret = __memp_fget(mpf,
  -			     &pg, dbc->thread_info, dbc->txn,
  +			     &root_pgno, dbc->thread_info, dbc->txn,
   			     lock_mode == DB_LOCK_WRITE ? DB_MPOOL_DIRTY : 0,
   			     &h)) != 0) {
   				/* Did not read it, release the lock */
  @@ -250,7 +259,7 @@
   	PAGE *h, *parent_h;
   	db_indx_t base, i, indx, *inp, lim;
   	db_lockmode_t lock_mode;
  -	db_pgno_t pg, saved_pg;
  +	db_pgno_t pg, saved_pg, start_pgno;
   	db_recno_t recno;
   	int adjust, cmp, deloffset, ret, set_stack, stack, t_ret;
   	int getlock, was_next;
  @@ -283,16 +292,14 @@
   	 * regardless.  See btree.h for more details.
   	 */
   
  -	if (root_pgno == PGNO_INVALID)
  -		root_pgno = cp->root;
  -	saved_pg = root_pgno;
  +	start_pgno = saved_pg = root_pgno;
   	saved_level = MAXBTREELEVEL;
  -retry:	if ((ret = __bam_get_root(dbc, root_pgno, slevel, flags, &stack)) != 0)
  +retry:	if ((ret = __bam_get_root(dbc, start_pgno, slevel, flags, &stack)) != 0)
   		goto err;
   	lock_mode = cp->csp->lock_mode;
   	get_mode = lock_mode == DB_LOCK_WRITE ? DB_MPOOL_DIRTY : 0;
   	h = cp->csp->page;
  -	pg = PGNO(h);
  +	root_pgno = pg = PGNO(h);
   	lock = cp->csp->lock;
   	set_stack = stack;
   	/*
  @@ -675,8 +682,7 @@
   				 * again or exit without actually looking
   				 * at the data.
   				 */
  -				if ((t_ret = __LPUT(dbc, lock)) != 0 &&
  -				    ret == 0)
  +				if ((t_ret = __LPUT(dbc, lock)) != 0)
   					ret = t_ret;
   				/*
   				 * If we blocked at a different level release
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_split.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_split.c
  --- db/btree/bt_split.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_split.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ -69,7 +69,6 @@
   	int exact, level, ret;
   
   	cp = (BTREE_CURSOR *)dbc->internal;
  -	root_pgno = cp->root;
   	LOCK_INIT(next_lock);
   	next_pgno = PGNO_INVALID;
   
  @@ -82,6 +81,7 @@
   	if ((ret = __db_lget(dbc,
   	    0, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0)
   		goto err;
  +	root_pgno = BAM_ROOT_PGNO(dbc);
   
   	/*
   	 * The locking protocol we use to avoid deadlock to acquire locks by
  @@ -183,8 +183,9 @@
   		}
   	}
   
  -err:	if (root_pgnop != NULL)
  -		*root_pgnop = cp->root;
  +	if (root_pgnop != NULL)
  +		*root_pgnop = BAM_ROOT_PGNO(dbc);
  +err:
   done:	(void)__LPUT(dbc, metalock);
   	(void)__TLPUT(dbc, next_lock);
   	return (ret);
  @@ -278,12 +279,15 @@
   		    (BTREE_CURSOR *)dbc->internal, C_RECNUM) ? SPL_NRECS : 0;
   		if (dbc->dbtype == DB_RECNO)
   			opflags |= SPL_RECNO;
  -		ret = __bam_split_log(dbp,
  -		    dbc->txn, &LSN(cp->page), 0, PGNO(lp), &LSN(lp), PGNO(rp),
  -		    &LSN(rp), (u_int32_t)NUM_ENT(lp), PGNO_INVALID, &log_lsn,
  -		    dbc->internal->root, &LSN(cp->page), 0,
  -		    &log_dbt, &rootent[0], &rootent[1], opflags);
  +		ret = __bam_split_log(dbp, dbc->txn, &LSN(cp->page), 0,
  +		    OP_SET(opflags, cp->page), PGNO(lp), &LSN(lp),
  +		    PGNO(rp), &LSN(rp), (u_int32_t)NUM_ENT(lp),
  +		    PGNO_INVALID, &log_lsn, PGNO(cp->page),
  +		    &LSN(cp->page), 0, &log_dbt, &rootent[0], &rootent[1]);
   
  +		/* On failure, restore the page. */
  +		if (ret != 0)
  +			memcpy(cp->page, log_dbt.data, dbp->pgsize);
   		__os_free(dbp->env, log_dbt.data);
   
   		if (ret != 0)
  @@ -431,11 +435,13 @@
   	DB_ASSERT(dbp->env, IS_DIRTY(cp->page));
   	DB_ASSERT(dbp->env, IS_DIRTY(pp->page));
   
  +	bc = (BTREE_CURSOR *)dbc->internal;
  +
   	/* Actually update the parent page. */
  -	if ((ret = __bam_pinsert(dbc, pp, split, lp, rp, BPI_NOLOGGING)) != 0)
  +	if ((ret = __bam_pinsert(dbc,
  +	    pp, split, lp, rp, F_ISSET(bc, C_RECNUM) ? 0 : BPI_NOLOGGING)) != 0)
   		goto err;
   
  -	bc = (BTREE_CURSOR *)dbc->internal;
   	/* Log the change. */
   	if (DBC_LOGGING(dbc)) {
   		memset(&log_dbt, 0, sizeof(log_dbt));
  @@ -452,19 +458,24 @@
   			    BINTERNAL_SIZE(((BINTERNAL *)rentry.data)->len);
   		if (tp == NULL)
   			ZERO_LSN(log_lsn);
  -		if ((ret = __bam_split_log(dbp, dbc->txn, &LSN(cp->page), 0,
  -		    PGNO(cp->page), &LSN(cp->page), PGNO(alloc_rp),
  -		    &LSN(alloc_rp), (u_int32_t)NUM_ENT(lp),
  -		    tp == NULL ? 0 : PGNO(tp), tp == NULL ? &log_lsn : &LSN(tp),
  -		    PGNO(pp->page), &LSN(pp->page), pp->indx,
  -		    &log_dbt, NULL, &rentry, opflags)) != 0) {
  +		if ((ret = __bam_split_log(dbp, dbc->txn, &LSN(cp->page),
  +		    0, OP_SET(opflags, pp->page), PGNO(cp->page),
  +		    &LSN(cp->page), PGNO(alloc_rp), &LSN(alloc_rp),
  +		    (u_int32_t)NUM_ENT(lp), tp == NULL ? 0 : PGNO(tp),
  +		    tp == NULL ? &log_lsn : &LSN(tp), PGNO(pp->page),
  +		    &LSN(pp->page), pp->indx, &log_dbt, NULL, &rentry)) != 0) {
   			/*
  -			 * Undo the update to the parent page, which has not
  -			 * been logged yet. This must succeed.
  +			 * If this is not RECNO then undo the update
  +			 * to the parent page, which has not been
  +			 * logged yet. This must succeed.  Renco
  +			 * database trees are locked and therefore
  +			 * the parent can be logged independently.
   			 */
  -			t_ret = __db_ditem_nolog(dbc, pp->page,
  -			    pp->indx + 1, rentry.size);
  -			DB_ASSERT(dbp->env, t_ret == 0);
  +			if (F_ISSET(bc, C_RECNUM) == 0) {
  +				t_ret = __db_ditem_nolog(dbc, pp->page,
  +				    pp->indx + 1, rentry.size);
  +				DB_ASSERT(dbp->env, t_ret == 0);
  +			}
   
   			goto err;
   		}
  @@ -478,7 +489,7 @@
   	LSN(rp) = LSN(cp->page);
   	LSN(pp->page) = LSN(cp->page);
   	if (tp != NULL) {
  -		/* Log record has been written; now it is safe to update next page. */
  +		/* Log record has been written; so safe to update next page. */
   		PREV_PGNO(tp) = PGNO(rp);
   		LSN(tp) = LSN(cp->page);
   	}
  @@ -675,7 +686,7 @@
   	 * We copy the key we split on (but not the key's data, in the case of
   	 * a leaf page) to the new root page.
   	 */
  -	root_pgno = cp->root;
  +	root_pgno = BAM_ROOT_PGNO(dbc);
   	P_INIT(rootp, dbp->pgsize,
   	    root_pgno, PGNO_INVALID, PGNO_INVALID, lp->level + 1, P_IBTREE);
   
  @@ -722,7 +733,7 @@
   	int ret;
   
   	dbp = dbc->dbp;
  -	root_pgno = dbc->internal->root;
  +	root_pgno = BAM_ROOT_PGNO(dbc);
   
   	/* Initialize the page. */
   	P_INIT(rootp, dbp->pgsize,
  @@ -997,8 +1008,7 @@
   
   	if (LF_ISSET(BPI_REPLACE)) {
   		DB_ASSERT(dbp->env, !LF_ISSET(BPI_NOLOGGING));
  -		if ((ret = __bam_irep(dbc, ppage,
  -		    off, &hdr, data.size != 0 ? &data : NULL)) != 0)
  +		if ((ret = __bam_irep(dbc, ppage, off, &hdr, &data)) != 0)
   			return (ret);
   	} else {
   		if (LF_ISSET(BPI_NOLOGGING))
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_stat.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_stat.c
  --- db/btree/bt_stat.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_stat.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -30,7 +30,6 @@
   {
   	BTMETA *meta;
   	BTREE *t;
  -	BTREE_CURSOR *cp;
   	DB *dbp;
   	DB_BTREE_STAT *sp;
   	DB_LOCK lock, metalock;
  @@ -52,8 +51,6 @@
   	h = NULL;
   	ret = write_meta = 0;
   
  -	cp = (BTREE_CURSOR *)dbc->internal;
  -
   	/* Allocate and clear the structure. */
   	if ((ret = __os_umalloc(env, sizeof(*sp), &sp)) != 0)
   		goto err;
  @@ -86,12 +83,10 @@
   	}
   
   	/* Get the root page. */
  -	pgno = cp->root;
  -	if ((ret = __db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0)
  -		goto err;
  -	if ((ret = __memp_fget(mpf, &pgno,
  -	     dbc->thread_info, dbc->txn, 0, &h)) != 0)
  +	BAM_GET_ROOT(dbc, pgno, h, 0, DB_LOCK_READ, lock, ret);
  +	if (ret != 0)
   		goto err;
  +	DB_ASSERT(env, h != NULL);
   
   	/* Get the levels from the root page. */
   	sp->bt_levels = h->level;
  @@ -106,7 +101,7 @@
   
   	/* Walk the tree. */
   	if ((ret = __bam_traverse(dbc,
  -	    DB_LOCK_READ, cp->root, __bam_stat_callback, sp)) != 0)
  +	    DB_LOCK_READ, PGNO_INVALID, __bam_stat_callback, sp)) != 0)
   		goto err;
   
   #ifdef HAVE_COMPRESSION
  @@ -142,11 +137,8 @@
   	if (flags == DB_FAST_STAT) {
   		if (dbp->type == DB_RECNO ||
   		    (dbp->type == DB_BTREE && F_ISSET(dbp, DB_AM_RECNUM))) {
  -			if ((ret = __db_lget(dbc, 0,
  -			    cp->root, DB_LOCK_READ, 0, &lock)) != 0)
  -				goto err;
  -			if ((ret = __memp_fget(mpf, &cp->root,
  -			     dbc->thread_info, dbc->txn, 0, &h)) != 0)
  +			BAM_GET_ROOT(dbc, pgno, h, 0, DB_LOCK_READ, lock, ret);
  +			if (ret != 0)
   				goto err;
   
   			sp->bt_nkeys = RE_NREC(h);
  @@ -552,7 +544,8 @@
   		kp->equal = 0;
   	}
   
  -	BT_STK_CLR(cp);
  +	if ((ret = __bam_stkrel(dbc, 0)) != 0)
  +		return (ret);
   
   	return (0);
   }
  @@ -586,14 +579,12 @@
   	dbp = dbc->dbp;
   	mpf = dbp->mpf;
   	already_put = 0;
  +	LOCK_INIT(lock);
   
  -	if ((ret = __db_lget(dbc, 0, root_pgno, mode, 0, &lock)) != 0)
  -		return (ret);
  -	if ((ret = __memp_fget(mpf, &root_pgno,
  -	     dbc->thread_info, dbc->txn, 0, &h)) != 0) {
  -		(void)__TLPUT(dbc, lock);
  -		return (ret);
  -	}
  +	COMPQUIET(h, NULL);
  +	BAM_GET_ROOT(dbc, root_pgno, h, 0, mode, lock, ret);
  +	if (ret != 0)
  +		goto err1;
   
   	switch (TYPE(h)) {
   	case P_IBTREE:
  @@ -662,7 +653,7 @@
   err:	if (!already_put && (t_ret = __memp_fput(mpf,
   	    dbc->thread_info, h, dbc->priority)) != 0 && ret == 0)
   		ret = t_ret;
  -	if ((t_ret = __TLPUT(dbc, lock)) != 0 && ret == 0)
  +err1:	if ((t_ret = __TLPUT(dbc, lock)) != 0 && ret == 0)
   		ret = t_ret;
   
   	return (ret);
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_upgrade.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 bt_upgrade.c
  --- db/btree/bt_upgrade.c	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/bt_upgrade.c	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/bt_verify.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 bt_verify.c
  --- db/btree/bt_verify.c	16 Sep 2009 19:34:37 -0000	1.10
  +++ db/btree/bt_verify.c	23 Aug 2010 13:36:23 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1999-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1999, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -2420,7 +2420,7 @@
   				if (i % P_INDX == 0) {
   					if (t_ret == 0) {
   						if ((t_ret = __os_realloc(env,
  -						        dbt.size,
  +							dbt.size,
   							&repldbt.data)) != 0) {
   							if (ret == 0)
   								ret = t_ret;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/btree.src
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 btree.src
  --- db/btree/btree.src	16 Sep 2009 19:34:37 -0000	1.9
  +++ db/btree/btree.src	23 Aug 2010 13:36:23 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -14,7 +14,6 @@
   INCLUDE #include "dbinc/db_page.h"
   INCLUDE #include "dbinc/db_am.h"
   INCLUDE #include "dbinc/btree.h"
  -INCLUDE #include "dbinc/log.h"
   INCLUDE #include "dbinc/txn.h"
   INCLUDE
   
  @@ -34,7 +33,25 @@
    * opflags:	SPL_NRECS: if splitting a tree that maintains a record count.
    * pindx:	index of new record in parent page.
    */
  -BEGIN split		48	62
  +BEGIN split		50	62
  +DB	fileid		int32_t		ld
  +OP	opflags		u_int32_t	lu
  +ARG	left		db_pgno_t	lu
  +POINTER	llsn		DB_LSN *	lu
  +ARG	right		db_pgno_t	lu
  +POINTER	rlsn		DB_LSN *	lu
  +ARG	indx		u_int32_t	lu
  +ARG	npgno		db_pgno_t	lu
  +POINTER	nlsn		DB_LSN *	lu
  +ARG	ppgno		db_pgno_t	lu
  +POINTER	plsn		DB_LSN *	lu
  +ARG	pindx		u_int32_t	lu
  +PGDBT	pg		DBT		s
  +HDR	pentry		DBT		s
  +HDR	rentry		DBT		s
  +END
  +
  +BEGIN_COMPAT split		48	62
   DB	fileid		int32_t		ld
   ARG	left		db_pgno_t	lu
   POINTER	llsn		DB_LSN *	lu
  @@ -161,6 +178,27 @@
   END
   
   /*
  + * BTREE-irep: used to log the replacement of an item on an internal page.
  + *
  + * pgno:	the page modified.
  + * lsn:		the page's original lsn.
  + * indx:	the index to be replaced.
  + * ptype:	type of the page.
  + * hdr:		header of the record.
  + * data:	data of the record.
  + */
  +BEGIN irep		50	67
  +DB	fileid		int32_t		ld
  +ARG	pgno		db_pgno_t	lu
  +POINTER	lsn		DB_LSN *	lu
  +ARG	indx		u_int32_t	lu
  +OP	ptype		u_int32_t	lu
  +HDR	hdr		DBT		s
  +DATA	data		DBT		s
  +HDR	old		DBT		s
  +END
  +
  +/*
    * BTREE-root: log the assignment of a root btree page.
    */
   BEGIN root		42	59
  @@ -216,6 +254,7 @@
   
   /*
    * BTREE-relink -- Handles relinking around a deleted leaf page.
  + * Current routine moved to __db_relink.
    *
    */
   BEGIN_COMPAT relink		43	147
  @@ -235,25 +274,9 @@
   POINTER	lsn_next	DB_LSN *	lu
   END
   
  -BEGIN relink		44	147
  -/* Fileid of db affected. */
  -DB	fileid		int32_t		ld
  -/* The page being removed. */
  -ARG	pgno		db_pgno_t	lu
  -/* The new page number, if any. */
  -ARG	new_pgno	db_pgno_t	lu
  -/* The previous page. */
  -ARG	prev		db_pgno_t	lu
  -/* The previous page's original lsn. */
  -POINTER	lsn_prev	DB_LSN *	lu
  -/* The next page. */
  -ARG	next		db_pgno_t	lu
  -/* The previous page's original lsn. */
  -POINTER	lsn_next	DB_LSN *	lu
  -END
  -
   /*
    * BTREE-merge -- Handles merging of pages during a compaction.
  + * Current routine moved to __db_merge.
    */
   BEGIN_COMPAT merge		44	148
   DB	fileid		int32_t		ld
  @@ -265,27 +288,3 @@
   DBT	data		DBT		s
   DBT	ind		DBT		s
   END
  -
  -BEGIN merge		47	148
  -DB	fileid		int32_t		ld
  -ARG	pgno		db_pgno_t	lu
  -POINTER	lsn		DB_LSN *	lu
  -ARG	npgno		db_pgno_t	lu
  -POINTER nlsn		DB_LSN *	lu
  -PGDBT	hdr		DBT		s
  -PGDDBT	data		DBT		s
  -ARG	pg_copy		int32_t		lu
  -END
  -
  -/*
  - * BTREE-pgno -- Handles replacing a page number in the record
  - * reference on pgno by indx.
  - */
  -BEGIN pgno		44	149
  -DB	fileid		int32_t		ld
  -ARG	pgno		db_pgno_t	lu
  -POINTER	lsn		DB_LSN *	lu
  -ARG	indx		u_int32_t	lu
  -ARG	opgno		db_pgno_t	lu
  -ARG	npgno		db_pgno_t	lu
  -END
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/btree_auto.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 btree_auto.c
  --- db/btree/btree_auto.c	16 Sep 2009 19:34:37 -0000	1.10
  +++ db/btree/btree_auto.c	23 Aug 2010 13:36:23 -0000	1.10.2.1
  @@ -6,3497 +6,163 @@
   #include "dbinc/db_page.h"
   #include "dbinc/db_am.h"
   #include "dbinc/btree.h"
  -#include "dbinc/log.h"
   #include "dbinc/txn.h"
   
  -/*
  - * PUBLIC: int __bam_split_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_split_args **));
  - */
  -int
  -__bam_split_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_split_args **argpp;
  -{
  -	__bam_split_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_split_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->left = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->llsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->right = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->rlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->indx, bp);
  -	bp += sizeof(argp->indx);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->npgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->nlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->ppgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->plsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->pindx, bp);
  -	bp += sizeof(argp->pindx);
  -
  -	memset(&argp->pg, 0, sizeof(argp->pg));
  -	LOGCOPY_32(env,&argp->pg.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->pg.data = bp;
  -	bp += argp->pg.size;
  -	if (LOG_SWAPPED(env) && dbpp != NULL && *dbpp != NULL) {
  -		int t_ret;
  -		if ((t_ret = __db_pageswap(*dbpp, (PAGE *)argp->pg.data,
  -		    (size_t)argp->pg.size, NULL, 1)) != 0)
  -			return (t_ret);
  -	}
  -
  -	memset(&argp->pentry, 0, sizeof(argp->pentry));
  -	LOGCOPY_32(env,&argp->pentry.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->pentry.data = bp;
  -	bp += argp->pentry.size;
  -
  -	memset(&argp->rentry, 0, sizeof(argp->rentry));
  -	LOGCOPY_32(env,&argp->rentry.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->rentry.data = bp;
  -	bp += argp->rentry.size;
  -
  -	LOGCOPY_32(env, &argp->opflags, bp);
  -	bp += sizeof(argp->opflags);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_split_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t,
  - * PUBLIC:     db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t, const DBT *,
  - * PUBLIC:     const DBT *, const DBT *, u_int32_t));
  - */
  -int
  -__bam_split_log(dbp, txnp, ret_lsnp, flags, left, llsn, right, rlsn, indx,
  -    npgno, nlsn, ppgno, plsn, pindx, pg,
  -    pentry, rentry, opflags)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t left;
  -	DB_LSN * llsn;
  -	db_pgno_t right;
  -	DB_LSN * rlsn;
  -	u_int32_t indx;
  -	db_pgno_t npgno;
  -	DB_LSN * nlsn;
  -	db_pgno_t ppgno;
  -	DB_LSN * plsn;
  -	u_int32_t pindx;
  -	const DBT *pg;
  -	const DBT *pentry;
  -	const DBT *rentry;
  -	u_int32_t opflags;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_split;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*llsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*rlsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*nlsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*plsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (pg == NULL ? 0 : pg->size)
  -	    + sizeof(u_int32_t) + (pentry == NULL ? 0 : pentry->size)
  -	    + sizeof(u_int32_t) + (rentry == NULL ? 0 : rentry->size)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)left;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (llsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(llsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, llsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, llsn);
  -	} else
  -		memset(bp, 0, sizeof(*llsn));
  -	bp += sizeof(*llsn);
  -
  -	uinttmp = (u_int32_t)right;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (rlsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(rlsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, rlsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, rlsn);
  -	} else
  -		memset(bp, 0, sizeof(*rlsn));
  -	bp += sizeof(*rlsn);
  -
  -	LOGCOPY_32(env, bp, &indx);
  -	bp += sizeof(indx);
  -
  -	uinttmp = (u_int32_t)npgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (nlsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(nlsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, nlsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, nlsn);
  -	} else
  -		memset(bp, 0, sizeof(*nlsn));
  -	bp += sizeof(*nlsn);
  -
  -	uinttmp = (u_int32_t)ppgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (plsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(plsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, plsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, plsn);
  -	} else
  -		memset(bp, 0, sizeof(*plsn));
  -	bp += sizeof(*plsn);
  -
  -	LOGCOPY_32(env, bp, &pindx);
  -	bp += sizeof(pindx);
  -
  -	if (pg == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &pg->size);
  -		bp += sizeof(pg->size);
  -		memcpy(bp, pg->data, pg->size);
  -		if (LOG_SWAPPED(env))
  -			if ((ret = __db_pageswap(dbp,
  -			    (PAGE *)bp, (size_t)pg->size, (DBT *)NULL, 0)) != 0)
  -				return (ret);
  -		bp += pg->size;
  -	}
  -
  -	if (pentry == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &pentry->size);
  -		bp += sizeof(pentry->size);
  -		memcpy(bp, pentry->data, pentry->size);
  -		bp += pentry->size;
  -	}
  -
  -	if (rentry == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &rentry->size);
  -		bp += sizeof(rentry->size);
  -		memcpy(bp, rentry->data, rentry->size);
  -		bp += rentry->size;
  -	}
  -
  -	LOGCOPY_32(env, bp, &opflags);
  -	bp += sizeof(opflags);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_split_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_split_42_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __bam_split_42_args **));
  - */
  -int
  -__bam_split_42_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_split_42_args **argpp;
  -{
  -	__bam_split_42_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_split_42_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->left = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->llsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->right = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->rlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->indx, bp);
  -	bp += sizeof(argp->indx);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->npgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->nlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->root_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->pg, 0, sizeof(argp->pg));
  -	LOGCOPY_32(env,&argp->pg.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->pg.data = bp;
  -	bp += argp->pg.size;
  -
  -	LOGCOPY_32(env, &argp->opflags, bp);
  -	bp += sizeof(argp->opflags);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_rsplit_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_rsplit_args **));
  - */
  -int
  -__bam_rsplit_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_rsplit_args **argpp;
  -{
  -	__bam_rsplit_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_rsplit_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->pgdbt, 0, sizeof(argp->pgdbt));
  -	LOGCOPY_32(env,&argp->pgdbt.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->pgdbt.data = bp;
  -	bp += argp->pgdbt.size;
  -	if (LOG_SWAPPED(env) && dbpp != NULL && *dbpp != NULL) {
  -		int t_ret;
  -		if ((t_ret = __db_pageswap(*dbpp, (PAGE *)argp->pgdbt.data,
  -		    (size_t)argp->pgdbt.size, NULL, 1)) != 0)
  -			return (t_ret);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->root_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->nrec = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->rootent, 0, sizeof(argp->rootent));
  -	LOGCOPY_32(env,&argp->rootent.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->rootent.data = bp;
  -	bp += argp->rootent.size;
  -
  -	LOGCOPY_TOLSN(env, &argp->rootlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_rsplit_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, const DBT *, db_pgno_t, db_pgno_t,
  - * PUBLIC:     const DBT *, DB_LSN *));
  - */
  -int
  -__bam_rsplit_log(dbp, txnp, ret_lsnp, flags, pgno, pgdbt, root_pgno, nrec, rootent,
  -    rootlsn)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	const DBT *pgdbt;
  -	db_pgno_t root_pgno;
  -	db_pgno_t nrec;
  -	const DBT *rootent;
  -	DB_LSN * rootlsn;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_rsplit;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (pgdbt == NULL ? 0 : pgdbt->size)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (rootent == NULL ? 0 : rootent->size)
  -	    + sizeof(*rootlsn);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (pgdbt == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &pgdbt->size);
  -		bp += sizeof(pgdbt->size);
  -		memcpy(bp, pgdbt->data, pgdbt->size);
  -		if (LOG_SWAPPED(env))
  -			if ((ret = __db_pageswap(dbp,
  -			    (PAGE *)bp, (size_t)pgdbt->size, (DBT *)NULL, 0)) != 0)
  -				return (ret);
  -		bp += pgdbt->size;
  -	}
  -
  -	uinttmp = (u_int32_t)root_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)nrec;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (rootent == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &rootent->size);
  -		bp += sizeof(rootent->size);
  -		memcpy(bp, rootent->data, rootent->size);
  -		bp += rootent->size;
  -	}
  -
  -	if (rootlsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(rootlsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, rootlsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, rootlsn);
  -	} else
  -		memset(bp, 0, sizeof(*rootlsn));
  -	bp += sizeof(*rootlsn);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_rsplit_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_adj_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_adj_args **));
  - */
  -int
  -__bam_adj_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_adj_args **argpp;
  -{
  -	__bam_adj_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_adj_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->indx, bp);
  -	bp += sizeof(argp->indx);
  -
  -	LOGCOPY_32(env, &argp->indx_copy, bp);
  -	bp += sizeof(argp->indx_copy);
  -
  -	LOGCOPY_32(env, &argp->is_insert, bp);
  -	bp += sizeof(argp->is_insert);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_adj_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t,
  - * PUBLIC:     u_int32_t));
  - */
  -int
  -__bam_adj_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx, indx_copy, is_insert)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	DB_LSN * lsn;
  -	u_int32_t indx;
  -	u_int32_t indx_copy;
  -	u_int32_t is_insert;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_adj;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn);
  -	} else
  -		memset(bp, 0, sizeof(*lsn));
  -	bp += sizeof(*lsn);
  -
  -	LOGCOPY_32(env, bp, &indx);
  -	bp += sizeof(indx);
  -
  -	LOGCOPY_32(env, bp, &indx_copy);
  -	bp += sizeof(indx_copy);
  -
  -	LOGCOPY_32(env, bp, &is_insert);
  -	bp += sizeof(is_insert);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_adj_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_cadjust_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_cadjust_args **));
  - */
  -int
  -__bam_cadjust_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_cadjust_args **argpp;
  -{
  -	__bam_cadjust_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_cadjust_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->indx, bp);
  -	bp += sizeof(argp->indx);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->adjust = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &argp->opflags, bp);
  -	bp += sizeof(argp->opflags);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_cadjust_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, int32_t, u_int32_t));
  - */
  -int
  -__bam_cadjust_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx, adjust, opflags)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	DB_LSN * lsn;
  -	u_int32_t indx;
  -	int32_t adjust;
  -	u_int32_t opflags;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_cadjust;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn);
  -	} else
  -		memset(bp, 0, sizeof(*lsn));
  -	bp += sizeof(*lsn);
  -
  -	LOGCOPY_32(env, bp, &indx);
  -	bp += sizeof(indx);
  -
  -	uinttmp = (u_int32_t)adjust;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, bp, &opflags);
  -	bp += sizeof(opflags);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_cadjust_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_cdel_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_cdel_args **));
  - */
  -int
  -__bam_cdel_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_cdel_args **argpp;
  -{
  -	__bam_cdel_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_cdel_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->indx, bp);
  -	bp += sizeof(argp->indx);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_cdel_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, u_int32_t));
  - */
  -int
  -__bam_cdel_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	DB_LSN * lsn;
  -	u_int32_t indx;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_cdel;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*lsn)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn);
  -	} else
  -		memset(bp, 0, sizeof(*lsn));
  -	bp += sizeof(*lsn);
  -
  -	LOGCOPY_32(env, bp, &indx);
  -	bp += sizeof(indx);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_cdel_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_repl_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_repl_args **));
  - */
  -int
  -__bam_repl_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_repl_args **argpp;
  -{
  -	__bam_repl_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_repl_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->indx, bp);
  -	bp += sizeof(argp->indx);
  -
  -	LOGCOPY_32(env, &argp->isdeleted, bp);
  -	bp += sizeof(argp->isdeleted);
  -
  -	memset(&argp->orig, 0, sizeof(argp->orig));
  -	LOGCOPY_32(env,&argp->orig.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->orig.data = bp;
  -	bp += argp->orig.size;
  -
  -	memset(&argp->repl, 0, sizeof(argp->repl));
  -	LOGCOPY_32(env,&argp->repl.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->repl.data = bp;
  -	bp += argp->repl.size;
  -
  -	LOGCOPY_32(env, &argp->prefix, bp);
  -	bp += sizeof(argp->prefix);
  -
  -	LOGCOPY_32(env, &argp->suffix, bp);
  -	bp += sizeof(argp->suffix);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_repl_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t,
  - * PUBLIC:     const DBT *, const DBT *, u_int32_t, u_int32_t));
  - */
  -int
  -__bam_repl_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx, isdeleted, orig,
  -    repl, prefix, suffix)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	DB_LSN * lsn;
  -	u_int32_t indx;
  -	u_int32_t isdeleted;
  -	const DBT *orig;
  -	const DBT *repl;
  -	u_int32_t prefix;
  -	u_int32_t suffix;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_repl;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (orig == NULL ? 0 : orig->size)
  -	    + sizeof(u_int32_t) + (repl == NULL ? 0 : repl->size)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn);
  -	} else
  -		memset(bp, 0, sizeof(*lsn));
  -	bp += sizeof(*lsn);
  -
  -	LOGCOPY_32(env, bp, &indx);
  -	bp += sizeof(indx);
  -
  -	LOGCOPY_32(env, bp, &isdeleted);
  -	bp += sizeof(isdeleted);
  -
  -	if (orig == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &orig->size);
  -		bp += sizeof(orig->size);
  -		memcpy(bp, orig->data, orig->size);
  -		bp += orig->size;
  -	}
  -
  -	if (repl == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &repl->size);
  -		bp += sizeof(repl->size);
  -		memcpy(bp, repl->data, repl->size);
  -		bp += repl->size;
  -	}
  -
  -	LOGCOPY_32(env, bp, &prefix);
  -	bp += sizeof(prefix);
  -
  -	LOGCOPY_32(env, bp, &suffix);
  -	bp += sizeof(suffix);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_repl_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_root_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_root_args **));
  - */
  -int
  -__bam_root_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_root_args **argpp;
  -{
  -	__bam_root_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_root_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->meta_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->root_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->meta_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_root_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, db_pgno_t, DB_LSN *));
  - */
  -int
  -__bam_root_log(dbp, txnp, ret_lsnp, flags, meta_pgno, root_pgno, meta_lsn)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t meta_pgno;
  -	db_pgno_t root_pgno;
  -	DB_LSN * meta_lsn;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_root;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*meta_lsn);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)meta_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)root_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (meta_lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, meta_lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, meta_lsn);
  -	} else
  -		memset(bp, 0, sizeof(*meta_lsn));
  -	bp += sizeof(*meta_lsn);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_root_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_curadj_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_curadj_args **));
  - */
  -int
  -__bam_curadj_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_curadj_args **argpp;
  -{
  -	__bam_curadj_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_curadj_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->mode = (db_ca_mode)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->from_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->to_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->left_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &argp->first_indx, bp);
  -	bp += sizeof(argp->first_indx);
  -
  -	LOGCOPY_32(env, &argp->from_indx, bp);
  -	bp += sizeof(argp->from_indx);
  -
  -	LOGCOPY_32(env, &argp->to_indx, bp);
  -	bp += sizeof(argp->to_indx);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_curadj_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_ca_mode, db_pgno_t, db_pgno_t, db_pgno_t,
  - * PUBLIC:     u_int32_t, u_int32_t, u_int32_t));
  - */
  -int
  -__bam_curadj_log(dbp, txnp, ret_lsnp, flags, mode, from_pgno, to_pgno, left_pgno, first_indx,
  -    from_indx, to_indx)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_ca_mode mode;
  -	db_pgno_t from_pgno;
  -	db_pgno_t to_pgno;
  -	db_pgno_t left_pgno;
  -	u_int32_t first_indx;
  -	u_int32_t from_indx;
  -	u_int32_t to_indx;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_curadj;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)mode;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)from_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)to_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)left_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, bp, &first_indx);
  -	bp += sizeof(first_indx);
  -
  -	LOGCOPY_32(env, bp, &from_indx);
  -	bp += sizeof(from_indx);
  -
  -	LOGCOPY_32(env, bp, &to_indx);
  -	bp += sizeof(to_indx);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_curadj_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_rcuradj_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_rcuradj_args **));
  - */
  -int
  -__bam_rcuradj_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_rcuradj_args **argpp;
  -{
  -	__bam_rcuradj_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_rcuradj_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->mode = (ca_recno_arg)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->root = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->recno = (db_recno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &argp->order, bp);
  -	bp += sizeof(argp->order);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_rcuradj_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, ca_recno_arg, db_pgno_t, db_recno_t, u_int32_t));
  - */
  -int
  -__bam_rcuradj_log(dbp, txnp, ret_lsnp, flags, mode, root, recno, order)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	ca_recno_arg mode;
  -	db_pgno_t root;
  -	db_recno_t recno;
  -	u_int32_t order;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_rcuradj;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)mode;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)root;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)recno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, bp, &order);
  -	bp += sizeof(order);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_rcuradj_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_relink_43_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __bam_relink_43_args **));
  - */
  -int
  -__bam_relink_43_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_relink_43_args **argpp;
  -{
  -	__bam_relink_43_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_relink_43_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->prev = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn_prev, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn_next, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_relink_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_relink_args **));
  - */
  -int
  -__bam_relink_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_relink_args **argpp;
  -{
  -	__bam_relink_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_relink_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->new_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->prev = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn_prev, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn_next, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_relink_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, db_pgno_t, db_pgno_t, DB_LSN *, db_pgno_t,
  - * PUBLIC:     DB_LSN *));
  - */
  -int
  -__bam_relink_log(dbp, txnp, ret_lsnp, flags, pgno, new_pgno, prev, lsn_prev, next,
  -    lsn_next)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	db_pgno_t new_pgno;
  -	db_pgno_t prev;
  -	DB_LSN * lsn_prev;
  -	db_pgno_t next;
  -	DB_LSN * lsn_next;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_relink;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*lsn_prev)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*lsn_next);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)new_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)prev;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (lsn_prev != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn_prev, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn_prev)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn_prev);
  -	} else
  -		memset(bp, 0, sizeof(*lsn_prev));
  -	bp += sizeof(*lsn_prev);
  -
  -	uinttmp = (u_int32_t)next;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (lsn_next != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn_next, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn_next)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn_next);
  -	} else
  -		memset(bp, 0, sizeof(*lsn_next));
  -	bp += sizeof(*lsn_next);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_relink_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_merge_44_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __bam_merge_44_args **));
  - */
  -int
  -__bam_merge_44_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_merge_44_args **argpp;
  -{
  -	__bam_merge_44_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_merge_44_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->npgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->nlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	memset(&argp->hdr, 0, sizeof(argp->hdr));
  -	LOGCOPY_32(env,&argp->hdr.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->hdr.data = bp;
  -	bp += argp->hdr.size;
  -
  -	memset(&argp->data, 0, sizeof(argp->data));
  -	LOGCOPY_32(env,&argp->data.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->data.data = bp;
  -	bp += argp->data.size;
  -
  -	memset(&argp->ind, 0, sizeof(argp->ind));
  -	LOGCOPY_32(env,&argp->ind.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->ind.data = bp;
  -	bp += argp->ind.size;
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_merge_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_merge_args **));
  - */
  -int
  -__bam_merge_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_merge_args **argpp;
  -{
  -	__bam_merge_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_merge_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->npgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->nlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	memset(&argp->hdr, 0, sizeof(argp->hdr));
  -	LOGCOPY_32(env,&argp->hdr.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->hdr.data = bp;
  -	bp += argp->hdr.size;
  -
  -	memset(&argp->data, 0, sizeof(argp->data));
  -	LOGCOPY_32(env,&argp->data.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->data.data = bp;
  -	bp += argp->data.size;
  -	if (LOG_SWAPPED(env) && dbpp != NULL && *dbpp != NULL) {
  -		int t_ret;
  -		if ((t_ret = __db_pageswap(*dbpp,
  -		    (PAGE *)argp->hdr.data, (size_t)argp->hdr.size,
  -		    &argp->data, 1)) != 0)
  -			return (t_ret);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pg_copy = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_merge_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, const DBT *,
  - * PUBLIC:     const DBT *, int32_t));
  - */
  -int
  -__bam_merge_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, npgno, nlsn, hdr,
  -    data, pg_copy)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	DB_LSN * lsn;
  -	db_pgno_t npgno;
  -	DB_LSN * nlsn;
  -	const DBT *hdr;
  -	const DBT *data;
  -	int32_t pg_copy;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_merge;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*nlsn)
  -	    + sizeof(u_int32_t) + (hdr == NULL ? 0 : hdr->size)
  -	    + sizeof(u_int32_t) + (data == NULL ? 0 : data->size)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn);
  -	} else
  -		memset(bp, 0, sizeof(*lsn));
  -	bp += sizeof(*lsn);
  -
  -	uinttmp = (u_int32_t)npgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (nlsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(nlsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, nlsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, nlsn);
  -	} else
  -		memset(bp, 0, sizeof(*nlsn));
  -	bp += sizeof(*nlsn);
  -
  -	if (hdr == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &hdr->size);
  -		bp += sizeof(hdr->size);
  -		memcpy(bp, hdr->data, hdr->size);
  -		if (LOG_SWAPPED(env))
  -			if ((ret = __db_pageswap(dbp,
  -			    (PAGE *)bp, (size_t)hdr->size, (DBT *)data, 0)) != 0)
  -				return (ret);
  -		bp += hdr->size;
  -	}
  -
  -	if (data == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &data->size);
  -		bp += sizeof(data->size);
  -		memcpy(bp, data->data, data->size);
  -		if (LOG_SWAPPED(env) && F_ISSET(data, DB_DBT_APPMALLOC))
  -			__os_free(env, data->data);
  -		bp += data->size;
  -	}
  -
  -	uinttmp = (u_int32_t)pg_copy;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_merge_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_pgno_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __bam_pgno_args **));
  - */
  -int
  -__bam_pgno_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__bam_pgno_args **argpp;
  -{
  -	__bam_pgno_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__bam_pgno_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->indx, bp);
  -	bp += sizeof(argp->indx);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->opgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->npgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __bam_pgno_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t,
  - * PUBLIC:     db_pgno_t));
  - */
  -int
  -__bam_pgno_log(dbp, txnp, ret_lsnp, flags, pgno, lsn, indx, opgno, npgno)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	DB_LSN * lsn;
  -	u_int32_t indx;
  -	db_pgno_t opgno;
  -	db_pgno_t npgno;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___bam_pgno;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn);
  -	} else
  -		memset(bp, 0, sizeof(*lsn));
  -	bp += sizeof(*lsn);
  -
  -	LOGCOPY_32(env, bp, &indx);
  -	bp += sizeof(indx);
  -
  -	uinttmp = (u_int32_t)opgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)npgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__bam_pgno_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  +DB_LOG_RECSPEC __bam_split_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_split_args, fileid), "fileid", ""},
  +	{LOGREC_OP, SSZ(__bam_split_args, opflags), "opflags", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_split_args, left), "left", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_args, llsn), "llsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_args, right), "right", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_args, rlsn), "rlsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_args, indx), "indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_split_args, npgno), "npgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_args, nlsn), "nlsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_args, ppgno), "ppgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_args, plsn), "plsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_args, pindx), "pindx", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__bam_split_args, pg), "pg", ""},
  +	{LOGREC_HDR, SSZ(__bam_split_args, pentry), "pentry", ""},
  +	{LOGREC_HDR, SSZ(__bam_split_args, rentry), "rentry", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_split_48_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_split_48_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_48_args, left), "left", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_48_args, llsn), "llsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_48_args, right), "right", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_48_args, rlsn), "rlsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_48_args, indx), "indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_split_48_args, npgno), "npgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_48_args, nlsn), "nlsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_48_args, ppgno), "ppgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_48_args, plsn), "plsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_48_args, pindx), "pindx", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__bam_split_48_args, pg), "pg", ""},
  +	{LOGREC_DBT, SSZ(__bam_split_48_args, pentry), "pentry", ""},
  +	{LOGREC_DBT, SSZ(__bam_split_48_args, rentry), "rentry", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_48_args, opflags), "opflags", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_split_42_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_split_42_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_42_args, left), "left", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_42_args, llsn), "llsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_42_args, right), "right", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_42_args, rlsn), "rlsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_42_args, indx), "indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_split_42_args, npgno), "npgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_split_42_args, nlsn), "nlsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_42_args, root_pgno), "root_pgno", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__bam_split_42_args, pg), "pg", ""},
  +	{LOGREC_ARG, SSZ(__bam_split_42_args, opflags), "opflags", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_rsplit_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_rsplit_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_rsplit_args, pgno), "pgno", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__bam_rsplit_args, pgdbt), "pgdbt", ""},
  +	{LOGREC_ARG, SSZ(__bam_rsplit_args, root_pgno), "root_pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_rsplit_args, nrec), "nrec", "%lu"},
  +	{LOGREC_DBT, SSZ(__bam_rsplit_args, rootent), "rootent", ""},
  +	{LOGREC_POINTER, SSZ(__bam_rsplit_args, rootlsn), "rootlsn", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_adj_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_adj_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_adj_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_adj_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_adj_args, indx), "indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_adj_args, indx_copy), "indx_copy", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_adj_args, is_insert), "is_insert", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_cadjust_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_cadjust_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_cadjust_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_cadjust_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_cadjust_args, indx), "indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_cadjust_args, adjust), "adjust", "%ld"},
  +	{LOGREC_ARG, SSZ(__bam_cadjust_args, opflags), "opflags", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_cdel_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_cdel_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_cdel_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_cdel_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_cdel_args, indx), "indx", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_repl_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_repl_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_repl_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_repl_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_repl_args, indx), "indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_repl_args, isdeleted), "isdeleted", "%lu"},
  +	{LOGREC_DBT, SSZ(__bam_repl_args, orig), "orig", ""},
  +	{LOGREC_DBT, SSZ(__bam_repl_args, repl), "repl", ""},
  +	{LOGREC_ARG, SSZ(__bam_repl_args, prefix), "prefix", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_repl_args, suffix), "suffix", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_irep_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_irep_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_irep_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_irep_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_irep_args, indx), "indx", "%lu"},
  +	{LOGREC_OP, SSZ(__bam_irep_args, ptype), "ptype", "%lu"},
  +	{LOGREC_HDR, SSZ(__bam_irep_args, hdr), "hdr", ""},
  +	{LOGREC_DATA, SSZ(__bam_irep_args, data), "data", ""},
  +	{LOGREC_HDR, SSZ(__bam_irep_args, old), "old", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_root_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_root_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_root_args, meta_pgno), "meta_pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_root_args, root_pgno), "root_pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_root_args, meta_lsn), "meta_lsn", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_curadj_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_curadj_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_curadj_args, mode), "mode", "%ld"},
  +	{LOGREC_ARG, SSZ(__bam_curadj_args, from_pgno), "from_pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_curadj_args, to_pgno), "to_pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_curadj_args, left_pgno), "left_pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_curadj_args, first_indx), "first_indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_curadj_args, from_indx), "from_indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__bam_curadj_args, to_indx), "to_indx", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_rcuradj_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_rcuradj_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_rcuradj_args, mode), "mode", "%ld"},
  +	{LOGREC_ARG, SSZ(__bam_rcuradj_args, root), "root", "%ld"},
  +	{LOGREC_ARG, SSZ(__bam_rcuradj_args, recno), "recno", "%ld"},
  +	{LOGREC_ARG, SSZ(__bam_rcuradj_args, order), "order", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_relink_43_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_relink_43_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_relink_43_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_relink_43_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_relink_43_args, prev), "prev", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_relink_43_args, lsn_prev), "lsn_prev", ""},
  +	{LOGREC_ARG, SSZ(__bam_relink_43_args, next), "next", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_relink_43_args, lsn_next), "lsn_next", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __bam_merge_44_desc[] = {
  +	{LOGREC_DB, SSZ(__bam_merge_44_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__bam_merge_44_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_merge_44_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__bam_merge_44_args, npgno), "npgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__bam_merge_44_args, nlsn), "nlsn", ""},
  +	{LOGREC_DBT, SSZ(__bam_merge_44_args, hdr), "hdr", ""},
  +	{LOGREC_DBT, SSZ(__bam_merge_44_args, data), "data", ""},
  +	{LOGREC_DBT, SSZ(__bam_merge_44_args, ind), "ind", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
   /*
    * PUBLIC: int __bam_init_recover __P((ENV *, DB_DISTAB *));
    */
  @@ -3526,6 +192,9 @@
   	    __bam_repl_recover, DB___bam_repl)) != 0)
   		return (ret);
   	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __bam_irep_recover, DB___bam_irep)) != 0)
  +		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
   	    __bam_root_recover, DB___bam_root)) != 0)
   		return (ret);
   	if ((ret = __db_add_recovery_int(env, dtabp,
  @@ -3534,14 +203,5 @@
   	if ((ret = __db_add_recovery_int(env, dtabp,
   	    __bam_rcuradj_recover, DB___bam_rcuradj)) != 0)
   		return (ret);
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __bam_relink_recover, DB___bam_relink)) != 0)
  -		return (ret);
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __bam_merge_recover, DB___bam_merge)) != 0)
  -		return (ret);
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __bam_pgno_recover, DB___bam_pgno)) != 0)
  -		return (ret);
   	return (0);
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: db/btree/btree_autop.c
  ============================================================================
  $ cvs diff -u -r1.7 -r1.7.2.1 btree_autop.c
  --- db/btree/btree_autop.c	16 Sep 2009 19:34:37 -0000	1.7
  +++ db/btree/btree_autop.c	23 Aug 2010 13:36:23 -0000	1.7.2.1
  @@ -7,7 +7,6 @@
   #include "dbinc/db_page.h"
   #include "dbinc/db_am.h"
   #include "dbinc/btree.h"
  -#include "dbinc/log.h"
   #include "dbinc/txn.h"
   
   /*
  @@ -15,705 +14,237 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_split_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_split_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_split_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __bam_split_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_split%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tleft: %lu\n", (u_long)argp->left);
  -	(void)printf("\tllsn: [%lu][%lu]\n",
  -	    (u_long)argp->llsn.file, (u_long)argp->llsn.offset);
  -	(void)printf("\tright: %lu\n", (u_long)argp->right);
  -	(void)printf("\trlsn: [%lu][%lu]\n",
  -	    (u_long)argp->rlsn.file, (u_long)argp->rlsn.offset);
  -	(void)printf("\tindx: %lu\n", (u_long)argp->indx);
  -	(void)printf("\tnpgno: %lu\n", (u_long)argp->npgno);
  -	(void)printf("\tnlsn: [%lu][%lu]\n",
  -	    (u_long)argp->nlsn.file, (u_long)argp->nlsn.offset);
  -	(void)printf("\tppgno: %lu\n", (u_long)argp->ppgno);
  -	(void)printf("\tplsn: [%lu][%lu]\n",
  -	    (u_long)argp->plsn.file, (u_long)argp->plsn.offset);
  -	(void)printf("\tpindx: %lu\n", (u_long)argp->pindx);
  -	(void)printf("\tpg: ");
  -	for (i = 0; i < argp->pg.size; i++) {
  -		ch = ((u_int8_t *)argp->pg.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tpentry: ");
  -	for (i = 0; i < argp->pentry.size; i++) {
  -		ch = ((u_int8_t *)argp->pentry.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\trentry: ");
  -	for (i = 0; i < argp->rentry.size; i++) {
  -		ch = ((u_int8_t *)argp->rentry.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\topflags: %lu\n", (u_long)argp->opflags);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  -}
  -
  -/*
  - * PUBLIC: int __bam_split_42_print __P((ENV *, DBT *, DB_LSN *,
  - * PUBLIC:     db_recops, void *));
  - */
  -int
  -__bam_split_42_print(env, dbtp, lsnp, notused2, notused3)
  -	ENV *env;
  -	DBT *dbtp;
  -	DB_LSN *lsnp;
  -	db_recops notused2;
  -	void *notused3;
  -{
  -	__bam_split_42_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_split_42_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_split_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tleft: %lu\n", (u_long)argp->left);
  -	(void)printf("\tllsn: [%lu][%lu]\n",
  -	    (u_long)argp->llsn.file, (u_long)argp->llsn.offset);
  -	(void)printf("\tright: %lu\n", (u_long)argp->right);
  -	(void)printf("\trlsn: [%lu][%lu]\n",
  -	    (u_long)argp->rlsn.file, (u_long)argp->rlsn.offset);
  -	(void)printf("\tindx: %lu\n", (u_long)argp->indx);
  -	(void)printf("\tnpgno: %lu\n", (u_long)argp->npgno);
  -	(void)printf("\tnlsn: [%lu][%lu]\n",
  -	    (u_long)argp->nlsn.file, (u_long)argp->nlsn.offset);
  -	(void)printf("\troot_pgno: %lu\n", (u_long)argp->root_pgno);
  -	(void)printf("\tpg: ");
  -	for (i = 0; i < argp->pg.size; i++) {
  -		ch = ((u_int8_t *)argp->pg.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\topflags: %lu\n", (u_long)argp->opflags);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_split", __bam_split_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_rsplit_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_split_48_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_rsplit_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_split_48_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_rsplit_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __bam_rsplit_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_rsplit%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tpgdbt: ");
  -	for (i = 0; i < argp->pgdbt.size; i++) {
  -		ch = ((u_int8_t *)argp->pgdbt.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\troot_pgno: %lu\n", (u_long)argp->root_pgno);
  -	(void)printf("\tnrec: %lu\n", (u_long)argp->nrec);
  -	(void)printf("\trootent: ");
  -	for (i = 0; i < argp->rootent.size; i++) {
  -		ch = ((u_int8_t *)argp->rootent.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\trootlsn: [%lu][%lu]\n",
  -	    (u_long)argp->rootlsn.file, (u_long)argp->rootlsn.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_split_48", __bam_split_48_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_adj_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_split_42_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_adj_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_split_42_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_adj_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_adj_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_adj%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\tindx: %lu\n", (u_long)argp->indx);
  -	(void)printf("\tindx_copy: %lu\n", (u_long)argp->indx_copy);
  -	(void)printf("\tis_insert: %lu\n", (u_long)argp->is_insert);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_split_42", __bam_split_42_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_cadjust_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_rsplit_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_cadjust_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_rsplit_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_cadjust_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_cadjust_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_cadjust%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\tindx: %lu\n", (u_long)argp->indx);
  -	(void)printf("\tadjust: %ld\n", (long)argp->adjust);
  -	(void)printf("\topflags: %lu\n", (u_long)argp->opflags);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_rsplit", __bam_rsplit_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_cdel_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_adj_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_cdel_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_adj_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_cdel_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_cdel_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_cdel%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\tindx: %lu\n", (u_long)argp->indx);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_adj", __bam_adj_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_repl_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_cadjust_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_repl_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_cadjust_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_repl_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_repl_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_repl%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\tindx: %lu\n", (u_long)argp->indx);
  -	(void)printf("\tisdeleted: %lu\n", (u_long)argp->isdeleted);
  -	(void)printf("\torig: ");
  -	for (i = 0; i < argp->orig.size; i++) {
  -		ch = ((u_int8_t *)argp->orig.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\trepl: ");
  -	for (i = 0; i < argp->repl.size; i++) {
  -		ch = ((u_int8_t *)argp->repl.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tprefix: %lu\n", (u_long)argp->prefix);
  -	(void)printf("\tsuffix: %lu\n", (u_long)argp->suffix);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_cadjust", __bam_cadjust_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_root_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_cdel_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_root_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_cdel_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_root_args *argp;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __bam_root_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_root%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
  -	(void)printf("\troot_pgno: %lu\n", (u_long)argp->root_pgno);
  -	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_cdel", __bam_cdel_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_curadj_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_repl_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_curadj_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_repl_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_curadj_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_curadj_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_curadj%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tmode: %ld\n", (long)argp->mode);
  -	(void)printf("\tfrom_pgno: %lu\n", (u_long)argp->from_pgno);
  -	(void)printf("\tto_pgno: %lu\n", (u_long)argp->to_pgno);
  -	(void)printf("\tleft_pgno: %lu\n", (u_long)argp->left_pgno);
  -	(void)printf("\tfirst_indx: %lu\n", (u_long)argp->first_indx);
  -	(void)printf("\tfrom_indx: %lu\n", (u_long)argp->from_indx);
  -	(void)printf("\tto_indx: %lu\n", (u_long)argp->to_indx);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_repl", __bam_repl_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_rcuradj_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_irep_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_rcuradj_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_irep_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_rcuradj_args *argp;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __bam_rcuradj_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_rcuradj%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tmode: %ld\n", (long)argp->mode);
  -	(void)printf("\troot: %ld\n", (long)argp->root);
  -	(void)printf("\trecno: %ld\n", (long)argp->recno);
  -	(void)printf("\torder: %lu\n", (u_long)argp->order);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_irep", __bam_irep_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_relink_43_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_root_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_relink_43_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_root_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_relink_43_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_relink_43_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_relink_43%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\tprev: %lu\n", (u_long)argp->prev);
  -	(void)printf("\tlsn_prev: [%lu][%lu]\n",
  -	    (u_long)argp->lsn_prev.file, (u_long)argp->lsn_prev.offset);
  -	(void)printf("\tnext: %lu\n", (u_long)argp->next);
  -	(void)printf("\tlsn_next: [%lu][%lu]\n",
  -	    (u_long)argp->lsn_next.file, (u_long)argp->lsn_next.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_root", __bam_root_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_relink_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_curadj_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_relink_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_curadj_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_relink_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_relink_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_relink%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tnew_pgno: %lu\n", (u_long)argp->new_pgno);
  -	(void)printf("\tprev: %lu\n", (u_long)argp->prev);
  -	(void)printf("\tlsn_prev: [%lu][%lu]\n",
  -	    (u_long)argp->lsn_prev.file, (u_long)argp->lsn_prev.offset);
  -	(void)printf("\tnext: %lu\n", (u_long)argp->next);
  -	(void)printf("\tlsn_next: [%lu][%lu]\n",
  -	    (u_long)argp->lsn_next.file, (u_long)argp->lsn_next.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_curadj", __bam_curadj_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_merge_44_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_rcuradj_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_merge_44_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_rcuradj_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_merge_44_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __bam_merge_44_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_merge_44%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\tnpgno: %lu\n", (u_long)argp->npgno);
  -	(void)printf("\tnlsn: [%lu][%lu]\n",
  -	    (u_long)argp->nlsn.file, (u_long)argp->nlsn.offset);
  -	(void)printf("\thdr: ");
  -	for (i = 0; i < argp->hdr.size; i++) {
  -		ch = ((u_int8_t *)argp->hdr.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tdata: ");
  -	for (i = 0; i < argp->data.size; i++) {
  -		ch = ((u_int8_t *)argp->data.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tind: ");
  -	for (i = 0; i < argp->ind.size; i++) {
  -		ch = ((u_int8_t *)argp->ind.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_rcuradj", __bam_rcuradj_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_merge_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_relink_43_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_merge_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_relink_43_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_merge_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_merge_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_merge%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\tnpgno: %lu\n", (u_long)argp->npgno);
  -	(void)printf("\tnlsn: [%lu][%lu]\n",
  -	    (u_long)argp->nlsn.file, (u_long)argp->nlsn.offset);
  -	(void)printf("\thdr: ");
  -	for (i = 0; i < argp->hdr.size; i++) {
  -		ch = ((u_int8_t *)argp->hdr.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tdata: ");
  -	for (i = 0; i < argp->data.size; i++) {
  -		ch = ((u_int8_t *)argp->data.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tpg_copy: %lu\n", (u_long)argp->pg_copy);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_relink_43", __bam_relink_43_desc, info));
   }
   
   /*
  - * PUBLIC: int __bam_pgno_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC: int __bam_merge_44_print __P((ENV *, DBT *, DB_LSN *,
    * PUBLIC:     db_recops, void *));
    */
   int
  -__bam_pgno_print(env, dbtp, lsnp, notused2, notused3)
  +__bam_merge_44_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__bam_pgno_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __bam_pgno_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__bam_pgno%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\tindx: %lu\n", (u_long)argp->indx);
  -	(void)printf("\topgno: %lu\n", (u_long)argp->opgno);
  -	(void)printf("\tnpgno: %lu\n", (u_long)argp->npgno);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__bam_merge_44", __bam_merge_44_desc, info));
   }
   
   /*
  @@ -745,6 +276,9 @@
   	    __bam_repl_print, DB___bam_repl)) != 0)
   		return (ret);
   	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __bam_irep_print, DB___bam_irep)) != 0)
  +		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
   	    __bam_root_print, DB___bam_root)) != 0)
   		return (ret);
   	if ((ret = __db_add_recovery_int(env, dtabp,
  @@ -753,14 +287,5 @@
   	if ((ret = __db_add_recovery_int(env, dtabp,
   	    __bam_rcuradj_print, DB___bam_rcuradj)) != 0)
   		return (ret);
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __bam_relink_print, DB___bam_relink)) != 0)
  -		return (ret);
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __bam_merge_print, DB___bam_merge)) != 0)
  -		return (ret);
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __bam_pgno_print, DB___bam_pgno)) != 0)
  -		return (ret);
   	return (0);
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_android/Android.mk
  ============================================================================
  $ cvs diff -u -r1.1.1.1 -r1.1.1.1.2.1 Android.mk
  --- db/build_android/Android.mk	1 Apr 2010 15:25:03 -0000	1.1.1.1
  +++ db/build_android/Android.mk	23 Aug 2010 13:36:25 -0000	1.1.1.1.2.1
  @@ -1,6 +1,6 @@
   # DO NOT EDIT: automatically built by dist/s_android.
   # Makefile for building a drop-in replacement of SQLite using
  -# Berkeley DB 11g Release 2, library version 11.2.5.0.21: (March 30, 2010)
  +# Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)
   ###################################################################
   LOCAL_PATH := $(call my-dir)
   include $(CLEAR_VARS)
  @@ -10,7 +10,7 @@
   LOCAL_MODULE := libsqlite
   
   # BDB_TOP will change with release numbers
  -BDB_TOP := db-5.0.21
  +BDB_TOP := db-5.0.26
   BDB_PATH := $(LOCAL_PATH)/$(BDB_TOP)
   
   # This directive results in arm (vs thumb) code.  It's necessary to
  @@ -26,184 +26,184 @@
   
   # Source files
   LOCAL_SRC_FILES := \
  -	$(BDB_TOP)/btree/bt_compact.c \
  -	$(BDB_TOP)/btree/bt_compare.c \
  -	$(BDB_TOP)/btree/bt_compress.c \
  -	$(BDB_TOP)/btree/bt_conv.c \
  -	$(BDB_TOP)/btree/bt_curadj.c \
  -	$(BDB_TOP)/btree/bt_cursor.c \
  -	$(BDB_TOP)/btree/bt_delete.c \
  -	$(BDB_TOP)/btree/bt_method.c \
  -	$(BDB_TOP)/btree/bt_open.c \
  -	$(BDB_TOP)/btree/bt_put.c \
  -	$(BDB_TOP)/btree/bt_rec.c \
  -	$(BDB_TOP)/btree/bt_reclaim.c \
  -	$(BDB_TOP)/btree/bt_recno.c \
  -	$(BDB_TOP)/btree/bt_rsearch.c \
  -	$(BDB_TOP)/btree/bt_search.c \
  -	$(BDB_TOP)/btree/bt_split.c \
  -	$(BDB_TOP)/btree/bt_stat.c \
  -	$(BDB_TOP)/btree/bt_upgrade.c \
  -	$(BDB_TOP)/btree/btree_auto.c \
  -	$(BDB_TOP)/clib/rand.c \
  -	$(BDB_TOP)/clib/snprintf.c \
  -	$(BDB_TOP)/common/clock.c \
  -	$(BDB_TOP)/common/crypto_stub.c \
  -	$(BDB_TOP)/common/db_byteorder.c \
  -	$(BDB_TOP)/common/db_compint.c \
  -	$(BDB_TOP)/common/db_err.c \
  -	$(BDB_TOP)/common/db_getlong.c \
  -	$(BDB_TOP)/common/db_idspace.c \
  -	$(BDB_TOP)/common/db_log2.c \
  -	$(BDB_TOP)/common/db_shash.c \
  -	$(BDB_TOP)/common/dbt.c \
  -	$(BDB_TOP)/common/mkpath.c \
  -	$(BDB_TOP)/common/os_method.c \
  -	$(BDB_TOP)/common/zerofill.c \
  -	$(BDB_TOP)/db/crdel_auto.c \
  -	$(BDB_TOP)/db/crdel_rec.c \
  -	$(BDB_TOP)/db/db.c \
  -	$(BDB_TOP)/db/db_am.c \
  -	$(BDB_TOP)/db/db_auto.c \
  -	$(BDB_TOP)/db/db_cam.c \
  -	$(BDB_TOP)/db/db_cds.c \
  -	$(BDB_TOP)/db/db_compact.c \
  -	$(BDB_TOP)/db/db_conv.c \
  -	$(BDB_TOP)/db/db_dispatch.c \
  -	$(BDB_TOP)/db/db_dup.c \
  -	$(BDB_TOP)/db/db_iface.c \
  -	$(BDB_TOP)/db/db_join.c \
  -	$(BDB_TOP)/db/db_meta.c \
  -	$(BDB_TOP)/db/db_method.c \
  -	$(BDB_TOP)/db/db_open.c \
  -	$(BDB_TOP)/db/db_overflow.c \
  -	$(BDB_TOP)/db/db_pr.c \
  -	$(BDB_TOP)/db/db_rec.c \
  -	$(BDB_TOP)/db/db_reclaim.c \
  -	$(BDB_TOP)/db/db_remove.c \
  -	$(BDB_TOP)/db/db_rename.c \
  -	$(BDB_TOP)/db/db_ret.c \
  -	$(BDB_TOP)/db/db_setid.c \
  -	$(BDB_TOP)/db/db_setlsn.c \
  -	$(BDB_TOP)/db/db_sort_multiple.c \
  -	$(BDB_TOP)/db/db_stati.c \
  -	$(BDB_TOP)/db/db_truncate.c \
  -	$(BDB_TOP)/db/db_upg.c \
  -	$(BDB_TOP)/db/db_upg_opd.c \
  -	$(BDB_TOP)/db/db_vrfy_stub.c \
  -	$(BDB_TOP)/db/partition.c \
  -	$(BDB_TOP)/dbreg/dbreg.c \
  -	$(BDB_TOP)/dbreg/dbreg_auto.c \
  -	$(BDB_TOP)/dbreg/dbreg_rec.c \
  -	$(BDB_TOP)/dbreg/dbreg_stat.c \
  -	$(BDB_TOP)/dbreg/dbreg_util.c \
  -	$(BDB_TOP)/env/env_alloc.c \
  -	$(BDB_TOP)/env/env_config.c \
  -	$(BDB_TOP)/env/env_failchk.c \
  -	$(BDB_TOP)/env/env_file.c \
  -	$(BDB_TOP)/env/env_globals.c \
  -	$(BDB_TOP)/env/env_method.c \
  -	$(BDB_TOP)/env/env_name.c \
  -	$(BDB_TOP)/env/env_open.c \
  -	$(BDB_TOP)/env/env_recover.c \
  -	$(BDB_TOP)/env/env_region.c \
  -	$(BDB_TOP)/env/env_register.c \
  -	$(BDB_TOP)/env/env_sig.c \
  -	$(BDB_TOP)/env/env_stat.c \
  -	$(BDB_TOP)/fileops/fileops_auto.c \
  -	$(BDB_TOP)/fileops/fop_basic.c \
  -	$(BDB_TOP)/fileops/fop_rec.c \
  -	$(BDB_TOP)/fileops/fop_util.c \
  -	$(BDB_TOP)/hash/hash_func.c \
  -	$(BDB_TOP)/hash/hash_stub.c \
  -	$(BDB_TOP)/hmac/hmac.c \
  -	$(BDB_TOP)/hmac/sha1.c \
  -	$(BDB_TOP)/lock/lock.c \
  -	$(BDB_TOP)/lock/lock_deadlock.c \
  -	$(BDB_TOP)/lock/lock_failchk.c \
  -	$(BDB_TOP)/lock/lock_id.c \
  -	$(BDB_TOP)/lock/lock_list.c \
  -	$(BDB_TOP)/lock/lock_method.c \
  -	$(BDB_TOP)/lock/lock_region.c \
  -	$(BDB_TOP)/lock/lock_stat.c \
  -	$(BDB_TOP)/lock/lock_timer.c \
  -	$(BDB_TOP)/lock/lock_util.c \
  -	$(BDB_TOP)/log/log.c \
  -	$(BDB_TOP)/log/log_archive.c \
  -	$(BDB_TOP)/log/log_compare.c \
  -	$(BDB_TOP)/log/log_debug.c \
  -	$(BDB_TOP)/log/log_get.c \
  -	$(BDB_TOP)/log/log_method.c \
  -	$(BDB_TOP)/log/log_print.c \
  -	$(BDB_TOP)/log/log_put.c \
  -	$(BDB_TOP)/log/log_stat.c \
  -	$(BDB_TOP)/log/log_verify_stub.c \
  -	$(BDB_TOP)/mp/mp_alloc.c \
  -	$(BDB_TOP)/mp/mp_bh.c \
  -	$(BDB_TOP)/mp/mp_fget.c \
  -	$(BDB_TOP)/mp/mp_fmethod.c \
  -	$(BDB_TOP)/mp/mp_fopen.c \
  -	$(BDB_TOP)/mp/mp_fput.c \
  -	$(BDB_TOP)/mp/mp_fset.c \
  -	$(BDB_TOP)/mp/mp_method.c \
  -	$(BDB_TOP)/mp/mp_mvcc.c \
  -	$(BDB_TOP)/mp/mp_region.c \
  -	$(BDB_TOP)/mp/mp_register.c \
  -	$(BDB_TOP)/mp/mp_resize.c \
  -	$(BDB_TOP)/mp/mp_stat.c \
  -	$(BDB_TOP)/mp/mp_sync.c \
  -	$(BDB_TOP)/mp/mp_trickle.c \
  -	$(BDB_TOP)/mutex/mut_alloc.c \
  -	$(BDB_TOP)/mutex/mut_failchk.c \
  -	$(BDB_TOP)/mutex/mut_method.c \
  -	$(BDB_TOP)/mutex/mut_region.c \
  -	$(BDB_TOP)/mutex/mut_stat.c \
  -	$(BDB_TOP)/mutex/mut_tas.c \
  -	$(BDB_TOP)/os/os_abort.c \
  -	$(BDB_TOP)/os/os_abs.c \
  -	$(BDB_TOP)/os/os_alloc.c \
  -	$(BDB_TOP)/os/os_clock.c \
  -	$(BDB_TOP)/os/os_config.c \
  -	$(BDB_TOP)/os/os_cpu.c \
  -	$(BDB_TOP)/os/os_ctime.c \
  -	$(BDB_TOP)/os/os_dir.c \
  -	$(BDB_TOP)/os/os_errno.c \
  -	$(BDB_TOP)/os/os_fid.c \
  -	$(BDB_TOP)/os/os_flock.c \
  -	$(BDB_TOP)/os/os_fsync.c \
  -	$(BDB_TOP)/os/os_getenv.c \
  -	$(BDB_TOP)/os/os_handle.c \
  -	$(BDB_TOP)/os/os_map.c \
  -	$(BDB_TOP)/os/os_mkdir.c \
  -	$(BDB_TOP)/os/os_open.c \
  -	$(BDB_TOP)/os/os_pid.c \
  -	$(BDB_TOP)/os/os_rename.c \
  -	$(BDB_TOP)/os/os_root.c \
  -	$(BDB_TOP)/os/os_rpath.c \
  -	$(BDB_TOP)/os/os_rw.c \
  -	$(BDB_TOP)/os/os_seek.c \
  -	$(BDB_TOP)/os/os_stack.c \
  -	$(BDB_TOP)/os/os_stat.c \
  -	$(BDB_TOP)/os/os_tmpdir.c \
  -	$(BDB_TOP)/os/os_truncate.c \
  -	$(BDB_TOP)/os/os_uid.c \
  -	$(BDB_TOP)/os/os_unlink.c \
  -	$(BDB_TOP)/os/os_yield.c \
  -	$(BDB_TOP)/qam/qam_stub.c \
  -	$(BDB_TOP)/rep/rep_stub.c \
  -	$(BDB_TOP)/repmgr/repmgr_stub.c \
  -	$(BDB_TOP)/sequence/seq_stat.c \
  -	$(BDB_TOP)/sequence/sequence.c \
  -	$(BDB_TOP)/txn/txn.c \
  -	$(BDB_TOP)/txn/txn_auto.c \
  -	$(BDB_TOP)/txn/txn_chkpt.c \
  -	$(BDB_TOP)/txn/txn_failchk.c \
  -	$(BDB_TOP)/txn/txn_method.c \
  -	$(BDB_TOP)/txn/txn_rec.c \
  -	$(BDB_TOP)/txn/txn_recover.c \
  -	$(BDB_TOP)/txn/txn_region.c \
  -	$(BDB_TOP)/txn/txn_stat.c \
  -	$(BDB_TOP)/txn/txn_util.c \
  +-e 	$(BDB_TOP)/btree/bt_compact.c \
  +-e 	$(BDB_TOP)/btree/bt_compare.c \
  +-e 	$(BDB_TOP)/btree/bt_compress.c \
  +-e 	$(BDB_TOP)/btree/bt_conv.c \
  +-e 	$(BDB_TOP)/btree/bt_curadj.c \
  +-e 	$(BDB_TOP)/btree/bt_cursor.c \
  +-e 	$(BDB_TOP)/btree/bt_delete.c \
  +-e 	$(BDB_TOP)/btree/bt_method.c \
  +-e 	$(BDB_TOP)/btree/bt_open.c \
  +-e 	$(BDB_TOP)/btree/bt_put.c \
  +-e 	$(BDB_TOP)/btree/bt_rec.c \
  +-e 	$(BDB_TOP)/btree/bt_reclaim.c \
  +-e 	$(BDB_TOP)/btree/bt_recno.c \
  +-e 	$(BDB_TOP)/btree/bt_rsearch.c \
  +-e 	$(BDB_TOP)/btree/bt_search.c \
  +-e 	$(BDB_TOP)/btree/bt_split.c \
  +-e 	$(BDB_TOP)/btree/bt_stat.c \
  +-e 	$(BDB_TOP)/btree/bt_upgrade.c \
  +-e 	$(BDB_TOP)/btree/btree_auto.c \
  +-e 	$(BDB_TOP)/clib/rand.c \
  +-e 	$(BDB_TOP)/clib/snprintf.c \
  +-e 	$(BDB_TOP)/common/clock.c \
  +-e 	$(BDB_TOP)/common/crypto_stub.c \
  +-e 	$(BDB_TOP)/common/db_byteorder.c \
  +-e 	$(BDB_TOP)/common/db_compint.c \
  +-e 	$(BDB_TOP)/common/db_err.c \
  +-e 	$(BDB_TOP)/common/db_getlong.c \
  +-e 	$(BDB_TOP)/common/db_idspace.c \
  +-e 	$(BDB_TOP)/common/db_log2.c \
  +-e 	$(BDB_TOP)/common/db_shash.c \
  +-e 	$(BDB_TOP)/common/dbt.c \
  +-e 	$(BDB_TOP)/common/mkpath.c \
  +-e 	$(BDB_TOP)/common/os_method.c \
  +-e 	$(BDB_TOP)/common/zerofill.c \
  +-e 	$(BDB_TOP)/db/crdel_auto.c \
  +-e 	$(BDB_TOP)/db/crdel_rec.c \
  +-e 	$(BDB_TOP)/db/db.c \
  +-e 	$(BDB_TOP)/db/db_am.c \
  +-e 	$(BDB_TOP)/db/db_auto.c \
  +-e 	$(BDB_TOP)/db/db_cam.c \
  +-e 	$(BDB_TOP)/db/db_cds.c \
  +-e 	$(BDB_TOP)/db/db_compact.c \
  +-e 	$(BDB_TOP)/db/db_conv.c \
  +-e 	$(BDB_TOP)/db/db_dispatch.c \
  +-e 	$(BDB_TOP)/db/db_dup.c \
  +-e 	$(BDB_TOP)/db/db_iface.c \
  +-e 	$(BDB_TOP)/db/db_join.c \
  +-e 	$(BDB_TOP)/db/db_meta.c \
  +-e 	$(BDB_TOP)/db/db_method.c \
  +-e 	$(BDB_TOP)/db/db_open.c \
  +-e 	$(BDB_TOP)/db/db_overflow.c \
  +-e 	$(BDB_TOP)/db/db_pr.c \
  +-e 	$(BDB_TOP)/db/db_rec.c \
  +-e 	$(BDB_TOP)/db/db_reclaim.c \
  +-e 	$(BDB_TOP)/db/db_remove.c \
  +-e 	$(BDB_TOP)/db/db_rename.c \
  +-e 	$(BDB_TOP)/db/db_ret.c \
  +-e 	$(BDB_TOP)/db/db_setid.c \
  +-e 	$(BDB_TOP)/db/db_setlsn.c \
  +-e 	$(BDB_TOP)/db/db_sort_multiple.c \
  +-e 	$(BDB_TOP)/db/db_stati.c \
  +-e 	$(BDB_TOP)/db/db_truncate.c \
  +-e 	$(BDB_TOP)/db/db_upg.c \
  +-e 	$(BDB_TOP)/db/db_upg_opd.c \
  +-e 	$(BDB_TOP)/db/db_vrfy_stub.c \
  +-e 	$(BDB_TOP)/db/partition.c \
  +-e 	$(BDB_TOP)/dbreg/dbreg.c \
  +-e 	$(BDB_TOP)/dbreg/dbreg_auto.c \
  +-e 	$(BDB_TOP)/dbreg/dbreg_rec.c \
  +-e 	$(BDB_TOP)/dbreg/dbreg_stat.c \
  +-e 	$(BDB_TOP)/dbreg/dbreg_util.c \
  +-e 	$(BDB_TOP)/env/env_alloc.c \
  +-e 	$(BDB_TOP)/env/env_config.c \
  +-e 	$(BDB_TOP)/env/env_failchk.c \
  +-e 	$(BDB_TOP)/env/env_file.c \
  +-e 	$(BDB_TOP)/env/env_globals.c \
  +-e 	$(BDB_TOP)/env/env_method.c \
  +-e 	$(BDB_TOP)/env/env_name.c \
  +-e 	$(BDB_TOP)/env/env_open.c \
  +-e 	$(BDB_TOP)/env/env_recover.c \
  +-e 	$(BDB_TOP)/env/env_region.c \
  +-e 	$(BDB_TOP)/env/env_register.c \
  +-e 	$(BDB_TOP)/env/env_sig.c \
  +-e 	$(BDB_TOP)/env/env_stat.c \
  +-e 	$(BDB_TOP)/fileops/fileops_auto.c \
  +-e 	$(BDB_TOP)/fileops/fop_basic.c \
  +-e 	$(BDB_TOP)/fileops/fop_rec.c \
  +-e 	$(BDB_TOP)/fileops/fop_util.c \
  +-e 	$(BDB_TOP)/hash/hash_func.c \
  +-e 	$(BDB_TOP)/hash/hash_stub.c \
  +-e 	$(BDB_TOP)/hmac/hmac.c \
  +-e 	$(BDB_TOP)/hmac/sha1.c \
  +-e 	$(BDB_TOP)/lock/lock.c \
  +-e 	$(BDB_TOP)/lock/lock_deadlock.c \
  +-e 	$(BDB_TOP)/lock/lock_failchk.c \
  +-e 	$(BDB_TOP)/lock/lock_id.c \
  +-e 	$(BDB_TOP)/lock/lock_list.c \
  +-e 	$(BDB_TOP)/lock/lock_method.c \
  +-e 	$(BDB_TOP)/lock/lock_region.c \
  +-e 	$(BDB_TOP)/lock/lock_stat.c \
  +-e 	$(BDB_TOP)/lock/lock_timer.c \
  +-e 	$(BDB_TOP)/lock/lock_util.c \
  +-e 	$(BDB_TOP)/log/log.c \
  +-e 	$(BDB_TOP)/log/log_archive.c \
  +-e 	$(BDB_TOP)/log/log_compare.c \
  +-e 	$(BDB_TOP)/log/log_debug.c \
  +-e 	$(BDB_TOP)/log/log_get.c \
  +-e 	$(BDB_TOP)/log/log_method.c \
  +-e 	$(BDB_TOP)/log/log_print.c \
  +-e 	$(BDB_TOP)/log/log_put.c \
  +-e 	$(BDB_TOP)/log/log_stat.c \
  +-e 	$(BDB_TOP)/log/log_verify_stub.c \
  +-e 	$(BDB_TOP)/mp/mp_alloc.c \
  +-e 	$(BDB_TOP)/mp/mp_bh.c \
  +-e 	$(BDB_TOP)/mp/mp_fget.c \
  +-e 	$(BDB_TOP)/mp/mp_fmethod.c \
  +-e 	$(BDB_TOP)/mp/mp_fopen.c \
  +-e 	$(BDB_TOP)/mp/mp_fput.c \
  +-e 	$(BDB_TOP)/mp/mp_fset.c \
  +-e 	$(BDB_TOP)/mp/mp_method.c \
  +-e 	$(BDB_TOP)/mp/mp_mvcc.c \
  +-e 	$(BDB_TOP)/mp/mp_region.c \
  +-e 	$(BDB_TOP)/mp/mp_register.c \
  +-e 	$(BDB_TOP)/mp/mp_resize.c \
  +-e 	$(BDB_TOP)/mp/mp_stat.c \
  +-e 	$(BDB_TOP)/mp/mp_sync.c \
  +-e 	$(BDB_TOP)/mp/mp_trickle.c \
  +-e 	$(BDB_TOP)/mutex/mut_alloc.c \
  +-e 	$(BDB_TOP)/mutex/mut_failchk.c \
  +-e 	$(BDB_TOP)/mutex/mut_method.c \
  +-e 	$(BDB_TOP)/mutex/mut_region.c \
  +-e 	$(BDB_TOP)/mutex/mut_stat.c \
  +-e 	$(BDB_TOP)/mutex/mut_tas.c \
  +-e 	$(BDB_TOP)/os/os_abort.c \
  +-e 	$(BDB_TOP)/os/os_abs.c \
  +-e 	$(BDB_TOP)/os/os_alloc.c \
  +-e 	$(BDB_TOP)/os/os_clock.c \
  +-e 	$(BDB_TOP)/os/os_config.c \
  +-e 	$(BDB_TOP)/os/os_cpu.c \
  +-e 	$(BDB_TOP)/os/os_ctime.c \
  +-e 	$(BDB_TOP)/os/os_dir.c \
  +-e 	$(BDB_TOP)/os/os_errno.c \
  +-e 	$(BDB_TOP)/os/os_fid.c \
  +-e 	$(BDB_TOP)/os/os_flock.c \
  +-e 	$(BDB_TOP)/os/os_fsync.c \
  +-e 	$(BDB_TOP)/os/os_getenv.c \
  +-e 	$(BDB_TOP)/os/os_handle.c \
  +-e 	$(BDB_TOP)/os/os_map.c \
  +-e 	$(BDB_TOP)/os/os_mkdir.c \
  +-e 	$(BDB_TOP)/os/os_open.c \
  +-e 	$(BDB_TOP)/os/os_pid.c \
  +-e 	$(BDB_TOP)/os/os_rename.c \
  +-e 	$(BDB_TOP)/os/os_root.c \
  +-e 	$(BDB_TOP)/os/os_rpath.c \
  +-e 	$(BDB_TOP)/os/os_rw.c \
  +-e 	$(BDB_TOP)/os/os_seek.c \
  +-e 	$(BDB_TOP)/os/os_stack.c \
  +-e 	$(BDB_TOP)/os/os_stat.c \
  +-e 	$(BDB_TOP)/os/os_tmpdir.c \
  +-e 	$(BDB_TOP)/os/os_truncate.c \
  +-e 	$(BDB_TOP)/os/os_uid.c \
  +-e 	$(BDB_TOP)/os/os_unlink.c \
  +-e 	$(BDB_TOP)/os/os_yield.c \
  +-e 	$(BDB_TOP)/qam/qam_stub.c \
  +-e 	$(BDB_TOP)/rep/rep_stub.c \
  +-e 	$(BDB_TOP)/repmgr/repmgr_stub.c \
  +-e 	$(BDB_TOP)/sequence/seq_stat.c \
  +-e 	$(BDB_TOP)/sequence/sequence.c \
  +-e 	$(BDB_TOP)/txn/txn.c \
  +-e 	$(BDB_TOP)/txn/txn_auto.c \
  +-e 	$(BDB_TOP)/txn/txn_chkpt.c \
  +-e 	$(BDB_TOP)/txn/txn_failchk.c \
  +-e 	$(BDB_TOP)/txn/txn_method.c \
  +-e 	$(BDB_TOP)/txn/txn_rec.c \
  +-e 	$(BDB_TOP)/txn/txn_recover.c \
  +-e 	$(BDB_TOP)/txn/txn_region.c \
  +-e 	$(BDB_TOP)/txn/txn_stat.c \
  +-e 	$(BDB_TOP)/txn/txn_util.c \
   	$(BDB_TOP)/sql/generated/sqlite3.c
   
   ifneq ($(TARGET_ARCH),arm)
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_android/db.h
  ============================================================================
  $ cvs diff -u -r1.1.1.1 -r1.1.1.1.2.1 db.h
  --- db/build_android/db.h	1 Apr 2010 15:25:03 -0000	1.1.1.1
  +++ db/build_android/db.h	23 Aug 2010 13:36:25 -0000	1.1.1.1.2.1
  @@ -46,9 +46,9 @@
   #define	DB_VERSION_RELEASE	2
   #define	DB_VERSION_MAJOR	5
   #define	DB_VERSION_MINOR	0
  -#define	DB_VERSION_PATCH	21
  -#define	DB_VERSION_STRING	"Berkeley DB 5.0.21: (March 30, 2010)"
  -#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.21: (March 30, 2010)"
  +#define	DB_VERSION_PATCH	26
  +#define	DB_VERSION_STRING	"Berkeley DB 5.0.26: (June 25, 2010)"
  +#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)"
   
   /*
    * !!!
  @@ -2772,7 +2772,7 @@
   char *db_full_version __P((int *, int *, int *, int *, int *));
   int log_compare __P((const DB_LSN *, const DB_LSN *));
   int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
  -#ifdef HAVE_DBM
  +#if DB_DBM_HSEARCH != 0
   int	 __db_ndbm_clearerr __P((DBM *));
   void	 __db_ndbm_close __P((DBM *));
   int	 __db_ndbm_delete __P((DBM *, datum));
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_android/db_config.h
  ============================================================================
  $ cvs diff -u -r1.1.1.1 -r1.1.1.1.2.1 db_config.h
  --- db/build_android/db_config.h	1 Apr 2010 15:25:03 -0000	1.1.1.1
  +++ db/build_android/db_config.h	23 Aug 2010 13:36:25 -0000	1.1.1.1.2.1
  @@ -544,16 +544,16 @@
   #define PACKAGE_NAME "Berkeley DB"
   
   /* Define to the full name and version of this package. */
  -#define PACKAGE_STRING "Berkeley DB 5.0.21"
  +#define PACKAGE_STRING "Berkeley DB 5.0.26"
   
   /* Define to the one symbol short name of this package. */
  -#define PACKAGE_TARNAME "db-5.0.21"
  +#define PACKAGE_TARNAME "db-5.0.26"
   
   /* Define to the home page for this package. */
   #define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
   
   /* Define to the version of this package. */
  -#define PACKAGE_VERSION "5.0.21"
  +#define PACKAGE_VERSION "5.0.26"
   
   /* The size of `char', as computed by sizeof. */
   #define SIZEOF_CHAR 1
  @@ .
  rm -f db/build_brew/db.h <<'@@ .'
  Index: db/build_brew/db.h
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_brew/db_config.h <<'@@ .'
  Index: db/build_brew/db_config.h
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_s60/db.h <<'@@ .'
  Index: db/build_s60/db.h
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_s60/db_config.h <<'@@ .'
  Index: db/build_s60/db_config.h
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/BerkeleyDB20.wpj
  ============================================================================
  $ cvs diff -u -r1.8 -r1.8.2.1 BerkeleyDB20.wpj
  --- db/build_vxworks/BerkeleyDB20.wpj	16 Sep 2009 19:34:38 -0000	1.8
  +++ db/build_vxworks/BerkeleyDB20.wpj	23 Aug 2010 13:36:26 -0000	1.8.2.1
  @@ -699,6 +699,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_objects
  +clock.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../common/db_byteorder.c_dependDone
   TRUE
   <END>
  @@ -1185,6 +1203,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_objects
  +db_compact.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../db/db_conv.c_dependDone
   TRUE
   <END>
  @@ -2085,6 +2121,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../hash/hash_compact.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../hash/hash_compact.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../hash/hash_compact.c_objects
  +hash_compact.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../hash/hash_compact.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../hash/hash_conv.c_dependDone
   TRUE
   <END>
  @@ -2625,6 +2679,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_objects
  +log_print.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../log/log_put.c_dependDone
   TRUE
   <END>
  @@ -2661,6 +2733,78 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify.c_objects
  +log_verify.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_util.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_util.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_util.c_objects
  +log_verify_util.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_util.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_auto.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_auto.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_auto.c_objects
  +log_verify_auto.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_auto.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_int.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_int.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_int.c_objects
  +log_verify_int.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_int.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../mp/mp_alloc.c_dependDone
   TRUE
   <END>
  @@ -3057,6 +3201,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../os/os_addrinfo.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../os/os_addrinfo.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../os/os_addrinfo.c_objects
  +os_addrinfo.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../os/os_addrinfo.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../os/os_alloc.c_dependDone
   TRUE
   <END>
  @@ -3957,21 +4119,201 @@
   C/C++ compiler
   <END>
   
  -<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stub.c_dependDone
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_auto.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_auto.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_auto.c_objects
  +repmgr_auto.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_auto.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_elect.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_elect.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_elect.c_objects
  +repmgr_elect.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_elect.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_method.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_method.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_method.c_objects
  +repmgr_method.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_method.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_msg.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_msg.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_msg.c_objects
  +repmgr_msg.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_msg.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_net.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_net.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_net.c_objects
  +repmgr_net.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_net.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_posix.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_posix.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_posix.c_objects
  +repmgr_posix.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_posix.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_queue.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_queue.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_queue.c_objects
  +repmgr_queue.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_queue.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_rereq.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_rereq.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_rereq.c_objects
  +repmgr_rereq.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_rereq.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_sel.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_sel.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_sel.c_objects
  +repmgr_sel.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_sel.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stat.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stat.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stat.c_objects
  +repmgr_stat.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stat.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_util.c_dependDone
   TRUE
   <END>
   
  -<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stub.c_dependencies
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_util.c_dependencies
   $(PRJ_DIR)/db_config.h \
   	$(PRJ_DIR)/db_int.h \
   	$(PRJ_DIR)/db.h
   <END>
   
  -<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stub.c_objects
  -repmgr_stub.o
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_util.c_objects
  +repmgr_util.o
   <END>
   
  -<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stub.c_tool
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_util.c_tool
   C/C++ compiler
   <END>
   
  @@ -4181,6 +4523,7 @@
   	$(PRJ_DIR)/../clib/strcasecmp.c \
   	$(PRJ_DIR)/../clib/strdup.c \
   	$(PRJ_DIR)/../clib/strsep.c \
  +	$(PRJ_DIR)/../common/clock.c \
   	$(PRJ_DIR)/../common/db_byteorder.c \
   	$(PRJ_DIR)/../common/db_compint.c \
   	$(PRJ_DIR)/../common/db_err.c \
  @@ -4208,6 +4551,7 @@
   	$(PRJ_DIR)/../db/db_auto.c \
   	$(PRJ_DIR)/../db/db_cam.c \
   	$(PRJ_DIR)/../db/db_cds.c \
  +	$(PRJ_DIR)/../db/db_compact.c \
   	$(PRJ_DIR)/../db/db_conv.c \
   	$(PRJ_DIR)/../db/db_dispatch.c \
   	$(PRJ_DIR)/../db/db_dup.c \
  @@ -4258,6 +4602,7 @@
   	$(PRJ_DIR)/../fileops/fop_util.c \
   	$(PRJ_DIR)/../hash/hash.c \
   	$(PRJ_DIR)/../hash/hash_auto.c \
  +	$(PRJ_DIR)/../hash/hash_compact.c \
   	$(PRJ_DIR)/../hash/hash_conv.c \
   	$(PRJ_DIR)/../hash/hash_dup.c \
   	$(PRJ_DIR)/../hash/hash_func.c \
  @@ -4288,8 +4633,13 @@
   	$(PRJ_DIR)/../log/log_debug.c \
   	$(PRJ_DIR)/../log/log_get.c \
   	$(PRJ_DIR)/../log/log_method.c \
  +	$(PRJ_DIR)/../log/log_print.c \
   	$(PRJ_DIR)/../log/log_put.c \
   	$(PRJ_DIR)/../log/log_stat.c \
  +	$(PRJ_DIR)/../log/log_verify.c \
  +	$(PRJ_DIR)/../log/log_verify_util.c \
  +	$(PRJ_DIR)/../log/log_verify_auto.c \
  +	$(PRJ_DIR)/../log/log_verify_int.c \
   	$(PRJ_DIR)/../mp/mp_alloc.c \
   	$(PRJ_DIR)/../mp/mp_bh.c \
   	$(PRJ_DIR)/../mp/mp_fget.c \
  @@ -4312,6 +4662,7 @@
   	$(PRJ_DIR)/../mutex/mut_stat.c \
   	$(PRJ_DIR)/../mutex/mut_tas.c \
   	$(PRJ_DIR)/../os/os_abort.c \
  +	$(PRJ_DIR)/../os/os_addrinfo.c \
   	$(PRJ_DIR)/../os/os_alloc.c \
   	$(PRJ_DIR)/../os/os_clock.c \
   	$(PRJ_DIR)/../os/os_cpu.c \
  @@ -4362,7 +4713,17 @@
   	$(PRJ_DIR)/../rep/rep_stat.c \
   	$(PRJ_DIR)/../rep/rep_util.c \
   	$(PRJ_DIR)/../rep/rep_verify.c \
  -	$(PRJ_DIR)/../repmgr/repmgr_stub.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_auto.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_elect.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_method.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_msg.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_net.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_posix.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_queue.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_rereq.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_sel.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_stat.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_util.c \
   	$(PRJ_DIR)/../txn/txn.c \
   	$(PRJ_DIR)/../txn/txn_auto.c \
   	$(PRJ_DIR)/../txn/txn_chkpt.c \
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/BerkeleyDB20small.wpj
  ============================================================================
  $ cvs diff -u -r1.7 -r1.7.2.1 BerkeleyDB20small.wpj
  --- db/build_vxworks/BerkeleyDB20small.wpj	16 Sep 2009 19:34:38 -0000	1.7
  +++ db/build_vxworks/BerkeleyDB20small.wpj	23 Aug 2010 13:36:26 -0000	1.7.2.1
  @@ -681,6 +681,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_objects
  +clock.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../common/crypto_stub.c_dependDone
   TRUE
   <END>
  @@ -1095,6 +1113,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_objects
  +db_compact.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../db/db_conv.c_dependDone
   TRUE
   <END>
  @@ -2265,6 +2301,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_objects
  +log_print.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../log/log_put.c_dependDone
   TRUE
   <END>
  @@ -2301,6 +2355,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_stub.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_stub.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_stub.c_objects
  +log_verify_stub.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_stub.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../mp/mp_alloc.c_dependDone
   TRUE
   <END>
  @@ -3478,6 +3550,7 @@
   	$(PRJ_DIR)/../clib/strcasecmp.c \
   	$(PRJ_DIR)/../clib/strdup.c \
   	$(PRJ_DIR)/../clib/strsep.c \
  +	$(PRJ_DIR)/../common/clock.c \
   	$(PRJ_DIR)/../common/crypto_stub.c \
   	$(PRJ_DIR)/../common/db_byteorder.c \
   	$(PRJ_DIR)/../common/db_compint.c \
  @@ -3501,6 +3574,7 @@
   	$(PRJ_DIR)/../db/db_auto.c \
   	$(PRJ_DIR)/../db/db_cam.c \
   	$(PRJ_DIR)/../db/db_cds.c \
  +	$(PRJ_DIR)/../db/db_compact.c \
   	$(PRJ_DIR)/../db/db_conv.c \
   	$(PRJ_DIR)/../db/db_dispatch.c \
   	$(PRJ_DIR)/../db/db_dup.c \
  @@ -3566,8 +3640,10 @@
   	$(PRJ_DIR)/../log/log_debug.c \
   	$(PRJ_DIR)/../log/log_get.c \
   	$(PRJ_DIR)/../log/log_method.c \
  +	$(PRJ_DIR)/../log/log_print.c \
   	$(PRJ_DIR)/../log/log_put.c \
   	$(PRJ_DIR)/../log/log_stat.c \
  +	$(PRJ_DIR)/../log/log_verify_stub.c \
   	$(PRJ_DIR)/../mp/mp_alloc.c \
   	$(PRJ_DIR)/../mp/mp_bh.c \
   	$(PRJ_DIR)/../mp/mp_fget.c \
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/BerkeleyDB22.wpj
  ============================================================================
  $ cvs diff -u -r1.8 -r1.8.2.1 BerkeleyDB22.wpj
  --- db/build_vxworks/BerkeleyDB22.wpj	16 Sep 2009 19:34:38 -0000	1.8
  +++ db/build_vxworks/BerkeleyDB22.wpj	23 Aug 2010 13:36:26 -0000	1.8.2.1
  @@ -758,6 +758,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_objects
  +clock.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../common/db_byteorder.c_dependDone
   TRUE
   <END>
  @@ -1244,6 +1262,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_objects
  +db_compact.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../db/db_conv.c_dependDone
   TRUE
   <END>
  @@ -2144,6 +2180,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../hash/hash_compact.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../hash/hash_compact.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../hash/hash_compact.c_objects
  +hash_compact.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../hash/hash_compact.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../hash/hash_conv.c_dependDone
   TRUE
   <END>
  @@ -2684,6 +2738,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_objects
  +log_print.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../log/log_put.c_dependDone
   TRUE
   <END>
  @@ -2720,6 +2792,78 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify.c_objects
  +log_verify.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_util.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_util.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_util.c_objects
  +log_verify_util.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_util.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_auto.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_auto.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_auto.c_objects
  +log_verify_auto.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_auto.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_int.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_int.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_int.c_objects
  +log_verify_int.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_int.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../mp/mp_alloc.c_dependDone
   TRUE
   <END>
  @@ -3116,6 +3260,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../os/os_addrinfo.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../os/os_addrinfo.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../os/os_addrinfo.c_objects
  +os_addrinfo.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../os/os_addrinfo.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../os/os_alloc.c_dependDone
   TRUE
   <END>
  @@ -4016,21 +4178,201 @@
   C/C++ compiler
   <END>
   
  -<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stub.c_dependDone
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_auto.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_auto.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_auto.c_objects
  +repmgr_auto.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_auto.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_elect.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_elect.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_elect.c_objects
  +repmgr_elect.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_elect.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_method.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_method.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_method.c_objects
  +repmgr_method.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_method.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_msg.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_msg.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_msg.c_objects
  +repmgr_msg.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_msg.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_net.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_net.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_net.c_objects
  +repmgr_net.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_net.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_posix.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_posix.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_posix.c_objects
  +repmgr_posix.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_posix.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_queue.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_queue.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_queue.c_objects
  +repmgr_queue.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_queue.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_rereq.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_rereq.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_rereq.c_objects
  +repmgr_rereq.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_rereq.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_sel.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_sel.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_sel.c_objects
  +repmgr_sel.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_sel.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stat.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stat.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stat.c_objects
  +repmgr_stat.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stat.c_tool
  +C/C++ compiler
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_util.c_dependDone
   TRUE
   <END>
   
  -<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stub.c_dependencies
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_util.c_dependencies
   $(PRJ_DIR)/db_config.h \
   	$(PRJ_DIR)/db_int.h \
   	$(PRJ_DIR)/db.h
   <END>
   
  -<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stub.c_objects
  -repmgr_stub.o
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_util.c_objects
  +repmgr_util.o
   <END>
   
  -<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_stub.c_tool
  +<BEGIN> FILE_$(PRJ_DIR)/../repmgr/repmgr_util.c_tool
   C/C++ compiler
   <END>
   
  @@ -4240,6 +4582,7 @@
   	$(PRJ_DIR)/../clib/strcasecmp.c \
   	$(PRJ_DIR)/../clib/strdup.c \
   	$(PRJ_DIR)/../clib/strsep.c \
  +	$(PRJ_DIR)/../common/clock.c \
   	$(PRJ_DIR)/../common/db_byteorder.c \
   	$(PRJ_DIR)/../common/db_compint.c \
   	$(PRJ_DIR)/../common/db_err.c \
  @@ -4267,6 +4610,7 @@
   	$(PRJ_DIR)/../db/db_auto.c \
   	$(PRJ_DIR)/../db/db_cam.c \
   	$(PRJ_DIR)/../db/db_cds.c \
  +	$(PRJ_DIR)/../db/db_compact.c \
   	$(PRJ_DIR)/../db/db_conv.c \
   	$(PRJ_DIR)/../db/db_dispatch.c \
   	$(PRJ_DIR)/../db/db_dup.c \
  @@ -4317,6 +4661,7 @@
   	$(PRJ_DIR)/../fileops/fop_util.c \
   	$(PRJ_DIR)/../hash/hash.c \
   	$(PRJ_DIR)/../hash/hash_auto.c \
  +	$(PRJ_DIR)/../hash/hash_compact.c \
   	$(PRJ_DIR)/../hash/hash_conv.c \
   	$(PRJ_DIR)/../hash/hash_dup.c \
   	$(PRJ_DIR)/../hash/hash_func.c \
  @@ -4347,8 +4692,13 @@
   	$(PRJ_DIR)/../log/log_debug.c \
   	$(PRJ_DIR)/../log/log_get.c \
   	$(PRJ_DIR)/../log/log_method.c \
  +	$(PRJ_DIR)/../log/log_print.c \
   	$(PRJ_DIR)/../log/log_put.c \
   	$(PRJ_DIR)/../log/log_stat.c \
  +	$(PRJ_DIR)/../log/log_verify.c \
  +	$(PRJ_DIR)/../log/log_verify_util.c \
  +	$(PRJ_DIR)/../log/log_verify_auto.c \
  +	$(PRJ_DIR)/../log/log_verify_int.c \
   	$(PRJ_DIR)/../mp/mp_alloc.c \
   	$(PRJ_DIR)/../mp/mp_bh.c \
   	$(PRJ_DIR)/../mp/mp_fget.c \
  @@ -4371,6 +4721,7 @@
   	$(PRJ_DIR)/../mutex/mut_stat.c \
   	$(PRJ_DIR)/../mutex/mut_tas.c \
   	$(PRJ_DIR)/../os/os_abort.c \
  +	$(PRJ_DIR)/../os/os_addrinfo.c \
   	$(PRJ_DIR)/../os/os_alloc.c \
   	$(PRJ_DIR)/../os/os_clock.c \
   	$(PRJ_DIR)/../os/os_cpu.c \
  @@ -4421,7 +4772,17 @@
   	$(PRJ_DIR)/../rep/rep_stat.c \
   	$(PRJ_DIR)/../rep/rep_util.c \
   	$(PRJ_DIR)/../rep/rep_verify.c \
  -	$(PRJ_DIR)/../repmgr/repmgr_stub.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_auto.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_elect.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_method.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_msg.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_net.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_posix.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_queue.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_rereq.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_sel.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_stat.c \
  +	$(PRJ_DIR)/../repmgr/repmgr_util.c \
   	$(PRJ_DIR)/../txn/txn.c \
   	$(PRJ_DIR)/../txn/txn_auto.c \
   	$(PRJ_DIR)/../txn/txn_chkpt.c \
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/BerkeleyDB22small.wpj
  ============================================================================
  $ cvs diff -u -r1.7 -r1.7.2.1 BerkeleyDB22small.wpj
  --- db/build_vxworks/BerkeleyDB22small.wpj	16 Sep 2009 19:34:38 -0000	1.7
  +++ db/build_vxworks/BerkeleyDB22small.wpj	23 Aug 2010 13:36:26 -0000	1.7.2.1
  @@ -739,6 +739,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_objects
  +clock.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../common/clock.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../common/crypto_stub.c_dependDone
   TRUE
   <END>
  @@ -1153,6 +1171,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_objects
  +db_compact.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../db/db_compact.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../db/db_conv.c_dependDone
   TRUE
   <END>
  @@ -2323,6 +2359,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_objects
  +log_print.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_print.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../log/log_put.c_dependDone
   TRUE
   <END>
  @@ -2359,6 +2413,24 @@
   C/C++ compiler
   <END>
   
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_stub.c_dependDone
  +TRUE
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_stub.c_dependencies
  +$(PRJ_DIR)/db_config.h \
  +	$(PRJ_DIR)/db_int.h \
  +	$(PRJ_DIR)/db.h
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_stub.c_objects
  +log_verify_stub.o
  +<END>
  +
  +<BEGIN> FILE_$(PRJ_DIR)/../log/log_verify_stub.c_tool
  +C/C++ compiler
  +<END>
  +
   <BEGIN> FILE_$(PRJ_DIR)/../mp/mp_alloc.c_dependDone
   TRUE
   <END>
  @@ -3536,6 +3608,7 @@
   	$(PRJ_DIR)/../clib/strcasecmp.c \
   	$(PRJ_DIR)/../clib/strdup.c \
   	$(PRJ_DIR)/../clib/strsep.c \
  +	$(PRJ_DIR)/../common/clock.c \
   	$(PRJ_DIR)/../common/crypto_stub.c \
   	$(PRJ_DIR)/../common/db_byteorder.c \
   	$(PRJ_DIR)/../common/db_compint.c \
  @@ -3559,6 +3632,7 @@
   	$(PRJ_DIR)/../db/db_auto.c \
   	$(PRJ_DIR)/../db/db_cam.c \
   	$(PRJ_DIR)/../db/db_cds.c \
  +	$(PRJ_DIR)/../db/db_compact.c \
   	$(PRJ_DIR)/../db/db_conv.c \
   	$(PRJ_DIR)/../db/db_dispatch.c \
   	$(PRJ_DIR)/../db/db_dup.c \
  @@ -3624,8 +3698,10 @@
   	$(PRJ_DIR)/../log/log_debug.c \
   	$(PRJ_DIR)/../log/log_get.c \
   	$(PRJ_DIR)/../log/log_method.c \
  +	$(PRJ_DIR)/../log/log_print.c \
   	$(PRJ_DIR)/../log/log_put.c \
   	$(PRJ_DIR)/../log/log_stat.c \
  +	$(PRJ_DIR)/../log/log_verify_stub.c \
   	$(PRJ_DIR)/../mp/mp_alloc.c \
   	$(PRJ_DIR)/../mp/mp_bh.c \
   	$(PRJ_DIR)/../mp/mp_fget.c \
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db.h
  ============================================================================
  $ cvs diff -u -r1.18 -r1.18.2.1 db.h
  --- db/build_vxworks/db.h	7 Jan 2010 22:02:21 -0000	1.18
  +++ db/build_vxworks/db.h	23 Aug 2010 13:36:26 -0000	1.18.2.1
  @@ -2,7 +2,7 @@
   /*
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    *
  @@ -24,6 +24,7 @@
   #ifndef	__NO_SYSTEM_INCLUDES
   #include <sys/types.h>
   #include <stdio.h>
  +#include <pthread.h>
   #endif
   
   #if defined(__cplusplus)
  @@ -42,10 +43,13 @@
   /*
    * Berkeley DB version information.
    */
  -#define	DB_VERSION_MAJOR	4
  -#define	DB_VERSION_MINOR	8
  +#define	DB_VERSION_FAMILY	11
  +#define	DB_VERSION_RELEASE	2
  +#define	DB_VERSION_MAJOR	5
  +#define	DB_VERSION_MINOR	0
   #define	DB_VERSION_PATCH	26
  -#define	DB_VERSION_STRING	"Berkeley DB 4.8.26: (December 18, 2009)"
  +#define	DB_VERSION_STRING	"Berkeley DB 5.0.26: (June 25, 2010)"
  +#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)"
   
   /*
    * !!!
  @@ -163,6 +167,7 @@
   struct __db_txn;	typedef struct __db_txn DB_TXN;
   struct __db_txn_active;	typedef struct __db_txn_active DB_TXN_ACTIVE;
   struct __db_txn_stat;	typedef struct __db_txn_stat DB_TXN_STAT;
  +struct __db_txn_token;	typedef struct __db_txn_token DB_TXN_TOKEN;
   struct __db_txnmgr;	typedef struct __db_txnmgr DB_TXNMGR;
   struct __dbc;		typedef struct __dbc DBC;
   struct __dbc_internal;	typedef struct __dbc_internal DBC_INTERNAL;
  @@ -171,6 +176,8 @@
   struct __fname;		typedef struct __fname FNAME;
   struct __key_range;	typedef struct __key_range DB_KEY_RANGE;
   struct __mpoolfile;	typedef struct __mpoolfile MPOOLFILE;
  +struct __db_logvrfy_config;
  +typedef struct __db_logvrfy_config DB_LOG_VERIFY_CONFIG;
   
   /*
    * The Berkeley DB API flags are automatically-generated -- the following flag
  @@ -414,7 +421,7 @@
   /*******************************************************
    * Logging.
    *******************************************************/
  -#define	DB_LOGVERSION	16		/* Current log version. */
  +#define	DB_LOGVERSION	17		/* Current log version. */
   #define DB_LOGVERSION_LATCHING 15	/* Log version using latching. */
   #define	DB_LOGCHKSUM	12		/* Check sum headers. */
   #define	DB_LOGOLDVER	8		/* Oldest log version supported. */
  @@ -520,6 +527,39 @@
   #define	DB_SET_TXN_LSNP(txn, blsnp, llsnp)		\
   	((txn)->set_txn_lsnp(txn, blsnp, llsnp))
   
  +/*
  + * Definition of the structure which specifies marshalling of log records.
  + */
  +typedef enum {
  +	LOGREC_Done,
  +	LOGREC_ARG,
  +	LOGREC_HDR,
  +	LOGREC_DATA,
  +	LOGREC_DB,
  +	LOGREC_DBOP,
  +	LOGREC_DBT,
  +	LOGREC_LOCKS,
  +	LOGREC_OP,
  +	LOGREC_PGDBT,
  +	LOGREC_PGDDBT,
  +	LOGREC_PGLIST,
  +	LOGREC_POINTER,
  +	LOGREC_TIME
  +} log_rec_type_t;
  +
  +typedef const struct __log_rec_spec {
  +	log_rec_type_t	type;
  +	u_int32_t	offset;
  +	const char 	*name;
  +	const char	fmt[4];
  +} DB_LOG_RECSPEC;
  +
  +/*
  + * Size of a DBT in a log record.
  + */
  +#define	LOG_DBT_SIZE(dbt)						\
  +    (sizeof(u_int32_t) + ((dbt) == NULL ? 0 : (dbt)->size))
  +
   /*******************************************************
    * Shared buffer cache (mpool).
    *******************************************************/
  @@ -699,7 +739,8 @@
   	DB_TXN_FORWARD_ROLL=4,		/* Public. */
   	DB_TXN_OPENFILES=5,		/* Internal. */
   	DB_TXN_POPENFILES=6,		/* Internal. */
  -	DB_TXN_PRINT=7			/* Public. */
  +	DB_TXN_PRINT=7,			/* Public. */
  +	DB_TXN_LOG_VERIFY=8		/* Internal. */
   } db_recops;
   
   /*
  @@ -775,6 +816,17 @@
   		struct __db_txn **tqe_prev;
   	} klinks;
   
  +	/*
  +	 * !!!
  +	 * Explicit representations of structures from queue.h.
  +	 * TAILQ_HEAD(__my_cursors, __dbc) my_cursors;
  +	 */
  +	struct __my_cursors {
  +		struct __dbc *tqh_first;
  +		struct __dbc **tqh_last;
  +	} my_cursors;
  +
  +	DB_TXN_TOKEN	*token_buffer;	/* User's commit token buffer. */
   	void	*api_internal;		/* C++ API private. */
   	void	*xml_internal;		/* XML API private. */
   
  @@ -785,9 +837,12 @@
   	int	  (*commit) __P((DB_TXN *, u_int32_t));
   	int	  (*discard) __P((DB_TXN *, u_int32_t));
   	int	  (*get_name) __P((DB_TXN *, const char **));
  +	int	  (*get_priority) __P((DB_TXN *, u_int32_t *));
   	u_int32_t (*id) __P((DB_TXN *));
   	int	  (*prepare) __P((DB_TXN *, u_int8_t *));
  +	int	  (*set_commit_token) __P((DB_TXN *, DB_TXN_TOKEN *));
   	int	  (*set_name) __P((DB_TXN *, const char *));
  +	int	  (*set_priority) __P((DB_TXN *, u_int32_t));
   	int	  (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t));
   	/* DB_TXN PUBLIC HANDLE LIST END */
   
  @@ -795,21 +850,24 @@
   	void	  (*set_txn_lsnp) __P((DB_TXN *txn, DB_LSN **, DB_LSN **));
   	/* DB_TXN PRIVATE HANDLE LIST END */
   
  -#define	TXN_CHILDCOMMIT		0x0001	/* Txn has committed. */
  -#define	TXN_CDSGROUP		0x0002	/* CDS group handle. */
  -#define	TXN_COMPENSATE		0x0004	/* Compensating transaction. */
  -#define	TXN_DEADLOCK		0x0008	/* Txn has deadlocked. */
  -#define	TXN_LOCKTIMEOUT		0x0010	/* Txn has a lock timeout. */
  -#define	TXN_MALLOC		0x0020	/* Structure allocated by TXN system. */
  -#define	TXN_NOSYNC		0x0040	/* Do not sync on prepare and commit. */
  -#define	TXN_NOWAIT		0x0080	/* Do not wait on locks. */
  -#define	TXN_PRIVATE		0x0100	/* Txn owned by cursor.. */
  -#define	TXN_READ_COMMITTED	0x0200	/* Txn has degree 2 isolation. */
  -#define	TXN_READ_UNCOMMITTED	0x0400	/* Txn has degree 1 isolation. */
  -#define	TXN_RESTORED		0x0800	/* Txn has been restored. */
  -#define	TXN_SNAPSHOT		0x1000	/* Snapshot Isolation. */
  -#define	TXN_SYNC		0x2000	/* Write and sync on prepare/commit. */
  -#define	TXN_WRITE_NOSYNC	0x4000	/* Write only on prepare/commit. */
  +#define	TXN_CHILDCOMMIT		0x00001	/* Txn has committed. */
  +#define	TXN_COMPENSATE		0x00002	/* Compensating transaction. */
  +#define	TXN_DEADLOCK		0x00004	/* Txn has deadlocked. */
  +#define	TXN_FAMILY		0x00008	/* Cursors/children are independent. */
  +#define	TXN_IGNORE_LEASE	0x00010	/* Skip lease check at commit time. */
  +#define	TXN_INFAMILY		0x00020	/* Part of a transaction family. */
  +#define	TXN_LOCKTIMEOUT		0x00040	/* Txn has a lock timeout. */
  +#define	TXN_MALLOC		0x00080	/* Structure allocated by TXN system. */
  +#define	TXN_NOSYNC		0x00100	/* Do not sync on prepare and commit. */
  +#define	TXN_NOWAIT		0x00200	/* Do not wait on locks. */
  +#define	TXN_PRIVATE		0x00400	/* Txn owned by cursor. */
  +#define	TXN_READONLY		0x00800	/* CDS group handle. */
  +#define	TXN_READ_COMMITTED	0x01000	/* Txn has degree 2 isolation. */
  +#define	TXN_READ_UNCOMMITTED	0x02000	/* Txn has degree 1 isolation. */
  +#define	TXN_RESTORED		0x04000	/* Txn has been restored. */
  +#define	TXN_SNAPSHOT		0x08000	/* Snapshot Isolation. */
  +#define	TXN_SYNC		0x10000	/* Write and sync on prepare/commit. */
  +#define	TXN_WRITE_NOSYNC	0x20000	/* Write only on prepare/commit. */
   	u_int32_t	flags;
   };
   
  @@ -838,6 +896,8 @@
   	DB_LSN	  read_lsn;		/* Read LSN for MVCC */
   	u_int32_t mvcc_ref;		/* MVCC reference count */
   
  +	u_int32_t priority;		/* Deadlock resolution priority */
  +
   #define	TXN_ABORTED		1
   #define	TXN_COMMITTED		2
   #define	TXN_PREPARED		3
  @@ -870,6 +930,11 @@
   #endif
   };
   
  +#define	DB_TXN_TOKEN_SIZE		20
  +struct __db_txn_token {
  +	u_int8_t buf[DB_TXN_TOKEN_SIZE];
  +};
  +
   /*******************************************************
    * Replication.
    *******************************************************/
  @@ -899,17 +964,21 @@
   #define	DB_REP_LEASE_TIMEOUT		9	/* Master leases. */
   
   /* Event notification types. */
  -#define	DB_EVENT_NO_SUCH_EVENT		 0 /* out-of-band sentinel value */
  -#define	DB_EVENT_PANIC			 1
  -#define	DB_EVENT_REG_ALIVE		 2
  -#define	DB_EVENT_REG_PANIC		 3
  -#define	DB_EVENT_REP_CLIENT		 4
  +#define	DB_EVENT_PANIC			 0
  +#define	DB_EVENT_REG_ALIVE		 1
  +#define	DB_EVENT_REG_PANIC		 2
  +#define	DB_EVENT_REP_CLIENT		 3
  +#define	DB_EVENT_REP_DUPMASTER		 4
   #define	DB_EVENT_REP_ELECTED		 5
  -#define	DB_EVENT_REP_MASTER		 6
  -#define	DB_EVENT_REP_NEWMASTER		 7
  -#define	DB_EVENT_REP_PERM_FAILED	 8
  -#define	DB_EVENT_REP_STARTUPDONE	 9
  -#define	DB_EVENT_WRITE_FAILED		10
  +#define	DB_EVENT_REP_ELECTION_FAILED	 6
  +#define	DB_EVENT_REP_JOIN_FAILURE	 7
  +#define	DB_EVENT_REP_MASTER		 8
  +#define	DB_EVENT_REP_MASTER_FAILURE	 9
  +#define	DB_EVENT_REP_NEWMASTER		10
  +#define	DB_EVENT_REP_PERM_FAILED	11
  +#define	DB_EVENT_REP_STARTUPDONE	12
  +#define	DB_EVENT_WRITE_FAILED		13
  +#define	DB_EVENT_NO_SUCH_EVENT		 0xffffffff /* OOB sentinel value */
   
   /* Replication Manager site status. */
   struct __db_repmgr_site {
  @@ -917,9 +986,12 @@
   	char *host;
   	u_int port;
   
  -#define	DB_REPMGR_CONNECTED	0x01
  -#define	DB_REPMGR_DISCONNECTED	0x02
  +#define	DB_REPMGR_CONNECTED	1
  +#define	DB_REPMGR_DISCONNECTED	2
   	u_int32_t status;
  +
  +#define	DB_REPMGR_ISPEER	0x01
  +	u_int32_t flags;
   };
   
   /* Replication statistics. */
  @@ -933,9 +1005,9 @@
   	 * off somewhat (or, on unreasonable architectures under unlucky
   	 * circumstances, garbaged).
   	 */
  -	uintmax_t st_log_queued;	/* Log records currently queued.+ */
   	u_int32_t st_startup_complete;	/* Site completed client sync-up. */
   #ifndef __TEST_DB_NO_STATISTICS
  +	uintmax_t st_log_queued;	/* Log records currently queued.+ */
   	u_int32_t st_status;		/* Current replication status. */
   	DB_LSN st_next_lsn;		/* Next LSN to use or expect. */
   	DB_LSN st_waiting_lsn;		/* LSN we're awaiting, if any. */
  @@ -1017,6 +1089,8 @@
   					   queue length. */
   	uintmax_t st_connection_drop;	/* Existing connections dropped. */
   	uintmax_t st_connect_fail;	/* Failed new connection attempts. */
  +	uintmax_t st_elect_threads;	/* # of active election threads. */
  +	uintmax_t st_max_elect_threads;	/* Max concurrent e-threads ever. */
   };
   
   /*******************************************************
  @@ -1169,27 +1243,29 @@
   #define	DB_LOCK_DEADLOCK	(-30994)/* Deadlock. */
   #define	DB_LOCK_NOTGRANTED	(-30993)/* Lock unavailable. */
   #define	DB_LOG_BUFFER_FULL	(-30992)/* In-memory log buffer full. */
  -#define	DB_NOSERVER		(-30991)/* Server panic return. */
  -#define	DB_NOSERVER_HOME	(-30990)/* Bad home sent to server. */
  -#define	DB_NOSERVER_ID		(-30989)/* Bad ID sent to server. */
  -#define	DB_NOTFOUND		(-30988)/* Key/data pair not found (EOF). */
  -#define	DB_OLD_VERSION		(-30987)/* Out-of-date version. */
  -#define	DB_PAGE_NOTFOUND	(-30986)/* Requested page not found. */
  -#define	DB_REP_DUPMASTER	(-30985)/* There are two masters. */
  -#define	DB_REP_HANDLE_DEAD	(-30984)/* Rolled back a commit. */
  -#define	DB_REP_HOLDELECTION	(-30983)/* Time to hold an election. */
  -#define	DB_REP_IGNORE		(-30982)/* This msg should be ignored.*/
  -#define	DB_REP_ISPERM		(-30981)/* Cached not written perm written.*/
  -#define	DB_REP_JOIN_FAILURE	(-30980)/* Unable to join replication group. */
  -#define	DB_REP_LEASE_EXPIRED	(-30979)/* Master lease has expired. */
  -#define	DB_REP_LOCKOUT		(-30978)/* API/Replication lockout now. */
  -#define	DB_REP_NEWSITE		(-30977)/* New site entered system. */
  -#define	DB_REP_NOTPERM		(-30976)/* Permanent log record not written. */
  -#define	DB_REP_UNAVAIL		(-30975)/* Site cannot currently be reached. */
  -#define	DB_RUNRECOVERY		(-30974)/* Panic return. */
  -#define	DB_SECONDARY_BAD	(-30973)/* Secondary index corrupt. */
  -#define	DB_VERIFY_BAD		(-30972)/* Verify failed; bad format. */
  -#define	DB_VERSION_MISMATCH	(-30971)/* Environment version mismatch. */
  +#define	DB_LOG_VERIFY_BAD	(-30991)/* Log verification failed. */
  +#define	DB_NOSERVER		(-30990)/* Server panic return. */
  +#define	DB_NOSERVER_HOME	(-30989)/* Bad home sent to server. */
  +#define	DB_NOSERVER_ID		(-30988)/* Bad ID sent to server. */
  +#define	DB_NOTFOUND		(-30987)/* Key/data pair not found (EOF). */
  +#define	DB_OLD_VERSION		(-30986)/* Out-of-date version. */
  +#define	DB_PAGE_NOTFOUND	(-30985)/* Requested page not found. */
  +#define	DB_REP_DUPMASTER	(-30984)/* There are two masters. */
  +#define	DB_REP_HANDLE_DEAD	(-30983)/* Rolled back a commit. */
  +#define	DB_REP_HOLDELECTION	(-30982)/* Time to hold an election. */
  +#define	DB_REP_IGNORE		(-30981)/* This msg should be ignored.*/
  +#define	DB_REP_ISPERM		(-30980)/* Cached not written perm written.*/
  +#define	DB_REP_JOIN_FAILURE	(-30979)/* Unable to join replication group. */
  +#define	DB_REP_LEASE_EXPIRED	(-30978)/* Master lease has expired. */
  +#define	DB_REP_LOCKOUT		(-30977)/* API/Replication lockout now. */
  +#define	DB_REP_NEWSITE		(-30976)/* New site entered system. */
  +#define	DB_REP_NOTPERM		(-30975)/* Permanent log record not written. */
  +#define	DB_REP_UNAVAIL		(-30974)/* Site cannot currently be reached. */
  +#define	DB_RUNRECOVERY		(-30973)/* Panic return. */
  +#define	DB_SECONDARY_BAD	(-30972)/* Secondary index corrupt. */
  +#define	DB_TIMEOUT		(-30971)/* Timed out on read consistency. */
  +#define	DB_VERIFY_BAD		(-30970)/* Verify failed; bad format. */
  +#define	DB_VERSION_MISMATCH	(-30969)/* Environment version mismatch. */
   
   /* DB (private) error return codes. */
   #define	DB_ALREADY_ABORTED	(-30899)
  @@ -1197,17 +1273,14 @@
   #define	DB_EVENT_NOT_HANDLED	(-30897)/* Forward event to application. */
   #define	DB_NEEDSPLIT		(-30896)/* Page needs to be split. */
   #define	DB_REP_BULKOVF		(-30895)/* Rep bulk buffer overflow. */
  -#define	DB_REP_EGENCHG		(-30894)/* Egen changed while in election. */
  -#define	DB_REP_LOGREADY		(-30893)/* Rep log ready for recovery. */
  -#define	DB_REP_NEWMASTER	(-30892)/* We have learned of a new master. */
  -#define	DB_REP_PAGEDONE		(-30891)/* This page was already done. */
  -#define	DB_REP_PAGELOCKED	(-30890)/* Page we want is locked. */
  -#define	DB_SURPRISE_KID		(-30889)/* Child commit where parent
  +#define	DB_REP_LOGREADY		(-30894)/* Rep log ready for recovery. */
  +#define	DB_REP_NEWMASTER	(-30893)/* We have learned of a new master. */
  +#define	DB_REP_PAGEDONE		(-30892)/* This page was already done. */
  +#define	DB_SURPRISE_KID		(-30891)/* Child commit where parent
   					   didn't know it was a parent. */
  -#define	DB_SWAPBYTES		(-30888)/* Database needs byte swapping. */
  -#define	DB_TIMEOUT		(-30887)/* Timed out waiting for election. */
  -#define	DB_TXN_CKP		(-30886)/* Encountered ckp record in log. */
  -#define	DB_VERIFY_FATAL		(-30885)/* DB->verify cannot proceed. */
  +#define	DB_SWAPBYTES		(-30890)/* Database needs byte swapping. */
  +#define	DB_TXN_CKP		(-30889)/* Encountered ckp record in log. */
  +#define	DB_VERIFY_FATAL		(-30888)/* DB->verify cannot proceed. */
   
   /* Database handle. */
   struct __db {
  @@ -1529,6 +1602,9 @@
   	int  (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
   	int  (*stored_close) __P((DB *, u_int32_t));
   
  +	/* Alternative handle close function, used by C++ API. */
  +	int  (*alt_close) __P((DB *, u_int32_t));
  +
   #define	DB_OK_BTREE	0x01
   #define	DB_OK_HASH	0x02
   #define	DB_OK_QUEUE	0x04
  @@ -1670,7 +1746,7 @@
   		else {							\
   			writedata = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = __off;					\
  -			__p[-1] = (writedlen);				\
  +			__p[-1] = (u_int32_t)(writedlen);		\
   			__p[-2] = (u_int32_t)-1;			\
   			pointer = __p - 2;				\
   		}							\
  @@ -1699,12 +1775,12 @@
   		} else {						\
   			writekey = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = __off;					\
  -			__p[-1] = (writeklen);				\
  +			__p[-1] = (u_int32_t)(writeklen);		\
   			__p -= 2;					\
  -			__off += (writeklen);				\
  +			__off += (u_int32_t)(writeklen);		\
   			writedata = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = __off;					\
  -			__p[-1] = (writedlen);				\
  +			__p[-1] = (u_int32_t)(writedlen);		\
   			__p[-2] = (u_int32_t)-1;			\
   			pointer = __p - 2;				\
   		}							\
  @@ -1744,7 +1820,7 @@
   			writedata = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = (u_int32_t)(recno);			\
   			__p[-1] = __off;				\
  -			__p[-2] = (writedlen);				\
  +			__p[-2] = (u_int32_t)(writedlen);		\
   			__p[-3] = 0;					\
   			pointer = __p - 3;				\
   		}							\
  @@ -1786,6 +1862,18 @@
   	} links;
   
   	/*
  +	 * Cursor queue of the owning transaction.
  +	 *
  +	 * !!!
  +	 * Explicit representations of structures from queue.h.
  +	 * TAILQ_ENTRY(__dbc) txn_cursors;
  +	 */
  +	struct {
  +		DBC *tqe_next;	/* next element */
  +		DBC **tqe_prev;	/* address of previous next element */
  +	} txn_cursors;
  +
  +	/*
   	 * The DBT *'s below are used by the cursor routines to return
   	 * data to the user when DBT flags indicate that DB should manage
   	 * the returned memory.  They point at a DBT containing the buffer
  @@ -1861,20 +1949,21 @@
   #define	DBC_DONTLOCK		0x00004	/* Don't lock on this cursor. */
   #define	DBC_DOWNREV		0x00008	/* Down rev replication master. */
   #define	DBC_DUPLICATE		0x00010	/* Create a duplicate cursor. */
  -#define	DBC_FROM_DB_GET		0x00020 /* Called from the DB->get() method. */
  -#define	DBC_MULTIPLE		0x00040	/* Return Multiple data. */
  -#define	DBC_MULTIPLE_KEY	0x00080	/* Return Multiple keys and data. */
  -#define	DBC_OPD			0x00100	/* Cursor references off-page dups. */
  -#define	DBC_OWN_LID		0x00200	/* Free lock id on destroy. */
  -#define	DBC_PARTITIONED		0x00400	/* Cursor for a partitioned db. */
  -#define	DBC_READ_COMMITTED	0x00800	/* Cursor has degree 2 isolation. */
  -#define	DBC_READ_UNCOMMITTED	0x01000	/* Cursor has degree 1 isolation. */
  -#define	DBC_RECOVER		0x02000	/* Recovery cursor; don't log/lock. */
  -#define	DBC_RMW			0x04000	/* Acquire write flag in read op. */
  -#define	DBC_TRANSIENT		0x08000	/* Cursor is transient. */
  -#define	DBC_WAS_READ_COMMITTED	0x10000	/* Cursor holds a read commited lock. */
  -#define	DBC_WRITECURSOR		0x20000	/* Cursor may be used to write (CDB). */
  -#define	DBC_WRITER		0x40000	/* Cursor immediately writing (CDB). */
  +#define	DBC_FAMILY		0x00020 /* Part of a locker family. */
  +#define	DBC_FROM_DB_GET		0x00040 /* Called from the DB->get() method. */
  +#define	DBC_MULTIPLE		0x00080	/* Return Multiple data. */
  +#define	DBC_MULTIPLE_KEY	0x00100	/* Return Multiple keys and data. */
  +#define	DBC_OPD			0x00200	/* Cursor references off-page dups. */
  +#define	DBC_OWN_LID		0x00400	/* Free lock id on destroy. */
  +#define	DBC_PARTITIONED		0x00800	/* Cursor for a partitioned db. */
  +#define	DBC_READ_COMMITTED	0x01000	/* Cursor has degree 2 isolation. */
  +#define	DBC_READ_UNCOMMITTED	0x02000	/* Cursor has degree 1 isolation. */
  +#define	DBC_RECOVER		0x04000	/* Recovery cursor; don't log/lock. */
  +#define	DBC_RMW			0x08000	/* Acquire write flag in read op. */
  +#define	DBC_TRANSIENT		0x10000	/* Cursor is transient. */
  +#define	DBC_WAS_READ_COMMITTED	0x20000	/* Cursor holds a read commited lock. */
  +#define	DBC_WRITECURSOR		0x40000	/* Cursor may be used to write (CDB). */
  +#define	DBC_WRITER		0x80000	/* Cursor immediately writing (CDB). */
   	u_int32_t flags;
   };
   
  @@ -1916,6 +2005,7 @@
   	db_timeout_t	compact_timeout;	/* Lock timeout. */
   	u_int32_t	compact_pages;		/* Max pages to process. */
   	/* Output Stats. */
  +	u_int32_t	compact_empty_buckets;	/* Empty hash buckets found. */
   	u_int32_t	compact_pages_free;	/* Number of pages freed. */
   	u_int32_t	compact_pages_examine;	/* Number of pages examine. */
   	u_int32_t	compact_levels;		/* Number of levels removed. */
  @@ -2157,6 +2247,7 @@
   	int  (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *));
   	int  (*get_lk_max_objects) __P((DB_ENV *, u_int32_t *));
   	int  (*get_lk_partitions) __P((DB_ENV *, u_int32_t *));
  +	int  (*get_lk_priority) __P((DB_ENV *, u_int32_t, u_int32_t *));
   	int  (*get_mp_max_openfd) __P((DB_ENV *, int *));
   	int  (*get_mp_max_write) __P((DB_ENV *, int *, db_timeout_t *));
   	int  (*get_mp_mmapsize) __P((DB_ENV *, size_t *));
  @@ -2195,9 +2286,15 @@
   	int  (*log_get_config) __P((DB_ENV *, u_int32_t, int *));
   	int  (*log_printf) __P((DB_ENV *, DB_TXN *, const char *, ...));
   	int  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
  +	int  (*log_put_record) __P((DB_ENV *, DB *, DB_TXN *, DB_LSN *,
  +		u_int32_t, u_int32_t, u_int32_t, u_int32_t,
  +		DB_LOG_RECSPEC *, ...));
  +	int  (*log_read_record) __P((DB_ENV *, DB **,
  +		void *, void *, DB_LOG_RECSPEC *, u_int32_t, void **));
   	int  (*log_set_config) __P((DB_ENV *, u_int32_t, int));
   	int  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
   	int  (*log_stat_print) __P((DB_ENV *, u_int32_t));
  +	int  (*log_verify) __P((DB_ENV *, const DB_LOG_VERIFY_CONFIG *));
   	int  (*lsn_reset) __P((DB_ENV *, const char *, u_int32_t));
   	int  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
   	int  (*memp_register) __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_t,
  @@ -2289,6 +2386,7 @@
   	int  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
   	int  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
   	int  (*set_lk_partitions) __P((DB_ENV *, u_int32_t));
  +	int  (*set_lk_priority) __P((DB_ENV *, u_int32_t, u_int32_t));
   	int  (*set_mp_max_openfd) __P((DB_ENV *, int));
   	int  (*set_mp_max_write) __P((DB_ENV *, int, db_timeout_t));
   	int  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
  @@ -2311,6 +2409,8 @@
   	int  (*set_tx_max) __P((DB_ENV *, u_int32_t));
   	int  (*set_tx_timestamp) __P((DB_ENV *, time_t *));
   	int  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
  +	int  (*txn_applied) __P((DB_ENV *,
  +		DB_TXN_TOKEN *, db_timeout_t, u_int32_t));
   	int  (*stat_print) __P((DB_ENV *, u_int32_t));
   	int  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
   	int  (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
  @@ -2327,9 +2427,9 @@
   };
   
   /*
  - * Dispatch structure for recovery and print routines.  Since internal and
  - * external routines take different arguments (ENV versus DB_ENV), we need
  - * something more elaborate than a single pointer and size.
  + * Dispatch structure for recovery, log verification and print routines. Since
  + * internal and external routines take different arguments (ENV versus DB_ENV),
  + * we need something more elaborate than a single pointer and size.
    */
   struct __db_distab {
   	int   (**int_dispatch) __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
  @@ -2338,9 +2438,18 @@
   	size_t	ext_size;
   };
   
  -#ifndef DB_DBM_HSEARCH
  -#define	DB_DBM_HSEARCH	0		/* No historic interfaces by default. */
  -#endif
  +/*
  + * Log verification configuration structure.
  + */
  +struct __db_logvrfy_config {
  +	int continue_after_fail, verbose;
  +	u_int32_t cachesize;
  +	const char *temp_envhome;
  +	const char *dbfile, *dbname;
  +	DB_LSN start_lsn, end_lsn;
  +	time_t start_time, end_time;
  +};
  +
   #if DB_DBM_HSEARCH != 0
   /*******************************************************
    * Dbm/Ndbm historic interfaces.
  @@ -2455,12 +2564,13 @@
   #define	DB_FCNTL_LOCKING			0x00000800
   #define	DB_FLUSH				0x00000001
   #define	DB_FORCE				0x00000001
  +#define	DB_FORCESYNC				0x00000001
   #define	DB_FOREIGN_ABORT			0x00000001
   #define	DB_FOREIGN_CASCADE			0x00000002
   #define	DB_FOREIGN_NULLIFY			0x00000004
   #define	DB_FREELIST_ONLY			0x00000001
   #define	DB_FREE_SPACE				0x00000002
  -#define	DB_IGNORE_LEASE				0x00002000
  +#define	DB_IGNORE_LEASE				0x00001000
   #define	DB_IMMUTABLE_KEY			0x00000002
   #define	DB_INIT_CDB				0x00000040
   #define	DB_INIT_LOCK				0x00000080
  @@ -2484,6 +2594,14 @@
   #define	DB_LOG_IN_MEMORY			0x00000008
   #define	DB_LOG_NOCOPY				0x00000008
   #define	DB_LOG_NOT_DURABLE			0x00000010
  +#define	DB_LOG_VERIFY_CAF			0x00000001
  +#define	DB_LOG_VERIFY_DBFILE			0x00000002
  +#define	DB_LOG_VERIFY_ERR			0x00000004
  +#define	DB_LOG_VERIFY_FORWARD			0x00000008
  +#define	DB_LOG_VERIFY_INTERR			0x00000010
  +#define	DB_LOG_VERIFY_PARTIAL			0x00000020
  +#define	DB_LOG_VERIFY_VERBOSE			0x00000040
  +#define	DB_LOG_VERIFY_WARNING			0x00000080
   #define	DB_LOG_WRNOSYNC				0x00000020
   #define	DB_LOG_ZERO				0x00000010
   #define	DB_MPOOL_CREATE				0x00000001
  @@ -2506,11 +2624,12 @@
   #define	DB_MUTEX_PROCESS_ONLY			0x00000008
   #define	DB_MUTEX_SELF_BLOCK			0x00000010
   #define	DB_MUTEX_SHARED				0x00000020
  +#define	DB_NOERROR				0x00001000
   #define	DB_NOLOCKING				0x00000400
   #define	DB_NOMMAP				0x00000008
   #define	DB_NOORDERCHK				0x00000002
   #define	DB_NOPANIC				0x00000800
  -#define	DB_NO_AUTO_COMMIT			0x00001000
  +#define	DB_NO_AUTO_COMMIT			0x00002000
   #define	DB_ODDFILESIZE				0x00000080
   #define	DB_ORDERCHKONLY				0x00000004
   #define	DB_OVERWRITE				0x00001000
  @@ -2520,7 +2639,7 @@
   #define	DB_PR_PAGE				0x00000010
   #define	DB_PR_RECOVERYTEST			0x00000020
   #define	DB_RDONLY				0x00000400
  -#define	DB_RDWRMASTER				0x00002000
  +#define	DB_RDWRMASTER				0x00004000
   #define	DB_READ_COMMITTED			0x00000400
   #define	DB_READ_UNCOMMITTED			0x00000200
   #define	DB_RECNUM				0x00000040
  @@ -2530,22 +2649,23 @@
   #define	DB_REGISTER				0x00008000
   #define	DB_RENUMBER				0x00000080
   #define	DB_REPMGR_CONF_2SITE_STRICT		0x00000001
  +#define	DB_REPMGR_CONF_ELECTIONS		0x00000002
   #define	DB_REPMGR_PEER				0x00000001
   #define	DB_REP_ANYWHERE				0x00000001
   #define	DB_REP_CLIENT				0x00000001
  -#define	DB_REP_CONF_BULK			0x00000002
  -#define	DB_REP_CONF_DELAYCLIENT			0x00000004
  -#define	DB_REP_CONF_INMEM			0x00000008
  -#define	DB_REP_CONF_LEASE			0x00000010
  -#define	DB_REP_CONF_NOAUTOINIT			0x00000020
  -#define	DB_REP_CONF_NOWAIT			0x00000040
  +#define	DB_REP_CONF_AUTOINIT			0x00000004
  +#define	DB_REP_CONF_BULK			0x00000008
  +#define	DB_REP_CONF_DELAYCLIENT			0x00000010
  +#define	DB_REP_CONF_INMEM			0x00000020
  +#define	DB_REP_CONF_LEASE			0x00000040
  +#define	DB_REP_CONF_NOWAIT			0x00000080
   #define	DB_REP_ELECTION				0x00000004
   #define	DB_REP_MASTER				0x00000002
   #define	DB_REP_NOBUFFER				0x00000002
   #define	DB_REP_PERMANENT			0x00000004
   #define	DB_REP_REREQUEST			0x00000008
   #define	DB_REVSPLITOFF				0x00000100
  -#define	DB_RMW					0x00001000
  +#define	DB_RMW					0x00002000
   #define	DB_RPCCLIENT				0x00000001
   #define	DB_SALVAGE				0x00000040
   #define	DB_SA_SKIPFIRSTKEY			0x00000080
  @@ -2581,13 +2701,14 @@
   #define	DB_SYSTEM_MEM				0x00010000
   #define	DB_THREAD				0x00000010
   #define	DB_TIME_NOTGRANTED			0x00008000
  -#define	DB_TRUNCATE				0x00004000
  +#define	DB_TRUNCATE				0x00008000
  +#define	DB_TXN_FAMILY				0x00000008
   #define	DB_TXN_NOSYNC				0x00000001
   #define	DB_TXN_NOT_DURABLE			0x00000002
   #define	DB_TXN_NOWAIT				0x00000010
   #define	DB_TXN_SNAPSHOT				0x00000002
   #define	DB_TXN_SYNC				0x00000004
  -#define	DB_TXN_WAIT				0x00000008
  +#define	DB_TXN_WAIT				0x00000040
   #define	DB_TXN_WRITE_NOSYNC			0x00000020
   #define	DB_UNREF				0x00020000
   #define	DB_UPGRADE				0x00000001
  @@ -2606,13 +2727,14 @@
   #define	DB_VERB_REP_MISC			0x00000400
   #define	DB_VERB_REP_MSGS			0x00000800
   #define	DB_VERB_REP_SYNC			0x00001000
  -#define	DB_VERB_REP_TEST			0x00002000
  -#define	DB_VERB_WAITSFOR			0x00004000
  +#define	DB_VERB_REP_SYSTEM			0x00002000
  +#define	DB_VERB_REP_TEST			0x00004000
  +#define	DB_VERB_WAITSFOR			0x00008000
   #define	DB_VERIFY				0x00000002
   #define	DB_VERIFY_PARTITION			0x00040000
   #define	DB_WRITECURSOR				0x00000008
   #define	DB_WRITELOCK				0x00000010
  -#define	DB_WRITEOPEN				0x00008000
  +#define	DB_WRITEOPEN				0x00010000
   #define	DB_YIELDCPU				0x00010000
   
   /* DO NOT EDIT: automatically built by dist/s_include. */
  @@ -2648,6 +2770,7 @@
   int db_env_set_func_yield __P((int (*)(u_long, u_long)));
   int db_env_create __P((DB_ENV **, u_int32_t));
   char *db_version __P((int *, int *, int *));
  +char *db_full_version __P((int *, int *, int *, int *, int *));
   int log_compare __P((const DB_LSN *, const DB_LSN *));
   int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
   #if DB_DBM_HSEARCH != 0
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_archive/db_archive.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_archive.c
  --- db/build_vxworks/db_archive/db_archive.c	16 Sep 2009 19:34:39 -0000	1.11
  +++ db/build_vxworks/db_archive/db_archive.c	23 Aug 2010 13:36:27 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   int db_archive_main __P((int, char *[]));
  @@ -119,7 +119,7 @@
   	if ((ret = db_env_create(&dbenv, 0)) != 0) {
   		fprintf(stderr,
   		    "%s: db_env_create: %s\n", progname, db_strerror(ret));
  -		goto shutdown;
  +		goto err;
   	}
   
   	dbenv->set_errfile(dbenv, stderr);
  @@ -128,7 +128,7 @@
   	if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
   	    passwd, DB_ENCRYPT_AES)) != 0) {
   		dbenv->err(dbenv, ret, "set_passwd");
  -		goto shutdown;
  +		goto err;
   	}
   	/*
   	 * If attaching to a pre-existing environment fails, create a
  @@ -139,13 +139,13 @@
   	    (ret = dbenv->open(dbenv, home, DB_CREATE |
   	    DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) {
   		dbenv->err(dbenv, ret, "DB_ENV->open");
  -		goto shutdown;
  +		goto err;
   	}
   
   	/* Get the list of names. */
   	if ((ret = dbenv->log_archive(dbenv, &list, flags)) != 0) {
   		dbenv->err(dbenv, ret, "DB_ENV->log_archive");
  -		goto shutdown;
  +		goto err;
   	}
   
   	/* Print the list of names. */
  @@ -156,7 +156,7 @@
   	}
   
   	if (0) {
  -shutdown:	exitval = 1;
  +err:		exitval = 1;
   	}
   	if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
   		exitval = 1;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_archive/db_archive20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_archive20.wpj
  --- db/build_vxworks/db_archive/db_archive20.wpj	1 Oct 2006 20:18:47 -0000	1.2
  +++ db/build_vxworks/db_archive/db_archive20.wpj	23 Aug 2010 13:36:27 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_archive.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_archive.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_archive.c_objects
  -db_archive.o
  -<END>
  -
  -<BEGIN> FILE_db_archive.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_archive.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_archive/db_archive22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_archive22.wpj
  --- db/build_vxworks/db_archive/db_archive22.wpj	1 Oct 2006 20:18:47 -0000	1.2
  +++ db/build_vxworks/db_archive/db_archive22.wpj	23 Aug 2010 13:36:27 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_archive.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_archive.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_archive.c_objects
  -db_archive.o
  -<END>
  -
  -<BEGIN> FILE_db_archive.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_archive.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_checkpoint/db_checkpoint.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.12.2.1 db_checkpoint.c
  --- db/build_vxworks/db_checkpoint/db_checkpoint.c	16 Sep 2009 19:34:39 -0000	1.12
  +++ db/build_vxworks/db_checkpoint/db_checkpoint.c	23 Aug 2010 13:36:28 -0000	1.12.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   int	 db_checkpoint_main __P((int, char *[]));
  @@ -131,7 +131,7 @@
   
   	/* Log our process ID. */
   	if (logfile != NULL && __db_util_logset(progname, logfile))
  -		goto shutdown;
  +		goto err;
   
   	/*
   	 * Create an environment object and initialize it for error
  @@ -140,7 +140,7 @@
   	if ((ret = db_env_create(&dbenv, 0)) != 0) {
   		fprintf(stderr,
   		    "%s: db_env_create: %s\n", progname, db_strerror(ret));
  -		goto shutdown;
  +		goto err;
   	}
   
   	dbenv->set_errfile(dbenv, stderr);
  @@ -149,7 +149,7 @@
   	if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
   	    passwd, DB_ENCRYPT_AES)) != 0) {
   		dbenv->err(dbenv, ret, "set_passwd");
  -		goto shutdown;
  +		goto err;
   	}
   
   	/*
  @@ -168,7 +168,7 @@
   	    (ret = dbenv->open(dbenv, home,
   	    DB_CREATE | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) {
   		dbenv->err(dbenv, ret, "DB_ENV->open");
  -		goto shutdown;
  +		goto err;
   	}
   
   	/*
  @@ -187,7 +187,7 @@
   		if ((ret = dbenv->txn_checkpoint(dbenv,
   		    kbytes, minutes, flags)) != 0) {
   			dbenv->err(dbenv, ret, "txn_checkpoint");
  -			goto shutdown;
  +			goto err;
   		}
   
   		if (verbose) {
  @@ -203,7 +203,7 @@
   	}
   
   	if (0) {
  -shutdown:	exitval = 1;
  +err:		exitval = 1;
   	}
   
   	/* Clean up the logfile. */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_checkpoint/db_checkpoint20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_checkpoint20.wpj
  --- db/build_vxworks/db_checkpoint/db_checkpoint20.wpj	1 Oct 2006 20:18:47 -0000	1.2
  +++ db/build_vxworks/db_checkpoint/db_checkpoint20.wpj	23 Aug 2010 13:36:28 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_checkpoint.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_checkpoint.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_checkpoint.c_objects
  -db_checkpoint.o
  -<END>
  -
  -<BEGIN> FILE_db_checkpoint.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_checkpoint.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_checkpoint/db_checkpoint22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_checkpoint22.wpj
  --- db/build_vxworks/db_checkpoint/db_checkpoint22.wpj	1 Oct 2006 20:18:47 -0000	1.2
  +++ db/build_vxworks/db_checkpoint/db_checkpoint22.wpj	23 Aug 2010 13:36:28 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_checkpoint.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_checkpoint.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_checkpoint.c_objects
  -db_checkpoint.o
  -<END>
  -
  -<BEGIN> FILE_db_checkpoint.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_checkpoint.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_config.h
  ============================================================================
  $ cvs diff -u -r1.18 -r1.18.2.1 db_config.h
  --- db/build_vxworks/db_config.h	7 Jan 2010 22:02:21 -0000	1.18
  +++ db/build_vxworks/db_config.h	23 Aug 2010 13:36:26 -0000	1.18.2.1
  @@ -6,6 +6,9 @@
   /* Define to 1 if you want to build a version for running the test suite. */
   /* #undef CONFIG_TEST */
   
  +/* Defined to a size to limit the stack size of Berkeley DB threads. */
  +/* #undef DB_STACKSIZE */
  +
   /* We use DB_WIN32 much as one would use _WIN32 -- to specify that we're using
      an operating system environment that supports Win32 calls and semantics. We
      don't use _WIN32 because Cygwin/GCC also defines _WIN32, even though
  @@ -78,12 +81,18 @@
   /* Define to 1 if Berkeley DB release includes strong cryptography. */
   #define HAVE_CRYPTO 1
   
  +/* Define to 1 if using Intel IPP for cryptography. */
  +/* #undef HAVE_CRYPTO_IPP */
  +
   /* Define to 1 if you have the `ctime_r' function. */
   #define HAVE_CTIME_R 1
   
   /* Define to 1 if ctime_r takes a buffer length as a third argument. */
   #define HAVE_CTIME_R_3ARG 1
   
  +/* Define to 1 if building the DBM API. */
  +/* #undef HAVE_DBM */
  +
   /* Define to 1 if you have the `directio' function. */
   /* #undef HAVE_DIRECTIO */
   
  @@ -94,6 +103,9 @@
   /* Define to 1 if you have the <dlfcn.h> header file. */
   /* #undef HAVE_DLFCN_H */
   
  +/* Define to 1 to use dtrace for performance event tracing. */
  +/* #undef HAVE_DTRACE */
  +
   /* Define to 1 if you have the <execinfo.h> header file. */
   /* #undef HAVE_EXECINFO_H */
   
  @@ -134,7 +146,7 @@
   #define HAVE_FWRITE 1
   
   /* Define to 1 if you have the `getaddrinfo' function. */
  -/* #undef HAVE_GETADDRINFO */
  +#define HAVE_GETADDRINFO 1
   
   /* Define to 1 if you have the `getcwd' function. */
   #define HAVE_GETCWD 1
  @@ -330,6 +342,9 @@
   /* Define to 1 if building partitioned database support. */
   /* #undef HAVE_PARTITION */
   
  +/* Define to 1 to enable some kind of performance event tracing. */
  +/* #undef HAVE_PERFMON */
  +
   /* Define to 1 if you have the `pread' function. */
   /* #undef HAVE_PREAD */
   
  @@ -370,7 +385,7 @@
   #define HAVE_REPLICATION 1
   
   /* Define to 1 if building the Berkeley DB replication framework. */
  -/* #undef HAVE_REPLICATION_THREADS */
  +#define HAVE_REPLICATION_THREADS 1
   
   /* Define to 1 if building RPC client/server. */
   /* #undef HAVE_RPC */
  @@ -414,6 +429,9 @@
   /* Define to 1 if building statistics support. */
   #define HAVE_STATISTICS 1
   
  +/* Define to 1 to enable performance event tracing of *_stat() statistics. */
  +/* #undef HAVE_STATISTICS_PERFMON */
  +
   /* Define to 1 if you have the <stdint.h> header file. */
   /* #undef HAVE_STDINT_H */
   
  @@ -468,6 +486,9 @@
   /* Define to 1 if you have the `sysconf' function. */
   /* #undef HAVE_SYSCONF */
   
  +/* Define to 1 to use stap for performance event tracing. */
  +/* #undef HAVE_SYSTEMTAP */
  +
   /* Define to 1 if port includes files in the Berkeley DB source code. */
   #define HAVE_SYSTEM_INCLUDE_FILES 1
   
  @@ -479,11 +500,14 @@
      */
   /* #undef HAVE_SYS_NDIR_H */
   
  +/* Define to 1 if you have the <sys/sdt.h> header file. */
  +/* #undef HAVE_SYS_SDT_H */
  +
   /* Define to 1 if you have the <sys/select.h> header file. */
   /* #undef HAVE_SYS_SELECT_H */
   
   /* Define to 1 if you have the <sys/socket.h> header file. */
  -/* #undef HAVE_SYS_SOCKET_H */
  +#define HAVE_SYS_SOCKET_H 1
   
   /* Define to 1 if you have the <sys/stat.h> header file. */
   /* #undef HAVE_SYS_STAT_H */
  @@ -531,13 +555,16 @@
   #define PACKAGE_NAME "Berkeley DB"
   
   /* Define to the full name and version of this package. */
  -#define PACKAGE_STRING "Berkeley DB 4.8.26"
  +#define PACKAGE_STRING "Berkeley DB 5.0.26"
   
   /* Define to the one symbol short name of this package. */
  -#define PACKAGE_TARNAME "db-4.8.26"
  +#define PACKAGE_TARNAME "db-5.0.26"
  +
  +/* Define to the home page for this package. */
  +#define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
   
   /* Define to the version of this package. */
  -#define PACKAGE_VERSION "4.8.26"
  +#define PACKAGE_VERSION "5.0.26"
   
   /* The size of a `char', as computed by sizeof. */
   /* #undef SIZEOF_CHAR */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_config_small.h
  ============================================================================
  $ cvs diff -u -r1.14 -r1.14.2.1 db_config_small.h
  --- db/build_vxworks/db_config_small.h	7 Jan 2010 22:02:21 -0000	1.14
  +++ db/build_vxworks/db_config_small.h	23 Aug 2010 13:36:26 -0000	1.14.2.1
  @@ -6,6 +6,9 @@
   /* Define to 1 if you want to build a version for running the test suite. */
   /* #undef CONFIG_TEST */
   
  +/* Defined to a size to limit the stack size of Berkeley DB threads. */
  +/* #undef DB_STACKSIZE */
  +
   /* We use DB_WIN32 much as one would use _WIN32 -- to specify that we're using
      an operating system environment that supports Win32 calls and semantics. We
      don't use _WIN32 because Cygwin/GCC also defines _WIN32, even though
  @@ -78,12 +81,18 @@
   /* Define to 1 if Berkeley DB release includes strong cryptography. */
   /* #undef HAVE_CRYPTO */
   
  +/* Define to 1 if using Intel IPP for cryptography. */
  +/* #undef HAVE_CRYPTO_IPP */
  +
   /* Define to 1 if you have the `ctime_r' function. */
   #define HAVE_CTIME_R 1
   
   /* Define to 1 if ctime_r takes a buffer length as a third argument. */
   #define HAVE_CTIME_R_3ARG 1
   
  +/* Define to 1 if building the DBM API. */
  +/* #undef HAVE_DBM */
  +
   /* Define to 1 if you have the `directio' function. */
   /* #undef HAVE_DIRECTIO */
   
  @@ -94,6 +103,9 @@
   /* Define to 1 if you have the <dlfcn.h> header file. */
   /* #undef HAVE_DLFCN_H */
   
  +/* Define to 1 to use dtrace for performance event tracing. */
  +/* #undef HAVE_DTRACE */
  +
   /* Define to 1 if you have the <execinfo.h> header file. */
   /* #undef HAVE_EXECINFO_H */
   
  @@ -134,7 +146,7 @@
   #define HAVE_FWRITE 1
   
   /* Define to 1 if you have the `getaddrinfo' function. */
  -/* #undef HAVE_GETADDRINFO */
  +#define HAVE_GETADDRINFO 1
   
   /* Define to 1 if you have the `getcwd' function. */
   #define HAVE_GETCWD 1
  @@ -330,6 +342,9 @@
   /* Define to 1 if building partitioned database support. */
   /* #undef HAVE_PARTITION */
   
  +/* Define to 1 to enable some kind of performance event tracing. */
  +/* #undef HAVE_PERFMON */
  +
   /* Define to 1 if you have the `pread' function. */
   /* #undef HAVE_PREAD */
   
  @@ -370,7 +385,7 @@
   /* #undef HAVE_REPLICATION */
   
   /* Define to 1 if building the Berkeley DB replication framework. */
  -/* #undef HAVE_REPLICATION_THREADS */
  +/* #undef HAVE_REPLICATION */
   
   /* Define to 1 if building RPC client/server. */
   /* #undef HAVE_RPC */
  @@ -414,6 +429,9 @@
   /* Define to 1 if building statistics support. */
   /* #undef HAVE_STATISTICS */
   
  +/* Define to 1 to enable performance event tracing of *_stat() statistics. */
  +/* #undef HAVE_STATISTICS_PERFMON */
  +
   /* Define to 1 if you have the <stdint.h> header file. */
   /* #undef HAVE_STDINT_H */
   
  @@ -468,6 +486,9 @@
   /* Define to 1 if you have the `sysconf' function. */
   /* #undef HAVE_SYSCONF */
   
  +/* Define to 1 to use stap for performance event tracing. */
  +/* #undef HAVE_SYSTEMTAP */
  +
   /* Define to 1 if port includes files in the Berkeley DB source code. */
   #define HAVE_SYSTEM_INCLUDE_FILES 1
   
  @@ -479,11 +500,14 @@
      */
   /* #undef HAVE_SYS_NDIR_H */
   
  +/* Define to 1 if you have the <sys/sdt.h> header file. */
  +/* #undef HAVE_SYS_SDT_H */
  +
   /* Define to 1 if you have the <sys/select.h> header file. */
   /* #undef HAVE_SYS_SELECT_H */
   
   /* Define to 1 if you have the <sys/socket.h> header file. */
  -/* #undef HAVE_SYS_SOCKET_H */
  +#define HAVE_SYS_SOCKET_H 1
   
   /* Define to 1 if you have the <sys/stat.h> header file. */
   /* #undef HAVE_SYS_STAT_H */
  @@ -531,13 +555,16 @@
   #define PACKAGE_NAME "Berkeley DB"
   
   /* Define to the full name and version of this package. */
  -#define PACKAGE_STRING "Berkeley DB 4.8.26"
  +#define PACKAGE_STRING "Berkeley DB 5.0.26"
   
   /* Define to the one symbol short name of this package. */
  -#define PACKAGE_TARNAME "db-4.8.26"
  +#define PACKAGE_TARNAME "db-5.0.26"
  +
  +/* Define to the home page for this package. */
  +#define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
   
   /* Define to the version of this package. */
  -#define PACKAGE_VERSION "4.8.26"
  +#define PACKAGE_VERSION "5.0.26"
   
   /* The size of a `char', as computed by sizeof. */
   /* #undef SIZEOF_CHAR */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_deadlock/db_deadlock.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_deadlock.c
  --- db/build_vxworks/db_deadlock/db_deadlock.c	16 Sep 2009 19:34:39 -0000	1.11
  +++ db/build_vxworks/db_deadlock/db_deadlock.c	23 Aug 2010 13:36:28 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   int db_deadlock_main __P((int, char *[]));
  @@ -145,7 +145,7 @@
   
   	/* Log our process ID. */
   	if (logfile != NULL && __db_util_logset(progname, logfile))
  -		goto shutdown;
  +		goto err;
   
   	/*
   	 * Create an environment object and initialize it for error
  @@ -154,7 +154,7 @@
   	if ((ret = db_env_create(&dbenv, 0)) != 0) {
   		fprintf(stderr,
   		    "%s: db_env_create: %s\n", progname, db_strerror(ret));
  -		goto shutdown;
  +		goto err;
   	}
   
   	dbenv->set_errfile(dbenv, stderr);
  @@ -163,7 +163,7 @@
   	if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
   	    passwd, DB_ENCRYPT_AES)) != 0) {
   		dbenv->err(dbenv, ret, "set_passwd");
  -		goto shutdown;
  +		goto err;
   	}
   
   	if (verbose) {
  @@ -174,7 +174,7 @@
   	/* An environment is required. */
   	if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0) {
   		dbenv->err(dbenv, ret, "open");
  -		goto shutdown;
  +		goto err;
   	}
   
   	while (!__db_util_interrupted()) {
  @@ -187,7 +187,7 @@
   		if ((ret =
   		    dbenv->lock_detect(dbenv, 0, atype, &rejected)) != 0) {
   			dbenv->err(dbenv, ret, "DB_ENV->lock_detect");
  -			goto shutdown;
  +			goto err;
   		}
   		if (verbose)
   			dbenv->errx(dbenv, "rejected %d locks", rejected);
  @@ -199,7 +199,7 @@
   	}
   
   	if (0) {
  -shutdown:	exitval = 1;
  +err:		exitval = 1;
   	}
   
   	/* Clean up the logfile. */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_deadlock/db_deadlock20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_deadlock20.wpj
  --- db/build_vxworks/db_deadlock/db_deadlock20.wpj	1 Oct 2006 20:18:47 -0000	1.2
  +++ db/build_vxworks/db_deadlock/db_deadlock20.wpj	23 Aug 2010 13:36:28 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_deadlock.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_deadlock.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_deadlock.c_objects
  -db_deadlock.o
  -<END>
  -
  -<BEGIN> FILE_db_deadlock.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_deadlock.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_deadlock/db_deadlock22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_deadlock22.wpj
  --- db/build_vxworks/db_deadlock/db_deadlock22.wpj	1 Oct 2006 20:18:47 -0000	1.2
  +++ db/build_vxworks/db_deadlock/db_deadlock22.wpj	23 Aug 2010 13:36:28 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_deadlock.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_deadlock.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_deadlock.c_objects
  -db_deadlock.o
  -<END>
  -
  -<BEGIN> FILE_db_deadlock.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_deadlock.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_dump/db_dump.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_dump.c
  --- db/build_vxworks/db_dump/db_dump.c	16 Sep 2009 19:34:40 -0000	1.11
  +++ db/build_vxworks/db_dump/db_dump.c	23 Aug 2010 13:36:28 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -14,7 +14,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   int	 db_dump_db_init __P((DB_ENV *, char *, int, u_int32_t, int *));
  @@ -49,6 +49,7 @@
   	extern int optind, __db_getopt_reset;
   	DB_ENV	*dbenv;
   	DB *dbp;
  +	db_pgno_t first, last;
   	u_int32_t cache;
   	int ch;
   	int exitval, keyflag, lflag, mflag, nflag, pflag, sflag, private;
  @@ -66,12 +67,13 @@
   	dbenv = NULL;
   	dbp = NULL;
   	exitval = lflag = mflag = nflag = pflag = rflag = Rflag = sflag = 0;
  +	first = last = PGNO_INVALID;
   	keyflag = 0;
   	cache = MEGABYTE;
   	private = 0;
   	dbname = dopt = filename = home = passwd = NULL;
   	__db_getopt_reset = 1;
  -	while ((ch = getopt(argc, argv, "d:f:h:klm:NpP:rRs:V")) != EOF)
  +	while ((ch = getopt(argc, argv, "d:f:F:h:klL:m:NpP:rRs:V")) != EOF)
   		switch (ch) {
   		case 'd':
   			dopt = optarg;
  @@ -83,6 +85,9 @@
   				return (EXIT_FAILURE);
   			}
   			break;
  +		case 'F':
  +			first = strtoul(optarg, NULL, 10);
  +			break;
   		case 'h':
   			home = optarg;
   			break;
  @@ -92,6 +97,9 @@
   		case 'l':
   			lflag = 1;
   			break;
  +		case 'L':
  +			last = strtoul(optarg, NULL, 10);
  +			break;
   		case 'm':
   			mflag = 1;
   			dbname = optarg;
  @@ -262,7 +270,8 @@
   	}
   
   	if (dopt != NULL) {
  -		if ((ret = __db_dumptree(dbp, NULL, dopt, NULL)) != 0) {
  +		if ((ret =
  +		    __db_dumptree(dbp, NULL, dopt, NULL, first, last)) != 0) {
   			dbp->err(dbp, ret, "__db_dumptree: %s", filename);
   			goto err;
   		}
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_dump/db_dump20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_dump20.wpj
  --- db/build_vxworks/db_dump/db_dump20.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_dump/db_dump20.wpj	23 Aug 2010 13:36:28 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_dump.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_dump.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_dump.c_objects
  -db_dump.o
  -<END>
  -
  -<BEGIN> FILE_db_dump.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_dump.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_dump/db_dump22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_dump22.wpj
  --- db/build_vxworks/db_dump/db_dump22.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_dump/db_dump22.wpj	23 Aug 2010 13:36:28 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_dump.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_dump.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_dump.c_objects
  -db_dump.o
  -<END>
  -
  -<BEGIN> FILE_db_dump.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_dump.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_hotbackup/db_hotbackup.c
  ============================================================================
  $ cvs diff -u -r1.6 -r1.6.2.1 db_hotbackup.c
  --- db/build_vxworks/db_hotbackup/db_hotbackup.c	16 Sep 2009 19:34:40 -0000	1.6
  +++ db/build_vxworks/db_hotbackup/db_hotbackup.c	23 Aug 2010 13:36:29 -0000	1.6.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -15,7 +15,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   enum which_open { OPEN_ORIGINAL, OPEN_HOT_BACKUP };
  @@ -214,13 +214,13 @@
   	     (db_config || log_dir != NULL) ? &log_dir : NULL,
   	     db_config ? &data_dir : NULL,
   	     passwd, OPEN_ORIGINAL) != 0)
  -		goto shutdown;
  +		goto err;
   
   	if (db_config && __os_abspath(log_dir)) {
   		fprintf(stderr,
   	"%s: DB_CONFIG must not contain an absolute path for the log directory",
   		    progname);
  -		goto shutdown;
  +		goto err;
   	}
   
   	/*
  @@ -233,7 +233,7 @@
   		if ((ret =
   		    dbenv->txn_checkpoint(dbenv, 0, 0, DB_FORCE)) != 0) {
   			dbenv->err(dbenv, ret, "DB_ENV->txn_checkpoint");
  -			goto shutdown;
  +			goto err;
   		}
   		if (!update) {
   			if (verbose)
  @@ -242,7 +242,7 @@
   			if ((ret = dbenv->log_archive(dbenv,
   			     NULL, DB_ARCH_REMOVE)) != 0) {
   				dbenv->err(dbenv, ret, "DB_ENV->log_archive");
  -				goto shutdown;
  +				goto err;
   			}
   		}
   	}
  @@ -267,10 +267,10 @@
   	if (db_config && log_dir != NULL &&
   	    db_hotbackup_backup_dir_clean(
   	    dbenv, backup_dir, log_dir, &remove_max, update, verbose) != 0)
  -		goto shutdown;
  +		goto err;
   	if (db_hotbackup_backup_dir_clean(dbenv,
   	    backup_dir, NULL, &remove_max, update, verbose) != 0)
  -		goto shutdown;
  +		goto err;
   
   	/*
   	 * If the -u option was not specified, copy all database files found in
  @@ -280,7 +280,7 @@
   	if (!update) {
   		if (db_hotbackup_read_data_dir(dbenv, home,
   		     backup_dir, home, verbose, db_config) != 0)
  -			goto shutdown;
  +			goto err;
   		if (data_dir != NULL)
   			for (dir = data_dir; *dir != NULL; ++dir) {
   				/*
  @@ -292,11 +292,11 @@
   					fprintf(stderr,
        "%s: data directory '%s' is absolute path, not permitted with -D option\n",
   					     progname, *dir);
  -					goto shutdown;
  +					goto err;
   				}
   				if (db_hotbackup_read_data_dir(dbenv, home,
   				     backup_dir, *dir, verbose, db_config) != 0)
  -					goto shutdown;
  +					goto err;
   			}
   	}
   
  @@ -309,7 +309,7 @@
   	 */
   	if (db_hotbackup_read_log_dir(dbenv, db_config ? home : NULL, backup_dir,
   	     log_dir == NULL ? home : log_dir, &copy_min, update, verbose) != 0)
  -		goto shutdown;
  +		goto err;
   
   	/*
   	 * If we're updating a snapshot, the lowest-numbered log file copied
  @@ -325,7 +325,7 @@
   		fprintf(stderr,
   		    "%s: than or equal the smallest log file copied (%d)\n",
   		    progname, copy_min);
  -		goto shutdown;
  +		goto err;
   	}
   
   	/* Close the source environment. */
  @@ -333,7 +333,7 @@
   		fprintf(stderr,
   		    "%s: dbenv->close: %s\n", progname, db_strerror(ret));
   		dbenv = NULL;
  -		goto shutdown;
  +		goto err;
   	}
   	/* Perform catastrophic recovery on the hot backup. */
   	if (verbose)
  @@ -341,7 +341,7 @@
   		    progname, backup_dir);
   	if (db_hotbackup_env_init(
   	    &dbenv, backup_dir, NULL, NULL, passwd, OPEN_HOT_BACKUP) != 0)
  -		goto shutdown;
  +		goto err;
   
   	/*
   	 * Remove any unnecessary log files from the hot backup.
  @@ -352,11 +352,11 @@
   	if ((ret =
   	    dbenv->log_archive(dbenv, NULL, DB_ARCH_REMOVE)) != 0) {
   		dbenv->err(dbenv, ret, "DB_ENV->log_archive");
  -		goto shutdown;
  +		goto err;
   	}
   
   	if (0) {
  -shutdown:	exitval = 1;
  +err:		exitval = 1;
   	}
   	if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
   		exitval = 1;
  @@ -601,15 +601,17 @@
   	}
   	for (cnt = fcnt; --cnt >= 0;) {
   		/*
  -		 * Skip files in DB's name space (but not Queue
  -		 * extent files, we need them).
  +		 * Skip files in DB's name space (but not Queue extent files or
  +		 * the replicated system database, we need them).
   		 */
   		if (!strncmp(names[cnt], LFPREFIX, sizeof(LFPREFIX) - 1))
   			continue;
   		if (!strncmp(names[cnt],
   		    DB_REGION_PREFIX, sizeof(DB_REGION_PREFIX) - 1) &&
   		    strncmp(names[cnt],
  -		    QUEUE_EXTENT_PREFIX, sizeof(QUEUE_EXTENT_PREFIX) - 1))
  +		    QUEUE_EXTENT_PREFIX, sizeof(QUEUE_EXTENT_PREFIX) - 1) &&
  +		    strncmp(names[cnt],
  +		    REPSYSDBNAME, sizeof(REPSYSDBNAME) - 1))
   			continue;
   
   		/*
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_hotbackup/db_hotbackup20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_hotbackup20.wpj
  --- db/build_vxworks/db_hotbackup/db_hotbackup20.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_hotbackup/db_hotbackup20.wpj	23 Aug 2010 13:36:29 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_hotbackup.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_hotbackup.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_hotbackup.c_objects
  -db_hotbackup.o
  -<END>
  -
  -<BEGIN> FILE_db_hotbackup.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_hotbackup.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_hotbackup/db_hotbackup22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_hotbackup22.wpj
  --- db/build_vxworks/db_hotbackup/db_hotbackup22.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_hotbackup/db_hotbackup22.wpj	23 Aug 2010 13:36:29 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_hotbackup.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_hotbackup.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_hotbackup.c_objects
  -db_hotbackup.o
  -<END>
  -
  -<BEGIN> FILE_db_hotbackup.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_hotbackup.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_int.h
  ============================================================================
  $ cvs diff -u -r1.13 -r1.13.2.1 db_int.h
  --- db/build_vxworks/db_int.h	16 Sep 2009 19:34:38 -0000	1.13
  +++ db/build_vxworks/db_int.h	23 Aug 2010 13:36:26 -0000	1.13.2.1
  @@ -2,7 +2,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -21,7 +21,7 @@
   #endif
   #include <sys/stat.h>
   
  -#if defined(__INCLUDE_SELECT_H)
  +#if defined(HAVE_REPLICATION_THREADS)
   #ifdef HAVE_SYS_SELECT_H
   #include <sys/select.h>
   #endif
  @@ -47,7 +47,7 @@
   #include <sys/uio.h>
   #endif
   
  -#if defined(__INCLUDE_NETWORKING)
  +#if defined(HAVE_REPLICATION_THREADS)
   #ifdef HAVE_SYS_SOCKET_H
   #include <sys/socket.h>
   #endif
  @@ -73,25 +73,6 @@
   #include <string.h>
   #include <unistd.h>
   
  -#if defined(__INCLUDE_DIRECTORY)
  -#if HAVE_DIRENT_H
  -# include <dirent.h>
  -# define NAMLEN(dirent) strlen((dirent)->d_name)
  -#else
  -# define dirent direct
  -# define NAMLEN(dirent) (dirent)->d_namlen
  -# if HAVE_SYS_NDIR_H
  -#  include <sys/ndir.h>
  -# endif
  -# if HAVE_SYS_DIR_H
  -#  include <sys/dir.h>
  -# endif
  -# if HAVE_NDIR_H
  -#  include <ndir.h>
  -# endif
  -#endif
  -#endif /* __INCLUDE_DIRECTORY */
  -
   #endif /* !HAVE_SYSTEM_INCLUDE_FILES */
   #include "clib_port.h"
   #include "db.h"
  @@ -100,19 +81,37 @@
   #include "dbinc/win_db.h"
   #endif
   
  +#ifdef HAVE_DBM
  +#undef	DB_DBM_HSEARCH
  +#define	DB_DBM_HSEARCH 1
  +#endif
  +
   #include "db.h"
   #include "clib_port.h"
   
   #include "dbinc/queue.h"
   #include "dbinc/shqueue.h"
  +#include "dbinc/perfmon.h"
   
   #if defined(__cplusplus)
   extern "C" {
   #endif
   
  +/*
  + * The Windows compiler needs to be told about structures that are available
  + * outside a dll.
  + */
  +#if defined(DB_WIN32) && defined(_MSC_VER) && \
  +    !defined(DB_CREATE_DLL) && !defined(_LIB)
  +#define	__DB_IMPORT __declspec(dllimport)
  +#else
  +#define	__DB_IMPORT
  +#endif
  +
   /*******************************************************
    * Forward structure declarations.
    *******************************************************/
  +struct __db_commit_info; typedef struct __db_commit_info DB_COMMIT_INFO;
   struct __db_reginfo_t;	typedef struct __db_reginfo_t REGINFO;
   struct __db_txnhead;	typedef struct __db_txnhead DB_TXNHEAD;
   struct __db_txnlist;	typedef struct __db_txnlist DB_TXNLIST;
  @@ -120,6 +119,24 @@
   struct __vrfy_dbinfo;   typedef struct __vrfy_dbinfo VRFY_DBINFO;
   struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO;
   
  +struct __db_log_verify_info;
  +struct __txn_verify_info;
  +struct __lv_filereg_info;
  +struct __lv_ckp_info;
  +struct __lv_timestamp_info;
  +typedef struct __db_log_verify_info DB_LOG_VRFY_INFO;
  +typedef struct __txn_verify_info VRFY_TXN_INFO;
  +typedef struct __lv_filereg_info VRFY_FILEREG_INFO;
  +typedef struct __lv_filelife VRFY_FILELIFE;
  +typedef struct __lv_ckp_info VRFY_CKP_INFO;
  +typedef struct __lv_timestamp_info VRFY_TIMESTAMP_INFO;
  +
  +/*
  + * TXNINFO_HANDLER --
  + *	Callback function pointer type for __iterate_txninfo.
  + */
  +typedef int (*TXNINFO_HANDLER) __P((DB_LOG_VRFY_INFO *, VRFY_TXN_INFO *, void *));
  +
   typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB;
   
   /*******************************************************
  @@ -142,6 +159,12 @@
   
   #define	RECNO_OOB	0		/* Illegal record number. */
   
  +/*
  + * Define a macro which has no runtime effect, yet avoids triggering empty
  + * statement compiler warnings. Use it as the text of conditionally-null macros.
  + */
  +#define	NOP_STATEMENT	do { } while (0)
  +
   /* Test for a power-of-two (tests true for zero, which doesn't matter here). */
   #define	POWER_OF_TWO(x)	(((x) & ((x) - 1)) == 0)
   
  @@ -171,6 +194,14 @@
   	(void *)(((uintptr_t)(p) + (bound) - 1) & ~(((uintptr_t)(bound)) - 1))
   
   /*
  + * Berkeley DB uses the va_copy macro from C99, not all compilers include
  + * it, so add a dumb implementation compatible with pre C99 implementations.
  + */
  +#ifndef	va_copy
  +#define	va_copy(d, s)	((d) = (s))
  +#endif
  +
  +/*
    * Print an address as a u_long (a u_long is the largest type we can print
    * portably).  Most 64-bit systems have made longs 64-bits, so this should
    * work.
  @@ -245,10 +276,47 @@
   #undef	STAT
   #ifdef	HAVE_STATISTICS
   #define	STAT(x)	x
  +#define	STAT_ADJUST(env, cat, id, val, amount)		\
  +	do {						\
  +		(val) += (amount);			\
  +		STAT_PERFMON1((env), cat, id, (val));	\
  +	} while (0)
  +#define	STAT_INC(env, cat, id, val) 			\
  +	 STAT_ADJUST(env, cat, id, val, 1) 
  +#define	STAT_DEC(env, cat, id, val) 			\
  +	 STAT_ADJUST(env, cat, id, val, -1)
  +#define	STAT_SET(env, cat, id, val, newwal) 		\
  +	do {						\
  +		(val) = (newval);			\
  +		STAT_PERFMON1((env), cat, id, (val));	\
  +	} while (0)
   #else
  -#define	STAT(x)
  +#define	STAT(x)					NOP_STATEMENT
  +#define	STAT_ADJUST(env, cat, id, val, amount)	NOP_STATEMENT
  +#define	STAT_INC(env, cat, id, val)		NOP_STATEMENT
  +#define	STAT_DEC(env, cat, id, val)		NOP_STATEMENT
  +#define	STAT_SET(env, cat, id, val, newwal)	NOP_STATEMENT
   #endif
   
  +/* 
  + * These macros are used when an error condition is first noticed. They allow
  + * one to be notified (via e.g. DTrace, SystemTap, ...) when an error occurs
  + * deep inside DB, rather than when it is returned back through the API.
  + *
  + * The second actual argument to these is the second part of the error or
  + * warning event name. They work when 'errcode' is a symbolic name e.g.
  + * EINVAL or DB_LOCK_DEALOCK, not a variable.  Noticing system call failures
  + * would be handled by tracing on syscall exit returning < 0.
  + */
  +#define	ERR_ORIGIN(env, errcode)        \
  +	(PERFMON0(env, error, errcode), errcode)
  +
  +#define	ERR_ORIGIN_MSG(env, errcode, msg)	\
  +	(PERFMON1(env, error, errcode, msg), errcode)
  +
  +#define	WARNING_ORIGIN(env, errcode)	\
  +	(PERFMON0(env, warning, errcode), errcode)
  +
   /*
    * Structure used for callback message aggregation.
    *
  @@ -271,6 +339,18 @@
   		DB_MSGBUF_INIT(a);					\
   	}								\
   } while (0)
  +#define	DB_MSGBUF_REP_FLUSH(env, a, diag_msg, regular_msg) do {		\
  +	if ((a)->buf != NULL) {						\
  +		if ((a)->cur != (a)->buf && diag_msg)			\
  +			__db_repmsg(env, "%s", (a)->buf);		\
  +		if (regular_msg)					\
  +			DB_MSGBUF_FLUSH(env, a);			\
  +		else {							\
  +			__os_free(env, (a)->buf);			\
  +			DB_MSGBUF_INIT(a);				\
  +		}							\
  +	}								\
  +} while (0)
   #define	STAT_FMT(msg, fmt, type, v) do {				\
   	DB_MSGBUF __mb;							\
   	DB_MSGBUF_INIT(&__mb);						\
  @@ -339,6 +419,10 @@
   				    (ret) == DB_REP_NEWSITE || \
   				    (ret) == DB_REP_NOTPERM)
   #define	DB_RETOK_REPMGR_START(ret) ((ret) == 0 || (ret) == DB_REP_IGNORE)
  +#define	DB_RETOK_TXNAPPLIED(ret) ((ret) == 0 || \
  +				    (ret) == DB_NOTFOUND ||		\
  +				    (ret) == DB_TIMEOUT ||		\
  +				    (ret) == DB_KEYEMPTY)
   
   /* Find a reasonable operation-not-supported error. */
   #ifdef	EOPNOTSUPP
  @@ -488,11 +572,11 @@
   		CHECK_THREAD(env);					\
   } while (0)
   #else
  -#define	CHECK_MTX_THREAD(env, mtx)
  +#define	CHECK_MTX_THREAD(env, mtx)	NOP_STATEMENT
   #endif
   #else
  -#define	CHECK_THREAD(env)
  -#define	CHECK_MTX_THREAD(env, mtx)
  +#define	CHECK_THREAD(env)		NOP_STATEMENT
  +#define	CHECK_MTX_THREAD(env, mtx)	NOP_STATEMENT
   #endif
   
   typedef enum {
  @@ -628,6 +712,10 @@
   	int (*dbt_usercopy)
   	    __P((DBT *, u_int32_t, void *, u_int32_t, u_int32_t));
   
  +	int (*log_verify_wrap) __P((ENV *, const char *, u_int32_t,  
  +	    const char *, const char *, time_t, time_t, u_int32_t,  u_int32_t,
  +	    u_int32_t, u_int32_t, int, int));
  +
   	REGINFO	*reginfo;		/* REGINFO structure reference */
   
   #define	DB_TEST_ELECTINIT	 1	/* after __rep_elect_init */
  @@ -639,7 +727,8 @@
   #define	DB_TEST_POSTSYNC	 7	/* after syncing the log */
   #define	DB_TEST_PREDESTROY	 8	/* before destroy op */
   #define	DB_TEST_PREOPEN		 9	/* before __os_open */
  -#define	DB_TEST_SUBDB_LOCKS	 10	/* subdb locking tests */
  +#define	DB_TEST_REPMGR_PERM	 10	/* repmgr perm/archiving tests */
  +#define	DB_TEST_SUBDB_LOCKS	 11	/* subdb locking tests */
   	int	test_abort;		/* Abort value for testing */
   	int	test_check;		/* Checkpoint value for testing */
   	int	test_copy;		/* Copy value for testing */
  @@ -712,7 +801,7 @@
   };
   
   /* Actions that __db_master_update can take. */
  -typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
  +typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN, MU_MOVE } mu_action;
   
   /*
    * Access-method-common macro for determining whether a cursor
  @@ -762,6 +851,11 @@
   		(dbc)->rdata = &(dbc)->my_rdata;	\
   	} while (0)
   
  +#define	COMPACT_TRUNCATE(c_data) do {			\
  +	if (c_data->compact_truncate > 1)		\
  +		c_data->compact_truncate--;		\
  +} while (0)
  +
   /*******************************************************
    * Mpool.
    *******************************************************/
  @@ -816,10 +910,10 @@
    */
   
   #define	LOG_COMPARE(lsn0, lsn1)						\
  -    ((lsn0)->file != (lsn1)->file ?					\
  -    ((lsn0)->file < (lsn1)->file ? -1 : 1) :				\
  -    ((lsn0)->offset != (lsn1)->offset ?					\
  -    ((lsn0)->offset < (lsn1)->offset ? -1 : 1) : 0))
  +	((lsn0)->file != (lsn1)->file ?					\
  +	((lsn0)->file < (lsn1)->file ? -1 : 1) :			\
  +	((lsn0)->offset != (lsn1)->offset ?				\
  +	((lsn0)->offset < (lsn1)->offset ? -1 : 1) : 0))
   
   /*******************************************************
    * Txn.
  @@ -828,7 +922,7 @@
   #define	NOWAIT_FLAG(txn) \
   	((txn) != NULL && F_ISSET((txn), TXN_NOWAIT) ? DB_LOCK_NOWAIT : 0)
   #define	IS_REAL_TXN(txn)						\
  -	((txn) != NULL && !F_ISSET(txn, TXN_CDSGROUP))
  +	((txn) != NULL && !F_ISSET(txn, TXN_FAMILY))
   #define	IS_SUBTRANSACTION(txn)						\
   	((txn) != NULL && (txn)->parent != NULL)
   
  @@ -841,7 +935,7 @@
   /*******************************************************
    * Compression
    *******************************************************/
  -#define CMP_INT_SPARE_VAL	0xFC	/* Smallest byte value that the integer
  +#define	CMP_INT_SPARE_VAL	0xFC	/* Smallest byte value that the integer
   					   compression algorithm doesn't use */
   
   /*******************************************************
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_load/db_load.c
  ============================================================================
  $ cvs diff -u -r1.13 -r1.13.2.1 db_load.c
  --- db/build_vxworks/db_load/db_load.c	16 Sep 2009 19:34:40 -0000	1.13
  +++ db/build_vxworks/db_load/db_load.c	23 Aug 2010 13:36:29 -0000	1.13.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -14,7 +14,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   typedef struct {			/* XXX: Globals. */
  @@ -41,9 +41,10 @@
   int	db_load_dbt_rrecno __P((DB_ENV *, DBT *, int));
   int	db_load_dbt_to_recno __P((DB_ENV *, DBT *, db_recno_t *));
   int	db_load_env_create __P((DB_ENV **, LDG *));
  +void	free_keys __P((DBT *part_keys));
   int	db_load_load __P((DB_ENV *, char *, DBTYPE, char **, u_int, LDG *, int *));
   int	db_load_main __P((int, char *[]));
  -int	db_load_rheader __P((DB_ENV *, DB *, DBTYPE *, char **, int *, int *));
  +int	db_load_rheader __P((DB_ENV *, DB *, DBTYPE *, char **, int *, int *, DBT **));
   int	db_load_usage __P((void));
   int	db_load_version_check __P((void));
   
  @@ -243,7 +244,7 @@
   	 * then open it.
   	 */
   	if (db_load_env_create(&dbenv, &ldg) != 0)
  -		goto shutdown;
  +		goto err;
   
   	/* If we're resetting the LSNs, that's an entirely separate path. */
   	switch (mode) {
  @@ -260,12 +261,12 @@
   		while (!ldg.endofile)
   			if (db_load_load(dbenv, argv[0], dbtype, clist, ldf,
   			    &ldg, &existed) != 0)
  -				goto shutdown;
  +				goto err;
   		break;
   	}
   
   	if (0) {
  -shutdown:	exitval = 1;
  +err:		exitval = 1;
   	}
   	if ((ret = dbenv->close(dbenv, 0)) != 0) {
   		exitval = 1;
  @@ -305,7 +306,7 @@
   {
   	DB *dbp;
   	DBC *dbc;
  -	DBT key, rkey, data, *readp, *writep;
  +	DBT key, rkey, data, *part_keys, *readp, *writep;
   	DBTYPE dbtype;
   	DB_TXN *ctxn, *txn;
   	db_recno_t recno, datarecno;
  @@ -319,6 +320,7 @@
   	dbc = NULL;
   	subdb = NULL;
   	ctxn = txn = NULL;
  +	part_keys = NULL;
   	memset(&key, 0, sizeof(DBT));
   	memset(&data, 0, sizeof(DBT));
   	memset(&rkey, 0, sizeof(DBT));
  @@ -341,7 +343,7 @@
   		dbtype = argtype;
   	} else {
   		if (db_load_rheader(dbenv,
  -		    dbp, &dbtype, &subdb, &checkprint, &keys) != 0)
  +		    dbp, &dbtype, &subdb, &checkprint, &keys, &part_keys) != 0)
   			goto err;
   		if (G(endofile))
   			goto done;
  @@ -609,7 +611,7 @@
   	if (rkey.data != NULL)
   		free(rkey.data);
   	free(data.data);
  -
  +	free_keys(part_keys);
   	return (rval);
   }
   
  @@ -827,12 +829,13 @@
    *	Read the header message.
    */
   int
  -db_load_rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp)
  +db_load_rheader(dbenv, dbp, dbtypep, subdbp, checkprintp, keysp, part_keyp)
   	DB_ENV *dbenv;
   	DB *dbp;
   	DBTYPE *dbtypep;
   	char **subdbp;
   	int *checkprintp, *keysp;
  +	DBT **part_keyp;
   {
   	DBT *keys, *kp;
   	size_t buflen, linelen, start;
  @@ -844,6 +847,8 @@
   	*dbtypep = DB_UNKNOWN;
   	*checkprintp = 0;
   	name = NULL;
  +	*part_keyp = NULL;
  +	keys = NULL;
   
   	/*
   	 * We start with a smallish buffer;  most headers are small.
  @@ -1004,10 +1009,11 @@
   			}
   			nparts = (u_int32_t) val;
   			if ((keys =
  -			    malloc((nparts - 1) * sizeof(DBT))) == NULL) {
  +			    malloc(nparts * sizeof(DBT))) == NULL) {
   				dbenv->err(dbenv, ENOMEM, NULL);
   				goto err;
   			}
  +			keys[nparts - 1].data = NULL;
   			kp = keys;
   			for (i = 1; i < nparts; kp++, i++) {
   				if ((kp->data =
  @@ -1027,6 +1033,8 @@
   			     dbp, nparts, keys, NULL)) != 0)
   				goto err;
   
  +			*part_keyp = keys;
  +
   			continue;
   		}
   
  @@ -1053,9 +1061,24 @@
   	}
   	if (name != NULL)
   		free(name);
  +	if (ret != 0) {
  +		*part_keyp = NULL;
  +		free_keys(keys);
  +	}
   	return (ret);
   }
   
  +void free_keys(part_keys)
  +	DBT *part_keys;
  +{
  +	DBT *kp;
  +	if (part_keys != NULL) {
  +		for (kp = part_keys; kp->data != NULL; kp++)
  +			free(kp->data);
  +		free(part_keys);
  +	}
  +}
  +
   /*
    * Macro to convert a pair of hex bytes to a decimal value.
    *
  @@ -1106,7 +1129,7 @@
    * convprintable --
    *	Convert a printable-encoded string into a newly allocated string.
    *
  - * In an ideal world, this would probably share code with dbt_rprint, but
  + * In an ideal world, this would probably share code with dbt_rprint but
    * that's set up to read character-by-character (to avoid large memory
    * allocations that aren't likely to be a problem here), and this has fewer
    * special cases to deal with.
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_load/db_load20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_load20.wpj
  --- db/build_vxworks/db_load/db_load20.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_load/db_load20.wpj	23 Aug 2010 13:36:29 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_load.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_load.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_load.c_objects
  -db_load.o
  -<END>
  -
  -<BEGIN> FILE_db_load.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_load.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_load/db_load22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_load22.wpj
  --- db/build_vxworks/db_load/db_load22.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_load/db_load22.wpj	23 Aug 2010 13:36:29 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_load.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_load.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_load.c_objects
  -db_load.o
  -<END>
  -
  -<BEGIN> FILE_db_load.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_load.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_printlog/db_printlog.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.12.2.1 db_printlog.c
  --- db/build_vxworks/db_printlog/db_printlog.c	7 Jan 2010 22:02:21 -0000	1.12
  +++ db/build_vxworks/db_printlog/db_printlog.c	23 Aug 2010 13:36:30 -0000	1.12.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -13,13 +13,12 @@
   #include "dbinc/btree.h"
   #include "dbinc/fop.h"
   #include "dbinc/hash.h"
  -#include "dbinc/log.h"
   #include "dbinc/qam.h"
   #include "dbinc/txn.h"
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   int db_printlog_print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
  @@ -27,6 +26,7 @@
   int db_printlog_env_init_print_42 __P((ENV *, DB_DISTAB *));
   int db_printlog_env_init_print_43 __P((ENV *, DB_DISTAB *));
   int db_printlog_env_init_print_47 __P((ENV *, DB_DISTAB *));
  +int db_printlog_env_init_print_48 __P((ENV *, DB_DISTAB *));
   int db_printlog_lsn_arg __P((char *, DB_LSN *));
   int db_printlog_main __P((int, char *[]));
   int db_printlog_open_rep_db __P((DB_ENV *, DB **, DBC **));
  @@ -61,11 +61,12 @@
   	DBT data, keydbt;
   	DB_DISTAB dtab;
   	DB_ENV	*dbenv;
  +	DB_LOG dblog;
   	DB_LOGC *logc;
   	DB_LSN key, start, stop, verslsn;
   	ENV *env;
   	u_int32_t logcflag, newversion, version;
  -	int ch, cmp, exitval, nflag, rflag, ret, repflag;
  +	int ch, cmp, exitval, i, nflag, rflag, ret, repflag;
   	char *home, *passwd;
   
   	if ((progname = __db_rpath(argv[0])) == NULL)
  @@ -79,6 +80,7 @@
   	dbp = NULL;
   	dbc = NULL;
   	dbenv = NULL;
  +	env = NULL;
   	logc = NULL;
   	ZERO_LSN(start);
   	ZERO_LSN(stop);
  @@ -86,6 +88,7 @@
   	home = passwd = NULL;
   
   	memset(&dtab, 0, sizeof(dtab));
  +	memset(&dblog, 0, sizeof(dblog));
   
   	__db_getopt_reset = 1;
   	while ((ch = getopt(argc, argv, "b:e:h:NP:rRV")) != EOF)
  @@ -144,7 +147,7 @@
   	if ((ret = db_env_create(&dbenv, 0)) != 0) {
   		fprintf(stderr,
   		    "%s: db_env_create: %s\n", progname, db_strerror(ret));
  -		goto shutdown;
  +		goto err;
   	}
   
   	dbenv->set_errfile(dbenv, stderr);
  @@ -153,18 +156,18 @@
   	if (nflag) {
   		if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) {
   			dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING");
  -			goto shutdown;
  +			goto err;
   		}
   		if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) {
   			dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC");
  -			goto shutdown;
  +			goto err;
   		}
   	}
   
   	if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
   	    passwd, DB_ENCRYPT_AES)) != 0) {
   		dbenv->err(dbenv, ret, "set_passwd");
  -		goto shutdown;
  +		goto err;
   	}
   
   	/*
  @@ -174,7 +177,7 @@
   	if ((ret = dbenv->set_app_dispatch(
   	    dbenv, db_printlog_print_app_record)) != 0) {
   		dbenv->err(dbenv, ret, "app_dispatch");
  -		goto shutdown;
  +		goto err;
   	}
   
   	/*
  @@ -192,24 +195,24 @@
   		    DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0))
   		    != 0)) {
   			dbenv->err(dbenv, ret, "DB_ENV->open");
  -			goto shutdown;
  +			goto err;
   		}
   	} else if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
   	    (ret == DB_VERSION_MISMATCH ||
   	    (ret = dbenv->open(dbenv, home,
   	    DB_CREATE | DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) {
   		dbenv->err(dbenv, ret, "DB_ENV->open");
  -		goto shutdown;
  +		goto err;
   	}
   	env = dbenv->env;
   
   	/* Allocate a log cursor. */
   	if (repflag) {
   		if ((ret = db_printlog_open_rep_db(dbenv, &dbp, &dbc)) != 0)
  -			goto shutdown;
  +			goto err;
   	} else if ((ret = dbenv->log_cursor(dbenv, &logc, 0)) != 0) {
   		dbenv->err(dbenv, ret, "DB_ENV->log_cursor");
  -		goto shutdown;
  +		goto err;
   	}
   
   	if (IS_ZERO_LSN(start)) {
  @@ -237,7 +240,7 @@
   	if (repflag &&
   	    (ret = db_printlog_env_init_print(env, version, &dtab)) != 0) {
   		dbenv->err(dbenv, ret, "callback: initialization");
  -		goto shutdown;
  +		goto err;
   	}
   	for (; !__db_util_interrupted(); logcflag = rflag ? DB_PREV : DB_NEXT) {
   		if (repflag) {
  @@ -251,7 +254,7 @@
   				break;
   			dbenv->err(dbenv,
   			    ret, repflag ? "DBC->get" : "DB_LOGC->get");
  -			goto shutdown;
  +			goto err;
   		}
   
   		/*
  @@ -270,7 +273,7 @@
   			 */
   			if ((ret = logc->version(logc, &newversion, 0)) != 0) {
   				dbenv->err(dbenv, ret, "DB_LOGC->version");
  -				goto shutdown;
  +				goto err;
   			}
   			if (version != newversion) {
   				version = newversion;
  @@ -278,13 +281,13 @@
   				    &dtab)) != 0) {
   					dbenv->err(dbenv, ret,
   					    "callback: initialization");
  -					goto shutdown;
  +					goto err;
   				}
   			}
   		}
   
  -		ret = __db_dispatch(dbenv->env,
  -		    &dtab, &data, &key, DB_TXN_PRINT, NULL);
  +		ret = __db_dispatch(env,
  +		    &dtab, &data, &key, DB_TXN_PRINT, (void*)&dblog);
   
   		/*
   		 * XXX
  @@ -294,13 +297,23 @@
   
   		if (ret != 0) {
   			dbenv->err(dbenv, ret, "tx: dispatch");
  -			goto shutdown;
  +			goto err;
   		}
   	}
   
   	if (0) {
  -shutdown:	exitval = 1;
  +err:		exitval = 1;
   	}
  +
  +	/*
  +	 * Call __db_close to free the dummy DB handles that were used
  +	 * by the print routines.
  +	 */
  +	for (i = 0; i < dblog.dbentry_cnt; i++)
  +		if (dblog.dbentry[i].dbp != NULL)
  +			(void)__db_close(dblog.dbentry[i].dbp, NULL, DB_NOSYNC);
  +	if (env != NULL && dblog.dbentry != NULL)
  +		__os_free(env, dblog.dbentry);
   	if (logc != NULL && (ret = logc->close(logc, 0)) != 0)
   		exitval = 1;
   
  @@ -362,41 +375,35 @@
   	if ((ret = __txn_init_print(env, dtabp)) != 0)
   		goto err;
   
  -	switch (version) {
  -	case DB_LOGVERSION:
  -		ret = 0;
  -		break;
  -
  +	if (version == DB_LOGVERSION)
  +		goto done;
  +	if ((ret = db_printlog_env_init_print_48(env, dtabp)) != 0)
  +		goto err;
  +	if (version >= DB_LOGVERSION_48)
  +		goto done;
  +	if ((ret = db_printlog_env_init_print_47(env, dtabp)) != 0)
  +		goto err;
  +	if (version == DB_LOGVERSION_47)
  +		goto done;
   	/*
  -	 * There are no log record/recovery differences between
  -	 * 4.4 and 4.5.  The log version changed due to checksum.
  -	 * There are no log recovery differences between
  -	 * 4.5 and 4.6.  The name of the rep_gen in txn_checkpoint
  -	 * changed (to spare, since we don't use it anymore).
  -	 */
  -	case DB_LOGVERSION_48:
  -		if ((ret = __db_add_recovery_int(env, dtabp,
  -		    __db_pg_sort_44_print, DB___db_pg_sort_44)) != 0)
  -			goto err;
  -		break;
  -	case DB_LOGVERSION_47:
  -	case DB_LOGVERSION_46:
  -	case DB_LOGVERSION_45:
  -	case DB_LOGVERSION_44:
  -		ret = db_printlog_env_init_print_47(env, dtabp);
  -		break;
  -	case DB_LOGVERSION_43:
  -		ret = db_printlog_env_init_print_43(env, dtabp);
  -		break;
  -	case DB_LOGVERSION_42:
  -		ret = db_printlog_env_init_print_42(env, dtabp);
  -		break;
  -	default:
  -		env->dbenv->errx(env->dbenv,
  -		    "Unknown version %lu", (u_long)version);
  +	 * There are no log record/recovery differences between 4.4 and 4.5.
  +	 * The log version changed due to checksum.  There are no log recovery
  +	 * differences between 4.5 and 4.6.  The name of the rep_gen in
  +	 * txn_checkpoint changed (to spare, since we don't use it anymore).
  +	 */
  +	if (version >= DB_LOGVERSION_44)
  +		goto done;
  +	if ((ret = db_printlog_env_init_print_43(env, dtabp)) != 0)
  +		goto err;
  +	if (version == DB_LOGVERSION_43)
  +		goto done;
  +	if (version != DB_LOGVERSION_42) {
  +		__db_errx(env, "Unknown version %lu", (u_long)version);
   		ret = EINVAL;
  -		break;
  +		goto err;
   	}
  +	ret = db_printlog_env_init_print_42(env, dtabp);
  +done:
   err:	return (ret);
   }
   
  @@ -408,9 +415,6 @@
   	int ret;
   
   	if ((ret = __db_add_recovery_int(env, dtabp,
  -	   __bam_split_42_print, DB___bam_split_42)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
   	    __db_relink_42_print, DB___db_relink_42)) != 0)
   		goto err;
   	if ((ret = __db_add_recovery_int(env, dtabp,
  @@ -433,24 +437,6 @@
   	if ((ret = __db_add_recovery_int(env, dtabp,
   	    __txn_ckp_42_print, DB___txn_ckp_42)) != 0)
   		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __txn_regop_42_print, DB___txn_regop_42)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __fop_create_42_print, DB___fop_create_42)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __fop_write_42_print, DB___fop_write_42)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __fop_rename_42_print, DB___fop_rename_42)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __fop_rename_42_print, DB___fop_rename_noundo_46)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __txn_xa_regop_42_print, DB___txn_xa_regop_42)) != 0)
  -		goto err;
   err:
   	return (ret);
   }
  @@ -465,9 +451,6 @@
   	if ((ret = __db_add_recovery_int(env, dtabp,
   	    __bam_relink_43_print, DB___bam_relink_43)) != 0)
   		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	   __bam_split_42_print, DB___bam_split_42)) != 0)
  -		goto err;
   	/*
   	 * We want to use the 4.2-based txn_regop record.
   	 */
  @@ -475,21 +458,6 @@
   	    __txn_regop_42_print, DB___txn_regop_42)) != 0)
   		goto err;
   
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __fop_create_42_print, DB___fop_create_42)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __fop_write_42_print, DB___fop_write_42)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __fop_rename_42_print, DB___fop_rename_42)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __fop_rename_42_print, DB___fop_rename_noundo_46)) != 0)
  -		goto err;
  -	if ((ret = __db_add_recovery_int(env, dtabp,
  -	    __txn_xa_regop_42_print, DB___txn_xa_regop_42)) != 0)
  -		goto err;
   err:
   	return (ret);
   }
  @@ -535,6 +503,37 @@
   }
   
   int
  +db_printlog_env_init_print_48(env, dtabp)
  +	ENV *env;
  +	DB_DISTAB *dtabp;
  +{
  +	int ret;
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_pg_sort_44_print, DB___db_pg_sort_44)) != 0)
  +		goto err;
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_addrem_42_print, DB___db_addrem_42)) != 0)
  +		goto err;
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_big_42_print, DB___db_big_42)) != 0)
  +		goto err;
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __bam_split_48_print, DB___bam_split_48)) != 0)
  +		goto err;
  +#ifdef HAVE_HASH
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __ham_insdel_42_print, DB___ham_insdel_42)) != 0)
  +		goto err;
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __ham_replace_42_print, DB___ham_replace_42)) != 0)
  +		goto err;
  +#endif
  +
  +err:
  +	return (ret);
  +}
  +
  +int
   db_printlog_usage()
   {
   	fprintf(stderr, "usage: %s %s\n", progname,
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_printlog/db_printlog20.wpj
  ============================================================================
  $ cvs diff -u -r1.3 -r1.3.4.1 db_printlog20.wpj
  --- db/build_vxworks/db_printlog/db_printlog20.wpj	27 May 2008 11:20:12 -0000	1.3
  +++ db/build_vxworks/db_printlog/db_printlog20.wpj	23 Aug 2010 13:36:30 -0000	1.3.4.1
  @@ -134,151 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_objects
  -btree_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_objects
  -crdel_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_objects
  -db_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_db_printlog.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_printlog.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_printlog.c_objects
  -db_printlog.o
  -<END>
  -
  -<BEGIN> FILE_db_printlog.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_objects
  -dbreg_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_objects
  -fileops_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_objects
  -hash_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_objects
  -qam_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_objects
  -txn_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/../../btree/btree_autop.c \
  -$(PRJ_DIR)/../../db/crdel_autop.c \
  -$(PRJ_DIR)/../../db/db_autop.c \
  -$(PRJ_DIR)/db_printlog.c \
  -$(PRJ_DIR)/../../dbreg/dbreg_autop.c \
  -$(PRJ_DIR)/../../fileops/fileops_autop.c \
  -$(PRJ_DIR)/../../hash/hash_autop.c \
  -$(PRJ_DIR)/../../qam/qam_autop.c \
  -$(PRJ_DIR)/../../txn/txn_autop.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_printlog/db_printlog22.wpj
  ============================================================================
  $ cvs diff -u -r1.3 -r1.3.4.1 db_printlog22.wpj
  --- db/build_vxworks/db_printlog/db_printlog22.wpj	27 May 2008 11:20:12 -0000	1.3
  +++ db/build_vxworks/db_printlog/db_printlog22.wpj	23 Aug 2010 13:36:30 -0000	1.3.4.1
  @@ -168,151 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_objects
  -btree_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_objects
  -crdel_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_objects
  -db_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_db_printlog.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_printlog.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_printlog.c_objects
  -db_printlog.o
  -<END>
  -
  -<BEGIN> FILE_db_printlog.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_objects
  -dbreg_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_objects
  -fileops_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_objects
  -hash_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_objects
  -qam_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_tool
  -C/C++ compiler
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_objects
  -txn_autop.o
  -<END>
  -
  -<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/../../btree/btree_autop.c \
  -$(PRJ_DIR)/../../db/crdel_autop.c \
  -$(PRJ_DIR)/../../db/db_autop.c \
  -$(PRJ_DIR)/db_printlog.c \
  -$(PRJ_DIR)/../../dbreg/dbreg_autop.c \
  -$(PRJ_DIR)/../../fileops/fileops_autop.c \
  -$(PRJ_DIR)/../../hash/hash_autop.c \
  -$(PRJ_DIR)/../../qam/qam_autop.c \
  -$(PRJ_DIR)/../../txn/txn_autop.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_recover/db_recover.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_recover.c
  --- db/build_vxworks/db_recover/db_recover.c	16 Sep 2009 19:34:41 -0000	1.11
  +++ db/build_vxworks/db_recover/db_recover.c	23 Aug 2010 13:36:30 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   void db_recover_feedback __P((DB_ENV *, int, int));
  @@ -127,13 +127,13 @@
   	if (timestamp &&
   	    (ret = dbenv->set_tx_timestamp(dbenv, &timestamp)) != 0) {
   		dbenv->err(dbenv, ret, "DB_ENV->set_timestamp");
  -		goto shutdown;
  +		goto err;
   	}
   
   	if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
   	    passwd, DB_ENCRYPT_AES)) != 0) {
   		dbenv->err(dbenv, ret, "set_passwd");
  -		goto shutdown;
  +		goto err;
   	}
   
   	/*
  @@ -155,11 +155,11 @@
   	LF_SET(retain_env ? DB_INIT_LOCK : DB_PRIVATE);
   	if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0) {
   		dbenv->err(dbenv, ret, "DB_ENV->open");
  -		goto shutdown;
  +		goto err;
   	}
   
   	if (0) {
  -shutdown:	exitval = 1;
  +err:		exitval = 1;
   	}
   
   	/* Flush to the next line of the output device. */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_recover/db_recover20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_recover20.wpj
  --- db/build_vxworks/db_recover/db_recover20.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_recover/db_recover20.wpj	23 Aug 2010 13:36:30 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_recover.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_recover.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_recover.c_objects
  -db_recover.o
  -<END>
  -
  -<BEGIN> FILE_db_recover.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_recover.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_recover/db_recover22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_recover22.wpj
  --- db/build_vxworks/db_recover/db_recover22.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_recover/db_recover22.wpj	23 Aug 2010 13:36:30 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_recover.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_recover.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_recover.c_objects
  -db_recover.o
  -<END>
  -
  -<BEGIN> FILE_db_recover.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_recover.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_stat/db_stat.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_stat.c
  --- db/build_vxworks/db_stat/db_stat.c	16 Sep 2009 19:34:41 -0000	1.11
  +++ db/build_vxworks/db_stat/db_stat.c	23 Aug 2010 13:36:30 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   typedef enum { T_NOTSET, T_DB,
  @@ -299,10 +299,19 @@
   		dbenv->set_errfile(dbenv, NULL);
   		ret = dbp->open(dbp, NULL, db, subdb, DB_UNKNOWN, 0, 0);
   		dbenv->set_errfile(dbenv, stderr);
  -		if (ret != 0 && (ret = dbp->open(
  -		    dbp, NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) {
  -			dbenv->err(dbenv, ret, "DB->open: %s", db);
  -			goto err;
  +		if (ret != 0) {
  +			/* Handles cannot be reused after a failed DB->open. */
  +			(void)dbp->close(dbp, 0);
  +			if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
  +				dbenv->err(dbenv, ret, "db_create");
  +				goto err;
  +			}
  +
  +			if ((ret = dbp->open(dbp,
  +			    NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) {
  +				dbenv->err(dbenv, ret, "DB->open: %s", db);
  +				goto err;
  +			}
   		}
   
   		/* Check if cache is too small for this DB's pagesize. */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_stat/db_stat20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_stat20.wpj
  --- db/build_vxworks/db_stat/db_stat20.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_stat/db_stat20.wpj	23 Aug 2010 13:36:30 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_stat.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_stat.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_stat.c_objects
  -db_stat.o
  -<END>
  -
  -<BEGIN> FILE_db_stat.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_stat.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_stat/db_stat22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_stat22.wpj
  --- db/build_vxworks/db_stat/db_stat22.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_stat/db_stat22.wpj	23 Aug 2010 13:36:30 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_stat.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_stat.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_stat.c_objects
  -db_stat.o
  -<END>
  -
  -<BEGIN> FILE_db_stat.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_stat.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_upgrade/db_upgrade.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_upgrade.c
  --- db/build_vxworks/db_upgrade/db_upgrade.c	16 Sep 2009 19:34:41 -0000	1.11
  +++ db/build_vxworks/db_upgrade/db_upgrade.c	23 Aug 2010 13:36:31 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   int db_upgrade_main __P((int, char *[]));
  @@ -107,7 +107,7 @@
   	if ((ret = db_env_create(&dbenv, 0)) != 0) {
   		fprintf(stderr, "%s: db_env_create: %s\n",
   		    progname, db_strerror(ret));
  -		goto shutdown;
  +		goto err;
   	}
   
   	dbenv->set_errfile(dbenv, stderr);
  @@ -116,18 +116,18 @@
   	if (nflag) {
   		if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) {
   			dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING");
  -			goto shutdown;
  +			goto err;
   		}
   		if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) {
   			dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC");
  -			goto shutdown;
  +			goto err;
   		}
   	}
   
   	if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
   	    passwd, DB_ENCRYPT_AES)) != 0) {
   		dbenv->err(dbenv, ret, "set_passwd");
  -		goto shutdown;
  +		goto err;
   	}
   
   	/*
  @@ -140,14 +140,14 @@
   	    DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON,
   	    0)) != 0)) {
   		dbenv->err(dbenv, ret, "DB_ENV->open");
  -		goto shutdown;
  +		goto err;
   	}
   
   	for (; !__db_util_interrupted() && argv[0] != NULL; ++argv) {
   		if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
   			fprintf(stderr,
   			    "%s: db_create: %s\n", progname, db_strerror(ret));
  -			goto shutdown;
  +			goto err;
   		}
   		dbp->set_errfile(dbp, stderr);
   		dbp->set_errpfx(dbp, progname);
  @@ -158,7 +158,7 @@
   			ret = t_ret;
   		}
   		if (ret != 0)
  -			goto shutdown;
  +			goto err;
   		/*
   		 * People get concerned if they don't see a success message.
   		 * If verbose is set, give them one.
  @@ -169,7 +169,7 @@
   	}
   
   	if (0) {
  -shutdown:	exitval = 1;
  +err:		exitval = 1;
   	}
   	if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
   		exitval = 1;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_upgrade/db_upgrade20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_upgrade20.wpj
  --- db/build_vxworks/db_upgrade/db_upgrade20.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_upgrade/db_upgrade20.wpj	23 Aug 2010 13:36:31 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_upgrade.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_upgrade.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_upgrade.c_objects
  -db_upgrade.o
  -<END>
  -
  -<BEGIN> FILE_db_upgrade.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_upgrade.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_upgrade/db_upgrade22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_upgrade22.wpj
  --- db/build_vxworks/db_upgrade/db_upgrade22.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_upgrade/db_upgrade22.wpj	23 Aug 2010 13:36:31 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_upgrade.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_upgrade.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_upgrade.c_objects
  -db_upgrade.o
  -<END>
  -
  -<BEGIN> FILE_db_upgrade.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_upgrade.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_verify/db_verify.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_verify.c
  --- db/build_vxworks/db_verify/db_verify.c	16 Sep 2009 19:34:42 -0000	1.11
  +++ db/build_vxworks/db_verify/db_verify.c	23 Aug 2010 13:36:31 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,7 @@
   
   #ifndef lint
   static const char copyright[] =
  -    "Copyright (c) 1996-2009 Oracle.  All rights reserved.\n";
  +    "Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.\n";
   #endif
   
   int db_verify_main __P((int, char *[]));
  @@ -113,7 +113,7 @@
   retry:	if ((ret = db_env_create(&dbenv, 0)) != 0) {
   		fprintf(stderr,
   		    "%s: db_env_create: %s\n", progname, db_strerror(ret));
  -		goto shutdown;
  +		goto err;
   	}
   
   	if (!quiet) {
  @@ -124,18 +124,18 @@
   	if (nflag) {
   		if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) {
   			dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING");
  -			goto shutdown;
  +			goto err;
   		}
   		if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) {
   			dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC");
  -			goto shutdown;
  +			goto err;
   		}
   	}
   
   	if (passwd != NULL &&
   	    (ret = dbenv->set_encrypt(dbenv, passwd, DB_ENCRYPT_AES)) != 0) {
   		dbenv->err(dbenv, ret, "set_passwd");
  -		goto shutdown;
  +		goto err;
   	}
   	/*
   	 * Attach to an mpool if it exists, but if that fails, attach to a
  @@ -149,7 +149,7 @@
   			if ((ret =
   			    dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) {
   				dbenv->err(dbenv, ret, "set_cachesize");
  -				goto shutdown;
  +				goto err;
   			}
   			private = 1;
   			ret = dbenv->open(dbenv, home, DB_CREATE |
  @@ -157,7 +157,7 @@
   		}
   		if (ret != 0) {
   			dbenv->err(dbenv, ret, "DB_ENV->open");
  -			goto shutdown;
  +			goto err;
   		}
   	}
   
  @@ -169,14 +169,14 @@
   	for (; !__db_util_interrupted() && argv[0] != NULL; ++argv) {
   		if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
   			dbenv->err(dbenv, ret, "%s: db_create", progname);
  -			goto shutdown;
  +			goto err;
   		}
   
   		if (TXN_ON(dbenv->env) &&
   		    (ret = dbp->set_flags(dbp, DB_TXN_NOT_DURABLE)) != 0) {
   			dbenv->err(
   			    dbenv, ret, "%s: db_set_flags", progname);
  -			goto shutdown;
  +			goto err;
   		}
   
   		/*
  @@ -191,14 +191,14 @@
   			if ((ret = db_create(&dbp1, dbenv, 0)) != 0) {
   				dbenv->err(
   				    dbenv, ret, "%s: db_create", progname);
  -				goto shutdown;
  +				goto err;
   			}
   
   			if (TXN_ON(dbenv->env) && (ret =
   			    dbp1->set_flags(dbp1, DB_TXN_NOT_DURABLE)) != 0) {
   				dbenv->err(
   				    dbenv, ret, "%s: db_set_flags", progname);
  -				goto shutdown;
  +				goto err;
   			}
   
   			ret = dbp1->open(dbp1,
  @@ -231,11 +231,14 @@
   		ret = dbp->verify(dbp, argv[0], NULL, NULL, flags);
   		dbp = NULL;
   		if (ret != 0)
  -			goto shutdown;
  +			exitval = 1;
  +		if (!quiet)
  +			printf("Verification of %s %s.\n",
  +				argv[0], ret == 0 ? "succeeded" : "failed");
   	}
   
   	if (0) {
  -shutdown:	exitval = 1;
  +err:		exitval = 1;
   	}
   
   	if (dbp != NULL && (ret = dbp->close(dbp, 0)) != 0) {
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_verify/db_verify20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_verify20.wpj
  --- db/build_vxworks/db_verify/db_verify20.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_verify/db_verify20.wpj	23 Aug 2010 13:36:31 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_db_verify.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_verify.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_verify.c_objects
  -db_verify.o
  -<END>
  -
  -<BEGIN> FILE_db_verify.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_verify.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/db_verify/db_verify22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 db_verify22.wpj
  --- db/build_vxworks/db_verify/db_verify22.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/db_verify/db_verify22.wpj	23 Aug 2010 13:36:31 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_db_verify.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_db_verify.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_db_verify.c_objects
  -db_verify.o
  -<END>
  -
  -<BEGIN> FILE_db_verify.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/db_verify.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/dbdemo/dbdemo.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 dbdemo.c
  --- db/build_vxworks/dbdemo/dbdemo.c	16 Sep 2009 19:34:42 -0000	1.11
  +++ db/build_vxworks/dbdemo/dbdemo.c	23 Aug 2010 13:36:32 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/dbdemo/dbdemo20.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 dbdemo20.wpj
  --- db/build_vxworks/dbdemo/dbdemo20.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/dbdemo/dbdemo20.wpj	23 Aug 2010 13:36:32 -0000	1.2.10.1
  @@ -134,23 +134,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.0
   <END>
  -<BEGIN> FILE_dbdemo.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_dbdemo.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_dbdemo.c_objects
  -dbdemo.o
  -<END>
  -
  -<BEGIN> FILE_dbdemo.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/dbdemo.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_vxworks/dbdemo/dbdemo22.wpj
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.10.1 dbdemo22.wpj
  --- db/build_vxworks/dbdemo/dbdemo22.wpj	1 Oct 2006 20:18:48 -0000	1.2
  +++ db/build_vxworks/dbdemo/dbdemo22.wpj	23 Aug 2010 13:36:32 -0000	1.2.10.1
  @@ -168,23 +168,7 @@
   <BEGIN> CORE_INFO_VERSION
   2.2
   <END>
  -<BEGIN> FILE_dbdemo.c_dependDone
  -FALSE
  -<END>
  -
  -<BEGIN> FILE_dbdemo.c_dependencies
  -<END>
  -
  -<BEGIN> FILE_dbdemo.c_objects
  -dbdemo.o
  -<END>
  -
  -<BEGIN> FILE_dbdemo.c_tool
  -C/C++ compiler
  -<END>
  -
   <BEGIN> PROJECT_FILES
  -$(PRJ_DIR)/dbdemo.c
   <END>
   
   <BEGIN> userComments
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_wince/db.h
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.2.1 db.h
  --- db/build_wince/db.h	7 Jan 2010 22:02:21 -0000	1.2
  +++ db/build_wince/db.h	23 Aug 2010 13:36:32 -0000	1.2.2.1
  @@ -2,7 +2,7 @@
   /*
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    *
  @@ -57,10 +57,13 @@
   /*
    * Berkeley DB version information.
    */
  -#define	DB_VERSION_MAJOR	4
  -#define	DB_VERSION_MINOR	8
  +#define	DB_VERSION_FAMILY	11
  +#define	DB_VERSION_RELEASE	2
  +#define	DB_VERSION_MAJOR	5
  +#define	DB_VERSION_MINOR	0
   #define	DB_VERSION_PATCH	26
  -#define	DB_VERSION_STRING	"Berkeley DB 4.8.26: (December 18, 2009)"
  +#define	DB_VERSION_STRING	"Berkeley DB 5.0.26: (June 25, 2010)"
  +#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)"
   
   /*
    * !!!
  @@ -206,6 +209,7 @@
   struct __db_txn;	typedef struct __db_txn DB_TXN;
   struct __db_txn_active;	typedef struct __db_txn_active DB_TXN_ACTIVE;
   struct __db_txn_stat;	typedef struct __db_txn_stat DB_TXN_STAT;
  +struct __db_txn_token;	typedef struct __db_txn_token DB_TXN_TOKEN;
   struct __db_txnmgr;	typedef struct __db_txnmgr DB_TXNMGR;
   struct __dbc;		typedef struct __dbc DBC;
   struct __dbc_internal;	typedef struct __dbc_internal DBC_INTERNAL;
  @@ -214,6 +218,8 @@
   struct __fname;		typedef struct __fname FNAME;
   struct __key_range;	typedef struct __key_range DB_KEY_RANGE;
   struct __mpoolfile;	typedef struct __mpoolfile MPOOLFILE;
  +struct __db_logvrfy_config;
  +typedef struct __db_logvrfy_config DB_LOG_VERIFY_CONFIG;
   
   /*
    * The Berkeley DB API flags are automatically-generated -- the following flag
  @@ -457,7 +463,7 @@
   /*******************************************************
    * Logging.
    *******************************************************/
  -#define	DB_LOGVERSION	16		/* Current log version. */
  +#define	DB_LOGVERSION	17		/* Current log version. */
   #define DB_LOGVERSION_LATCHING 15	/* Log version using latching. */
   #define	DB_LOGCHKSUM	12		/* Check sum headers. */
   #define	DB_LOGOLDVER	8		/* Oldest log version supported. */
  @@ -563,6 +569,39 @@
   #define	DB_SET_TXN_LSNP(txn, blsnp, llsnp)		\
   	((txn)->set_txn_lsnp(txn, blsnp, llsnp))
   
  +/*
  + * Definition of the structure which specifies marshalling of log records.
  + */
  +typedef enum {
  +	LOGREC_Done,
  +	LOGREC_ARG,
  +	LOGREC_HDR,
  +	LOGREC_DATA,
  +	LOGREC_DB,
  +	LOGREC_DBOP,
  +	LOGREC_DBT,
  +	LOGREC_LOCKS,
  +	LOGREC_OP,
  +	LOGREC_PGDBT,
  +	LOGREC_PGDDBT,
  +	LOGREC_PGLIST,
  +	LOGREC_POINTER,
  +	LOGREC_TIME
  +} log_rec_type_t;
  +
  +typedef const struct __log_rec_spec {
  +	log_rec_type_t	type;
  +	u_int32_t	offset;
  +	const char 	*name;
  +	const char	fmt[4];
  +} DB_LOG_RECSPEC;
  +
  +/*
  + * Size of a DBT in a log record.
  + */
  +#define	LOG_DBT_SIZE(dbt)						\
  +    (sizeof(u_int32_t) + ((dbt) == NULL ? 0 : (dbt)->size))
  +
   /*******************************************************
    * Shared buffer cache (mpool).
    *******************************************************/
  @@ -742,7 +781,8 @@
   	DB_TXN_FORWARD_ROLL=4,		/* Public. */
   	DB_TXN_OPENFILES=5,		/* Internal. */
   	DB_TXN_POPENFILES=6,		/* Internal. */
  -	DB_TXN_PRINT=7			/* Public. */
  +	DB_TXN_PRINT=7,			/* Public. */
  +	DB_TXN_LOG_VERIFY=8		/* Internal. */
   } db_recops;
   
   /*
  @@ -818,6 +858,17 @@
   		struct __db_txn **tqe_prev;
   	} klinks;
   
  +	/*
  +	 * !!!
  +	 * Explicit representations of structures from queue.h.
  +	 * TAILQ_HEAD(__my_cursors, __dbc) my_cursors;
  +	 */
  +	struct __my_cursors {
  +		struct __dbc *tqh_first;
  +		struct __dbc **tqh_last;
  +	} my_cursors;
  +
  +	DB_TXN_TOKEN	*token_buffer;	/* User's commit token buffer. */
   	void	*api_internal;		/* C++ API private. */
   	void	*xml_internal;		/* XML API private. */
   
  @@ -828,9 +879,12 @@
   	int	  (*commit) __P((DB_TXN *, u_int32_t));
   	int	  (*discard) __P((DB_TXN *, u_int32_t));
   	int	  (*get_name) __P((DB_TXN *, const char **));
  +	int	  (*get_priority) __P((DB_TXN *, u_int32_t *));
   	u_int32_t (*id) __P((DB_TXN *));
   	int	  (*prepare) __P((DB_TXN *, u_int8_t *));
  +	int	  (*set_commit_token) __P((DB_TXN *, DB_TXN_TOKEN *));
   	int	  (*set_name) __P((DB_TXN *, const char *));
  +	int	  (*set_priority) __P((DB_TXN *, u_int32_t));
   	int	  (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t));
   	/* DB_TXN PUBLIC HANDLE LIST END */
   
  @@ -838,21 +892,24 @@
   	void	  (*set_txn_lsnp) __P((DB_TXN *txn, DB_LSN **, DB_LSN **));
   	/* DB_TXN PRIVATE HANDLE LIST END */
   
  -#define	TXN_CHILDCOMMIT		0x0001	/* Txn has committed. */
  -#define	TXN_CDSGROUP		0x0002	/* CDS group handle. */
  -#define	TXN_COMPENSATE		0x0004	/* Compensating transaction. */
  -#define	TXN_DEADLOCK		0x0008	/* Txn has deadlocked. */
  -#define	TXN_LOCKTIMEOUT		0x0010	/* Txn has a lock timeout. */
  -#define	TXN_MALLOC		0x0020	/* Structure allocated by TXN system. */
  -#define	TXN_NOSYNC		0x0040	/* Do not sync on prepare and commit. */
  -#define	TXN_NOWAIT		0x0080	/* Do not wait on locks. */
  -#define	TXN_PRIVATE		0x0100	/* Txn owned by cursor.. */
  -#define	TXN_READ_COMMITTED	0x0200	/* Txn has degree 2 isolation. */
  -#define	TXN_READ_UNCOMMITTED	0x0400	/* Txn has degree 1 isolation. */
  -#define	TXN_RESTORED		0x0800	/* Txn has been restored. */
  -#define	TXN_SNAPSHOT		0x1000	/* Snapshot Isolation. */
  -#define	TXN_SYNC		0x2000	/* Write and sync on prepare/commit. */
  -#define	TXN_WRITE_NOSYNC	0x4000	/* Write only on prepare/commit. */
  +#define	TXN_CHILDCOMMIT		0x00001	/* Txn has committed. */
  +#define	TXN_COMPENSATE		0x00002	/* Compensating transaction. */
  +#define	TXN_DEADLOCK		0x00004	/* Txn has deadlocked. */
  +#define	TXN_FAMILY		0x00008	/* Cursors/children are independent. */
  +#define	TXN_IGNORE_LEASE	0x00010	/* Skip lease check at commit time. */
  +#define	TXN_INFAMILY		0x00020	/* Part of a transaction family. */
  +#define	TXN_LOCKTIMEOUT		0x00040	/* Txn has a lock timeout. */
  +#define	TXN_MALLOC		0x00080	/* Structure allocated by TXN system. */
  +#define	TXN_NOSYNC		0x00100	/* Do not sync on prepare and commit. */
  +#define	TXN_NOWAIT		0x00200	/* Do not wait on locks. */
  +#define	TXN_PRIVATE		0x00400	/* Txn owned by cursor. */
  +#define	TXN_READONLY		0x00800	/* CDS group handle. */
  +#define	TXN_READ_COMMITTED	0x01000	/* Txn has degree 2 isolation. */
  +#define	TXN_READ_UNCOMMITTED	0x02000	/* Txn has degree 1 isolation. */
  +#define	TXN_RESTORED		0x04000	/* Txn has been restored. */
  +#define	TXN_SNAPSHOT		0x08000	/* Snapshot Isolation. */
  +#define	TXN_SYNC		0x10000	/* Write and sync on prepare/commit. */
  +#define	TXN_WRITE_NOSYNC	0x20000	/* Write only on prepare/commit. */
   	u_int32_t	flags;
   };
   
  @@ -881,6 +938,8 @@
   	DB_LSN	  read_lsn;		/* Read LSN for MVCC */
   	u_int32_t mvcc_ref;		/* MVCC reference count */
   
  +	u_int32_t priority;		/* Deadlock resolution priority */
  +
   #define	TXN_ABORTED		1
   #define	TXN_COMMITTED		2
   #define	TXN_PREPARED		3
  @@ -913,6 +972,11 @@
   #endif
   };
   
  +#define	DB_TXN_TOKEN_SIZE		20
  +struct __db_txn_token {
  +	u_int8_t buf[DB_TXN_TOKEN_SIZE];
  +};
  +
   /*******************************************************
    * Replication.
    *******************************************************/
  @@ -942,17 +1006,21 @@
   #define	DB_REP_LEASE_TIMEOUT		9	/* Master leases. */
   
   /* Event notification types. */
  -#define	DB_EVENT_NO_SUCH_EVENT		 0 /* out-of-band sentinel value */
  -#define	DB_EVENT_PANIC			 1
  -#define	DB_EVENT_REG_ALIVE		 2
  -#define	DB_EVENT_REG_PANIC		 3
  -#define	DB_EVENT_REP_CLIENT		 4
  +#define	DB_EVENT_PANIC			 0
  +#define	DB_EVENT_REG_ALIVE		 1
  +#define	DB_EVENT_REG_PANIC		 2
  +#define	DB_EVENT_REP_CLIENT		 3
  +#define	DB_EVENT_REP_DUPMASTER		 4
   #define	DB_EVENT_REP_ELECTED		 5
  -#define	DB_EVENT_REP_MASTER		 6
  -#define	DB_EVENT_REP_NEWMASTER		 7
  -#define	DB_EVENT_REP_PERM_FAILED	 8
  -#define	DB_EVENT_REP_STARTUPDONE	 9
  -#define	DB_EVENT_WRITE_FAILED		10
  +#define	DB_EVENT_REP_ELECTION_FAILED	 6
  +#define	DB_EVENT_REP_JOIN_FAILURE	 7
  +#define	DB_EVENT_REP_MASTER		 8
  +#define	DB_EVENT_REP_MASTER_FAILURE	 9
  +#define	DB_EVENT_REP_NEWMASTER		10
  +#define	DB_EVENT_REP_PERM_FAILED	11
  +#define	DB_EVENT_REP_STARTUPDONE	12
  +#define	DB_EVENT_WRITE_FAILED		13
  +#define	DB_EVENT_NO_SUCH_EVENT		 0xffffffff /* OOB sentinel value */
   
   /* Replication Manager site status. */
   struct __db_repmgr_site {
  @@ -960,9 +1028,12 @@
   	char *host;
   	u_int port;
   
  -#define	DB_REPMGR_CONNECTED	0x01
  -#define	DB_REPMGR_DISCONNECTED	0x02
  +#define	DB_REPMGR_CONNECTED	1
  +#define	DB_REPMGR_DISCONNECTED	2
   	u_int32_t status;
  +
  +#define	DB_REPMGR_ISPEER	0x01
  +	u_int32_t flags;
   };
   
   /* Replication statistics. */
  @@ -976,9 +1047,9 @@
   	 * off somewhat (or, on unreasonable architectures under unlucky
   	 * circumstances, garbaged).
   	 */
  -	uintmax_t st_log_queued;	/* Log records currently queued.+ */
   	u_int32_t st_startup_complete;	/* Site completed client sync-up. */
   #ifndef __TEST_DB_NO_STATISTICS
  +	uintmax_t st_log_queued;	/* Log records currently queued.+ */
   	u_int32_t st_status;		/* Current replication status. */
   	DB_LSN st_next_lsn;		/* Next LSN to use or expect. */
   	DB_LSN st_waiting_lsn;		/* LSN we're awaiting, if any. */
  @@ -1060,6 +1131,8 @@
   					   queue length. */
   	uintmax_t st_connection_drop;	/* Existing connections dropped. */
   	uintmax_t st_connect_fail;	/* Failed new connection attempts. */
  +	uintmax_t st_elect_threads;	/* # of active election threads. */
  +	uintmax_t st_max_elect_threads;	/* Max concurrent e-threads ever. */
   };
   
   /*******************************************************
  @@ -1212,27 +1285,29 @@
   #define	DB_LOCK_DEADLOCK	(-30994)/* Deadlock. */
   #define	DB_LOCK_NOTGRANTED	(-30993)/* Lock unavailable. */
   #define	DB_LOG_BUFFER_FULL	(-30992)/* In-memory log buffer full. */
  -#define	DB_NOSERVER		(-30991)/* Server panic return. */
  -#define	DB_NOSERVER_HOME	(-30990)/* Bad home sent to server. */
  -#define	DB_NOSERVER_ID		(-30989)/* Bad ID sent to server. */
  -#define	DB_NOTFOUND		(-30988)/* Key/data pair not found (EOF). */
  -#define	DB_OLD_VERSION		(-30987)/* Out-of-date version. */
  -#define	DB_PAGE_NOTFOUND	(-30986)/* Requested page not found. */
  -#define	DB_REP_DUPMASTER	(-30985)/* There are two masters. */
  -#define	DB_REP_HANDLE_DEAD	(-30984)/* Rolled back a commit. */
  -#define	DB_REP_HOLDELECTION	(-30983)/* Time to hold an election. */
  -#define	DB_REP_IGNORE		(-30982)/* This msg should be ignored.*/
  -#define	DB_REP_ISPERM		(-30981)/* Cached not written perm written.*/
  -#define	DB_REP_JOIN_FAILURE	(-30980)/* Unable to join replication group. */
  -#define	DB_REP_LEASE_EXPIRED	(-30979)/* Master lease has expired. */
  -#define	DB_REP_LOCKOUT		(-30978)/* API/Replication lockout now. */
  -#define	DB_REP_NEWSITE		(-30977)/* New site entered system. */
  -#define	DB_REP_NOTPERM		(-30976)/* Permanent log record not written. */
  -#define	DB_REP_UNAVAIL		(-30975)/* Site cannot currently be reached. */
  -#define	DB_RUNRECOVERY		(-30974)/* Panic return. */
  -#define	DB_SECONDARY_BAD	(-30973)/* Secondary index corrupt. */
  -#define	DB_VERIFY_BAD		(-30972)/* Verify failed; bad format. */
  -#define	DB_VERSION_MISMATCH	(-30971)/* Environment version mismatch. */
  +#define	DB_LOG_VERIFY_BAD	(-30991)/* Log verification failed. */
  +#define	DB_NOSERVER		(-30990)/* Server panic return. */
  +#define	DB_NOSERVER_HOME	(-30989)/* Bad home sent to server. */
  +#define	DB_NOSERVER_ID		(-30988)/* Bad ID sent to server. */
  +#define	DB_NOTFOUND		(-30987)/* Key/data pair not found (EOF). */
  +#define	DB_OLD_VERSION		(-30986)/* Out-of-date version. */
  +#define	DB_PAGE_NOTFOUND	(-30985)/* Requested page not found. */
  +#define	DB_REP_DUPMASTER	(-30984)/* There are two masters. */
  +#define	DB_REP_HANDLE_DEAD	(-30983)/* Rolled back a commit. */
  +#define	DB_REP_HOLDELECTION	(-30982)/* Time to hold an election. */
  +#define	DB_REP_IGNORE		(-30981)/* This msg should be ignored.*/
  +#define	DB_REP_ISPERM		(-30980)/* Cached not written perm written.*/
  +#define	DB_REP_JOIN_FAILURE	(-30979)/* Unable to join replication group. */
  +#define	DB_REP_LEASE_EXPIRED	(-30978)/* Master lease has expired. */
  +#define	DB_REP_LOCKOUT		(-30977)/* API/Replication lockout now. */
  +#define	DB_REP_NEWSITE		(-30976)/* New site entered system. */
  +#define	DB_REP_NOTPERM		(-30975)/* Permanent log record not written. */
  +#define	DB_REP_UNAVAIL		(-30974)/* Site cannot currently be reached. */
  +#define	DB_RUNRECOVERY		(-30973)/* Panic return. */
  +#define	DB_SECONDARY_BAD	(-30972)/* Secondary index corrupt. */
  +#define	DB_TIMEOUT		(-30971)/* Timed out on read consistency. */
  +#define	DB_VERIFY_BAD		(-30970)/* Verify failed; bad format. */
  +#define	DB_VERSION_MISMATCH	(-30969)/* Environment version mismatch. */
   
   /* DB (private) error return codes. */
   #define	DB_ALREADY_ABORTED	(-30899)
  @@ -1240,17 +1315,14 @@
   #define	DB_EVENT_NOT_HANDLED	(-30897)/* Forward event to application. */
   #define	DB_NEEDSPLIT		(-30896)/* Page needs to be split. */
   #define	DB_REP_BULKOVF		(-30895)/* Rep bulk buffer overflow. */
  -#define	DB_REP_EGENCHG		(-30894)/* Egen changed while in election. */
  -#define	DB_REP_LOGREADY		(-30893)/* Rep log ready for recovery. */
  -#define	DB_REP_NEWMASTER	(-30892)/* We have learned of a new master. */
  -#define	DB_REP_PAGEDONE		(-30891)/* This page was already done. */
  -#define	DB_REP_PAGELOCKED	(-30890)/* Page we want is locked. */
  -#define	DB_SURPRISE_KID		(-30889)/* Child commit where parent
  +#define	DB_REP_LOGREADY		(-30894)/* Rep log ready for recovery. */
  +#define	DB_REP_NEWMASTER	(-30893)/* We have learned of a new master. */
  +#define	DB_REP_PAGEDONE		(-30892)/* This page was already done. */
  +#define	DB_SURPRISE_KID		(-30891)/* Child commit where parent
   					   didn't know it was a parent. */
  -#define	DB_SWAPBYTES		(-30888)/* Database needs byte swapping. */
  -#define	DB_TIMEOUT		(-30887)/* Timed out waiting for election. */
  -#define	DB_TXN_CKP		(-30886)/* Encountered ckp record in log. */
  -#define	DB_VERIFY_FATAL		(-30885)/* DB->verify cannot proceed. */
  +#define	DB_SWAPBYTES		(-30890)/* Database needs byte swapping. */
  +#define	DB_TXN_CKP		(-30889)/* Encountered ckp record in log. */
  +#define	DB_VERIFY_FATAL		(-30888)/* DB->verify cannot proceed. */
   
   /* Database handle. */
   struct __db {
  @@ -1572,6 +1644,9 @@
   	int  (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
   	int  (*stored_close) __P((DB *, u_int32_t));
   
  +	/* Alternative handle close function, used by C++ API. */
  +	int  (*alt_close) __P((DB *, u_int32_t));
  +
   #define	DB_OK_BTREE	0x01
   #define	DB_OK_HASH	0x02
   #define	DB_OK_QUEUE	0x04
  @@ -1713,7 +1788,7 @@
   		else {							\
   			writedata = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = __off;					\
  -			__p[-1] = (writedlen);				\
  +			__p[-1] = (u_int32_t)(writedlen);		\
   			__p[-2] = (u_int32_t)-1;			\
   			pointer = __p - 2;				\
   		}							\
  @@ -1742,12 +1817,12 @@
   		} else {						\
   			writekey = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = __off;					\
  -			__p[-1] = (writeklen);				\
  +			__p[-1] = (u_int32_t)(writeklen);		\
   			__p -= 2;					\
  -			__off += (writeklen);				\
  +			__off += (u_int32_t)(writeklen);		\
   			writedata = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = __off;					\
  -			__p[-1] = (writedlen);				\
  +			__p[-1] = (u_int32_t)(writedlen);		\
   			__p[-2] = (u_int32_t)-1;			\
   			pointer = __p - 2;				\
   		}							\
  @@ -1787,7 +1862,7 @@
   			writedata = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = (u_int32_t)(recno);			\
   			__p[-1] = __off;				\
  -			__p[-2] = (writedlen);				\
  +			__p[-2] = (u_int32_t)(writedlen);		\
   			__p[-3] = 0;					\
   			pointer = __p - 3;				\
   		}							\
  @@ -1829,6 +1904,18 @@
   	} links;
   
   	/*
  +	 * Cursor queue of the owning transaction.
  +	 *
  +	 * !!!
  +	 * Explicit representations of structures from queue.h.
  +	 * TAILQ_ENTRY(__dbc) txn_cursors;
  +	 */
  +	struct {
  +		DBC *tqe_next;	/* next element */
  +		DBC **tqe_prev;	/* address of previous next element */
  +	} txn_cursors;
  +
  +	/*
   	 * The DBT *'s below are used by the cursor routines to return
   	 * data to the user when DBT flags indicate that DB should manage
   	 * the returned memory.  They point at a DBT containing the buffer
  @@ -1904,20 +1991,21 @@
   #define	DBC_DONTLOCK		0x00004	/* Don't lock on this cursor. */
   #define	DBC_DOWNREV		0x00008	/* Down rev replication master. */
   #define	DBC_DUPLICATE		0x00010	/* Create a duplicate cursor. */
  -#define	DBC_FROM_DB_GET		0x00020 /* Called from the DB->get() method. */
  -#define	DBC_MULTIPLE		0x00040	/* Return Multiple data. */
  -#define	DBC_MULTIPLE_KEY	0x00080	/* Return Multiple keys and data. */
  -#define	DBC_OPD			0x00100	/* Cursor references off-page dups. */
  -#define	DBC_OWN_LID		0x00200	/* Free lock id on destroy. */
  -#define	DBC_PARTITIONED		0x00400	/* Cursor for a partitioned db. */
  -#define	DBC_READ_COMMITTED	0x00800	/* Cursor has degree 2 isolation. */
  -#define	DBC_READ_UNCOMMITTED	0x01000	/* Cursor has degree 1 isolation. */
  -#define	DBC_RECOVER		0x02000	/* Recovery cursor; don't log/lock. */
  -#define	DBC_RMW			0x04000	/* Acquire write flag in read op. */
  -#define	DBC_TRANSIENT		0x08000	/* Cursor is transient. */
  -#define	DBC_WAS_READ_COMMITTED	0x10000	/* Cursor holds a read commited lock. */
  -#define	DBC_WRITECURSOR		0x20000	/* Cursor may be used to write (CDB). */
  -#define	DBC_WRITER		0x40000	/* Cursor immediately writing (CDB). */
  +#define	DBC_FAMILY		0x00020 /* Part of a locker family. */
  +#define	DBC_FROM_DB_GET		0x00040 /* Called from the DB->get() method. */
  +#define	DBC_MULTIPLE		0x00080	/* Return Multiple data. */
  +#define	DBC_MULTIPLE_KEY	0x00100	/* Return Multiple keys and data. */
  +#define	DBC_OPD			0x00200	/* Cursor references off-page dups. */
  +#define	DBC_OWN_LID		0x00400	/* Free lock id on destroy. */
  +#define	DBC_PARTITIONED		0x00800	/* Cursor for a partitioned db. */
  +#define	DBC_READ_COMMITTED	0x01000	/* Cursor has degree 2 isolation. */
  +#define	DBC_READ_UNCOMMITTED	0x02000	/* Cursor has degree 1 isolation. */
  +#define	DBC_RECOVER		0x04000	/* Recovery cursor; don't log/lock. */
  +#define	DBC_RMW			0x08000	/* Acquire write flag in read op. */
  +#define	DBC_TRANSIENT		0x10000	/* Cursor is transient. */
  +#define	DBC_WAS_READ_COMMITTED	0x20000	/* Cursor holds a read commited lock. */
  +#define	DBC_WRITECURSOR		0x40000	/* Cursor may be used to write (CDB). */
  +#define	DBC_WRITER		0x80000	/* Cursor immediately writing (CDB). */
   	u_int32_t flags;
   };
   
  @@ -1959,6 +2047,7 @@
   	db_timeout_t	compact_timeout;	/* Lock timeout. */
   	u_int32_t	compact_pages;		/* Max pages to process. */
   	/* Output Stats. */
  +	u_int32_t	compact_empty_buckets;	/* Empty hash buckets found. */
   	u_int32_t	compact_pages_free;	/* Number of pages freed. */
   	u_int32_t	compact_pages_examine;	/* Number of pages examine. */
   	u_int32_t	compact_levels;		/* Number of levels removed. */
  @@ -2200,6 +2289,7 @@
   	int  (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *));
   	int  (*get_lk_max_objects) __P((DB_ENV *, u_int32_t *));
   	int  (*get_lk_partitions) __P((DB_ENV *, u_int32_t *));
  +	int  (*get_lk_priority) __P((DB_ENV *, u_int32_t, u_int32_t *));
   	int  (*get_mp_max_openfd) __P((DB_ENV *, int *));
   	int  (*get_mp_max_write) __P((DB_ENV *, int *, db_timeout_t *));
   	int  (*get_mp_mmapsize) __P((DB_ENV *, size_t *));
  @@ -2238,9 +2328,15 @@
   	int  (*log_get_config) __P((DB_ENV *, u_int32_t, int *));
   	int  (*log_printf) __P((DB_ENV *, DB_TXN *, const char *, ...));
   	int  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
  +	int  (*log_put_record) __P((DB_ENV *, DB *, DB_TXN *, DB_LSN *,
  +		u_int32_t, u_int32_t, u_int32_t, u_int32_t,
  +		DB_LOG_RECSPEC *, ...));
  +	int  (*log_read_record) __P((DB_ENV *, DB **,
  +		void *, void *, DB_LOG_RECSPEC *, u_int32_t, void **));
   	int  (*log_set_config) __P((DB_ENV *, u_int32_t, int));
   	int  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
   	int  (*log_stat_print) __P((DB_ENV *, u_int32_t));
  +	int  (*log_verify) __P((DB_ENV *, const DB_LOG_VERIFY_CONFIG *));
   	int  (*lsn_reset) __P((DB_ENV *, const char *, u_int32_t));
   	int  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
   	int  (*memp_register) __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_t,
  @@ -2332,6 +2428,7 @@
   	int  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
   	int  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
   	int  (*set_lk_partitions) __P((DB_ENV *, u_int32_t));
  +	int  (*set_lk_priority) __P((DB_ENV *, u_int32_t, u_int32_t));
   	int  (*set_mp_max_openfd) __P((DB_ENV *, int));
   	int  (*set_mp_max_write) __P((DB_ENV *, int, db_timeout_t));
   	int  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
  @@ -2354,6 +2451,8 @@
   	int  (*set_tx_max) __P((DB_ENV *, u_int32_t));
   	int  (*set_tx_timestamp) __P((DB_ENV *, time_t *));
   	int  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
  +	int  (*txn_applied) __P((DB_ENV *,
  +		DB_TXN_TOKEN *, db_timeout_t, u_int32_t));
   	int  (*stat_print) __P((DB_ENV *, u_int32_t));
   	int  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
   	int  (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
  @@ -2370,9 +2469,9 @@
   };
   
   /*
  - * Dispatch structure for recovery and print routines.  Since internal and
  - * external routines take different arguments (ENV versus DB_ENV), we need
  - * something more elaborate than a single pointer and size.
  + * Dispatch structure for recovery, log verification and print routines. Since
  + * internal and external routines take different arguments (ENV versus DB_ENV),
  + * we need something more elaborate than a single pointer and size.
    */
   struct __db_distab {
   	int   (**int_dispatch) __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
  @@ -2381,9 +2480,18 @@
   	size_t	ext_size;
   };
   
  -#ifndef DB_DBM_HSEARCH
  -#define	DB_DBM_HSEARCH	0		/* No historic interfaces by default. */
  -#endif
  +/*
  + * Log verification configuration structure.
  + */
  +struct __db_logvrfy_config {
  +	int continue_after_fail, verbose;
  +	u_int32_t cachesize;
  +	const char *temp_envhome;
  +	const char *dbfile, *dbname;
  +	DB_LSN start_lsn, end_lsn;
  +	time_t start_time, end_time;
  +};
  +
   #if DB_DBM_HSEARCH != 0
   /*******************************************************
    * Dbm/Ndbm historic interfaces.
  @@ -2502,12 +2610,13 @@
   #define	DB_FCNTL_LOCKING			0x00000800
   #define	DB_FLUSH				0x00000001
   #define	DB_FORCE				0x00000001
  +#define	DB_FORCESYNC				0x00000001
   #define	DB_FOREIGN_ABORT			0x00000001
   #define	DB_FOREIGN_CASCADE			0x00000002
   #define	DB_FOREIGN_NULLIFY			0x00000004
   #define	DB_FREELIST_ONLY			0x00000001
   #define	DB_FREE_SPACE				0x00000002
  -#define	DB_IGNORE_LEASE				0x00002000
  +#define	DB_IGNORE_LEASE				0x00001000
   #define	DB_IMMUTABLE_KEY			0x00000002
   #define	DB_INIT_CDB				0x00000040
   #define	DB_INIT_LOCK				0x00000080
  @@ -2531,6 +2640,14 @@
   #define	DB_LOG_IN_MEMORY			0x00000008
   #define	DB_LOG_NOCOPY				0x00000008
   #define	DB_LOG_NOT_DURABLE			0x00000010
  +#define	DB_LOG_VERIFY_CAF			0x00000001
  +#define	DB_LOG_VERIFY_DBFILE			0x00000002
  +#define	DB_LOG_VERIFY_ERR			0x00000004
  +#define	DB_LOG_VERIFY_FORWARD			0x00000008
  +#define	DB_LOG_VERIFY_INTERR			0x00000010
  +#define	DB_LOG_VERIFY_PARTIAL			0x00000020
  +#define	DB_LOG_VERIFY_VERBOSE			0x00000040
  +#define	DB_LOG_VERIFY_WARNING			0x00000080
   #define	DB_LOG_WRNOSYNC				0x00000020
   #define	DB_LOG_ZERO				0x00000010
   #define	DB_MPOOL_CREATE				0x00000001
  @@ -2553,11 +2670,12 @@
   #define	DB_MUTEX_PROCESS_ONLY			0x00000008
   #define	DB_MUTEX_SELF_BLOCK			0x00000010
   #define	DB_MUTEX_SHARED				0x00000020
  +#define	DB_NOERROR				0x00001000
   #define	DB_NOLOCKING				0x00000400
   #define	DB_NOMMAP				0x00000008
   #define	DB_NOORDERCHK				0x00000002
   #define	DB_NOPANIC				0x00000800
  -#define	DB_NO_AUTO_COMMIT			0x00001000
  +#define	DB_NO_AUTO_COMMIT			0x00002000
   #define	DB_ODDFILESIZE				0x00000080
   #define	DB_ORDERCHKONLY				0x00000004
   #define	DB_OVERWRITE				0x00001000
  @@ -2567,7 +2685,7 @@
   #define	DB_PR_PAGE				0x00000010
   #define	DB_PR_RECOVERYTEST			0x00000020
   #define	DB_RDONLY				0x00000400
  -#define	DB_RDWRMASTER				0x00002000
  +#define	DB_RDWRMASTER				0x00004000
   #define	DB_READ_COMMITTED			0x00000400
   #define	DB_READ_UNCOMMITTED			0x00000200
   #define	DB_RECNUM				0x00000040
  @@ -2577,22 +2695,23 @@
   #define	DB_REGISTER				0x00008000
   #define	DB_RENUMBER				0x00000080
   #define	DB_REPMGR_CONF_2SITE_STRICT		0x00000001
  +#define	DB_REPMGR_CONF_ELECTIONS		0x00000002
   #define	DB_REPMGR_PEER				0x00000001
   #define	DB_REP_ANYWHERE				0x00000001
   #define	DB_REP_CLIENT				0x00000001
  -#define	DB_REP_CONF_BULK			0x00000002
  -#define	DB_REP_CONF_DELAYCLIENT			0x00000004
  -#define	DB_REP_CONF_INMEM			0x00000008
  -#define	DB_REP_CONF_LEASE			0x00000010
  -#define	DB_REP_CONF_NOAUTOINIT			0x00000020
  -#define	DB_REP_CONF_NOWAIT			0x00000040
  +#define	DB_REP_CONF_AUTOINIT			0x00000004
  +#define	DB_REP_CONF_BULK			0x00000008
  +#define	DB_REP_CONF_DELAYCLIENT			0x00000010
  +#define	DB_REP_CONF_INMEM			0x00000020
  +#define	DB_REP_CONF_LEASE			0x00000040
  +#define	DB_REP_CONF_NOWAIT			0x00000080
   #define	DB_REP_ELECTION				0x00000004
   #define	DB_REP_MASTER				0x00000002
   #define	DB_REP_NOBUFFER				0x00000002
   #define	DB_REP_PERMANENT			0x00000004
   #define	DB_REP_REREQUEST			0x00000008
   #define	DB_REVSPLITOFF				0x00000100
  -#define	DB_RMW					0x00001000
  +#define	DB_RMW					0x00002000
   #define	DB_RPCCLIENT				0x00000001
   #define	DB_SALVAGE				0x00000040
   #define	DB_SA_SKIPFIRSTKEY			0x00000080
  @@ -2628,13 +2747,14 @@
   #define	DB_SYSTEM_MEM				0x00010000
   #define	DB_THREAD				0x00000010
   #define	DB_TIME_NOTGRANTED			0x00008000
  -#define	DB_TRUNCATE				0x00004000
  +#define	DB_TRUNCATE				0x00008000
  +#define	DB_TXN_FAMILY				0x00000008
   #define	DB_TXN_NOSYNC				0x00000001
   #define	DB_TXN_NOT_DURABLE			0x00000002
   #define	DB_TXN_NOWAIT				0x00000010
   #define	DB_TXN_SNAPSHOT				0x00000002
   #define	DB_TXN_SYNC				0x00000004
  -#define	DB_TXN_WAIT				0x00000008
  +#define	DB_TXN_WAIT				0x00000040
   #define	DB_TXN_WRITE_NOSYNC			0x00000020
   #define	DB_UNREF				0x00020000
   #define	DB_UPGRADE				0x00000001
  @@ -2653,13 +2773,14 @@
   #define	DB_VERB_REP_MISC			0x00000400
   #define	DB_VERB_REP_MSGS			0x00000800
   #define	DB_VERB_REP_SYNC			0x00001000
  -#define	DB_VERB_REP_TEST			0x00002000
  -#define	DB_VERB_WAITSFOR			0x00004000
  +#define	DB_VERB_REP_SYSTEM			0x00002000
  +#define	DB_VERB_REP_TEST			0x00004000
  +#define	DB_VERB_WAITSFOR			0x00008000
   #define	DB_VERIFY				0x00000002
   #define	DB_VERIFY_PARTITION			0x00040000
   #define	DB_WRITECURSOR				0x00000008
   #define	DB_WRITELOCK				0x00000010
  -#define	DB_WRITEOPEN				0x00008000
  +#define	DB_WRITEOPEN				0x00010000
   #define	DB_YIELDCPU				0x00010000
   
   /* DO NOT EDIT: automatically built by dist/s_include. */
  @@ -2695,6 +2816,7 @@
   int db_env_set_func_yield __P((int (*)(u_long, u_long)));
   int db_env_create __P((DB_ENV **, u_int32_t));
   char *db_version __P((int *, int *, int *));
  +char *db_full_version __P((int *, int *, int *, int *, int *));
   int log_compare __P((const DB_LSN *, const DB_LSN *));
   int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
   #if DB_DBM_HSEARCH != 0
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_wince/db_config.h
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.2.1 db_config.h
  --- db/build_wince/db_config.h	7 Jan 2010 22:02:21 -0000	1.2
  +++ db/build_wince/db_config.h	23 Aug 2010 13:36:32 -0000	1.2.2.1
  @@ -2,6 +2,9 @@
   /* Define to 1 if you want to build a version for running the test suite. */
   /* #undef CONFIG_TEST */
   
  +/* Defined to a size to limit the stack size of Berkeley DB threads. */
  +/* #undef DB_STACKSIZE */
  +
   /* We use DB_WIN32 much as one would use _WIN32 -- to specify that we're using
      an operating system environment that supports Win32 calls and semantics. We
      don't use _WIN32 because Cygwin/GCC also defines _WIN32, even though
  @@ -47,8 +50,6 @@
   /* #undef HAVE_ATOMIC_X86_GCC_ASSEMBLY */
   
   /* Define to 1 if you have the `backtrace' function. */
  -
  -/* Define to 1 if you have the `backtrace' function. */
   /* #undef HAVE_BACKTRACE */
   
   /* Define to 1 if you have the `backtrace_symbols' function. */
  @@ -74,12 +75,18 @@
   #define HAVE_CRYPTO 1
   #endif
   
  +/* Define to 1 if using Intel IPP for cryptography. */
  +/* #undef HAVE_CRYPTO_IPP */
  +
   /* Define to 1 if you have the `ctime_r' function. */
   /* #undef HAVE_CTIME_R  */
   
   /* Define to 1 if ctime_r takes a buffer length as a third argument. */
   /* #undef HAVE_CTIME_R_3ARG */
   
  +/* Define to 1 if building the DBM API. */
  +/* #undef HAVE_DBM */
  +
   /* Define to 1 if you have the `directio' function. */
   /* #undef HAVE_DIRECTIO */
   
  @@ -90,6 +97,9 @@
   /* Define to 1 if you have the <dlfcn.h> header file. */
   /* #undef HAVE_DLFCN_H */
   
  +/* Define to 1 to use dtrace for performance event tracing. */
  +/* #undef HAVE_DTRACE */
  +
   /* Define to 1 if you have the <execinfo.h> header file. */
   /* #undef HAVE_EXECINFO_H */
   
  @@ -332,6 +342,9 @@
   /* Define to 1 if building partitioned database support. */
   /* #undef HAVE_PARTITION */
   
  +/* Define to 1 to enable some kind of performance event tracing. */
  +/* #undef HAVE_PERFMON */
  +
   /* Define to 1 if you have the `pread' function. */
   /* #undef HAVE_PREAD */
   
  @@ -418,6 +431,9 @@
   /* Define to 1 if building statistics support. */
   #define HAVE_STATISTICS 1
   
  +/* Define to 1 to enable performance event tracing of *_stat() statistics. */
  +/* #undef HAVE_STATISTICS_PERFMON */
  +
   /* Define to 1 if you have the <stdint.h> header file. */
   /* #undef HAVE_STDINT_H */
   
  @@ -472,6 +488,9 @@
   /* Define to 1 if you have the `sysconf' function. */
   /* #undef HAVE_SYSCONF */
   
  +/* Define to 1 to use stap for performance event tracing. */
  +/* #undef HAVE_SYSTEMTAP */
  +
   /* Define to 1 if port includes files in the Berkeley DB source code. */
   /* #undef HAVE_SYSTEM_INCLUDE_FILES */
   
  @@ -483,6 +502,9 @@
      */
   /* #undef HAVE_SYS_NDIR_H */
   
  +/* Define to 1 if you have the <sys/sdt.h> header file. */
  +/* #undef HAVE_SYS_SDT_H */
  +
   /* Define to 1 if you have the <sys/select.h> header file. */
   /* #undef HAVE_SYS_SELECT_H */
   
  @@ -537,13 +559,16 @@
   #define PACKAGE_NAME "Berkeley DB"
   
   /* Define to the full name and version of this package. */
  -#define PACKAGE_STRING "Berkeley DB 4.8.26"
  +#define PACKAGE_STRING "Berkeley DB 5.0.26"
   
   /* Define to the one symbol short name of this package. */
  -#define PACKAGE_TARNAME "db-4.8.26"
  +#define PACKAGE_TARNAME "db-5.0.26"
  +
  +/* Define to the home page for this package. */
  +#define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
   
   /* Define to the version of this package. */
  -#define PACKAGE_VERSION "4.8.26"
  +#define PACKAGE_VERSION "5.0.26"
   
   /* The size of a `char', as computed by sizeof. */
   /* #undef SIZEOF_CHAR */
  @@ .
  rm -f db/build_windows/Berkeley_DB.dsw <<'@@ .'
  Index: db/build_windows/Berkeley_DB.dsw
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/app_dsp.src <<'@@ .'
  Index: db/build_windows/app_dsp.src
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/build_all.dsp <<'@@ .'
  Index: db/build_windows/build_all.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/db.h
  ============================================================================
  $ cvs diff -u -r1.7 -r1.7.2.1 db.h
  --- db/build_windows/db.h	7 Jan 2010 22:02:22 -0000	1.7
  +++ db/build_windows/db.h	23 Aug 2010 13:36:33 -0000	1.7.2.1
  @@ -2,7 +2,7 @@
   /*
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    *
  @@ -57,10 +57,13 @@
   /*
    * Berkeley DB version information.
    */
  -#define	DB_VERSION_MAJOR	4
  -#define	DB_VERSION_MINOR	8
  +#define	DB_VERSION_FAMILY	11
  +#define	DB_VERSION_RELEASE	2
  +#define	DB_VERSION_MAJOR	5
  +#define	DB_VERSION_MINOR	0
   #define	DB_VERSION_PATCH	26
  -#define	DB_VERSION_STRING	"Berkeley DB 4.8.26: (December 18, 2009)"
  +#define	DB_VERSION_STRING	"Berkeley DB 5.0.26: (June 25, 2010)"
  +#define	DB_VERSION_FULL_STRING	"Berkeley DB 11g Release 2, library version 11.2.5.0.26: (June 25, 2010)"
   
   /*
    * !!!
  @@ -206,6 +209,7 @@
   struct __db_txn;	typedef struct __db_txn DB_TXN;
   struct __db_txn_active;	typedef struct __db_txn_active DB_TXN_ACTIVE;
   struct __db_txn_stat;	typedef struct __db_txn_stat DB_TXN_STAT;
  +struct __db_txn_token;	typedef struct __db_txn_token DB_TXN_TOKEN;
   struct __db_txnmgr;	typedef struct __db_txnmgr DB_TXNMGR;
   struct __dbc;		typedef struct __dbc DBC;
   struct __dbc_internal;	typedef struct __dbc_internal DBC_INTERNAL;
  @@ -214,6 +218,8 @@
   struct __fname;		typedef struct __fname FNAME;
   struct __key_range;	typedef struct __key_range DB_KEY_RANGE;
   struct __mpoolfile;	typedef struct __mpoolfile MPOOLFILE;
  +struct __db_logvrfy_config;
  +typedef struct __db_logvrfy_config DB_LOG_VERIFY_CONFIG;
   
   /*
    * The Berkeley DB API flags are automatically-generated -- the following flag
  @@ -457,7 +463,7 @@
   /*******************************************************
    * Logging.
    *******************************************************/
  -#define	DB_LOGVERSION	16		/* Current log version. */
  +#define	DB_LOGVERSION	17		/* Current log version. */
   #define DB_LOGVERSION_LATCHING 15	/* Log version using latching. */
   #define	DB_LOGCHKSUM	12		/* Check sum headers. */
   #define	DB_LOGOLDVER	8		/* Oldest log version supported. */
  @@ -563,6 +569,39 @@
   #define	DB_SET_TXN_LSNP(txn, blsnp, llsnp)		\
   	((txn)->set_txn_lsnp(txn, blsnp, llsnp))
   
  +/*
  + * Definition of the structure which specifies marshalling of log records.
  + */
  +typedef enum {
  +	LOGREC_Done,
  +	LOGREC_ARG,
  +	LOGREC_HDR,
  +	LOGREC_DATA,
  +	LOGREC_DB,
  +	LOGREC_DBOP,
  +	LOGREC_DBT,
  +	LOGREC_LOCKS,
  +	LOGREC_OP,
  +	LOGREC_PGDBT,
  +	LOGREC_PGDDBT,
  +	LOGREC_PGLIST,
  +	LOGREC_POINTER,
  +	LOGREC_TIME
  +} log_rec_type_t;
  +
  +typedef const struct __log_rec_spec {
  +	log_rec_type_t	type;
  +	u_int32_t	offset;
  +	const char 	*name;
  +	const char	fmt[4];
  +} DB_LOG_RECSPEC;
  +
  +/*
  + * Size of a DBT in a log record.
  + */
  +#define	LOG_DBT_SIZE(dbt)						\
  +    (sizeof(u_int32_t) + ((dbt) == NULL ? 0 : (dbt)->size))
  +
   /*******************************************************
    * Shared buffer cache (mpool).
    *******************************************************/
  @@ -742,7 +781,8 @@
   	DB_TXN_FORWARD_ROLL=4,		/* Public. */
   	DB_TXN_OPENFILES=5,		/* Internal. */
   	DB_TXN_POPENFILES=6,		/* Internal. */
  -	DB_TXN_PRINT=7			/* Public. */
  +	DB_TXN_PRINT=7,			/* Public. */
  +	DB_TXN_LOG_VERIFY=8		/* Internal. */
   } db_recops;
   
   /*
  @@ -818,6 +858,17 @@
   		struct __db_txn **tqe_prev;
   	} klinks;
   
  +	/*
  +	 * !!!
  +	 * Explicit representations of structures from queue.h.
  +	 * TAILQ_HEAD(__my_cursors, __dbc) my_cursors;
  +	 */
  +	struct __my_cursors {
  +		struct __dbc *tqh_first;
  +		struct __dbc **tqh_last;
  +	} my_cursors;
  +
  +	DB_TXN_TOKEN	*token_buffer;	/* User's commit token buffer. */
   	void	*api_internal;		/* C++ API private. */
   	void	*xml_internal;		/* XML API private. */
   
  @@ -828,9 +879,12 @@
   	int	  (*commit) __P((DB_TXN *, u_int32_t));
   	int	  (*discard) __P((DB_TXN *, u_int32_t));
   	int	  (*get_name) __P((DB_TXN *, const char **));
  +	int	  (*get_priority) __P((DB_TXN *, u_int32_t *));
   	u_int32_t (*id) __P((DB_TXN *));
   	int	  (*prepare) __P((DB_TXN *, u_int8_t *));
  +	int	  (*set_commit_token) __P((DB_TXN *, DB_TXN_TOKEN *));
   	int	  (*set_name) __P((DB_TXN *, const char *));
  +	int	  (*set_priority) __P((DB_TXN *, u_int32_t));
   	int	  (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t));
   	/* DB_TXN PUBLIC HANDLE LIST END */
   
  @@ -838,21 +892,24 @@
   	void	  (*set_txn_lsnp) __P((DB_TXN *txn, DB_LSN **, DB_LSN **));
   	/* DB_TXN PRIVATE HANDLE LIST END */
   
  -#define	TXN_CHILDCOMMIT		0x0001	/* Txn has committed. */
  -#define	TXN_CDSGROUP		0x0002	/* CDS group handle. */
  -#define	TXN_COMPENSATE		0x0004	/* Compensating transaction. */
  -#define	TXN_DEADLOCK		0x0008	/* Txn has deadlocked. */
  -#define	TXN_LOCKTIMEOUT		0x0010	/* Txn has a lock timeout. */
  -#define	TXN_MALLOC		0x0020	/* Structure allocated by TXN system. */
  -#define	TXN_NOSYNC		0x0040	/* Do not sync on prepare and commit. */
  -#define	TXN_NOWAIT		0x0080	/* Do not wait on locks. */
  -#define	TXN_PRIVATE		0x0100	/* Txn owned by cursor.. */
  -#define	TXN_READ_COMMITTED	0x0200	/* Txn has degree 2 isolation. */
  -#define	TXN_READ_UNCOMMITTED	0x0400	/* Txn has degree 1 isolation. */
  -#define	TXN_RESTORED		0x0800	/* Txn has been restored. */
  -#define	TXN_SNAPSHOT		0x1000	/* Snapshot Isolation. */
  -#define	TXN_SYNC		0x2000	/* Write and sync on prepare/commit. */
  -#define	TXN_WRITE_NOSYNC	0x4000	/* Write only on prepare/commit. */
  +#define	TXN_CHILDCOMMIT		0x00001	/* Txn has committed. */
  +#define	TXN_COMPENSATE		0x00002	/* Compensating transaction. */
  +#define	TXN_DEADLOCK		0x00004	/* Txn has deadlocked. */
  +#define	TXN_FAMILY		0x00008	/* Cursors/children are independent. */
  +#define	TXN_IGNORE_LEASE	0x00010	/* Skip lease check at commit time. */
  +#define	TXN_INFAMILY		0x00020	/* Part of a transaction family. */
  +#define	TXN_LOCKTIMEOUT		0x00040	/* Txn has a lock timeout. */
  +#define	TXN_MALLOC		0x00080	/* Structure allocated by TXN system. */
  +#define	TXN_NOSYNC		0x00100	/* Do not sync on prepare and commit. */
  +#define	TXN_NOWAIT		0x00200	/* Do not wait on locks. */
  +#define	TXN_PRIVATE		0x00400	/* Txn owned by cursor. */
  +#define	TXN_READONLY		0x00800	/* CDS group handle. */
  +#define	TXN_READ_COMMITTED	0x01000	/* Txn has degree 2 isolation. */
  +#define	TXN_READ_UNCOMMITTED	0x02000	/* Txn has degree 1 isolation. */
  +#define	TXN_RESTORED		0x04000	/* Txn has been restored. */
  +#define	TXN_SNAPSHOT		0x08000	/* Snapshot Isolation. */
  +#define	TXN_SYNC		0x10000	/* Write and sync on prepare/commit. */
  +#define	TXN_WRITE_NOSYNC	0x20000	/* Write only on prepare/commit. */
   	u_int32_t	flags;
   };
   
  @@ -881,6 +938,8 @@
   	DB_LSN	  read_lsn;		/* Read LSN for MVCC */
   	u_int32_t mvcc_ref;		/* MVCC reference count */
   
  +	u_int32_t priority;		/* Deadlock resolution priority */
  +
   #define	TXN_ABORTED		1
   #define	TXN_COMMITTED		2
   #define	TXN_PREPARED		3
  @@ -913,6 +972,11 @@
   #endif
   };
   
  +#define	DB_TXN_TOKEN_SIZE		20
  +struct __db_txn_token {
  +	u_int8_t buf[DB_TXN_TOKEN_SIZE];
  +};
  +
   /*******************************************************
    * Replication.
    *******************************************************/
  @@ -942,17 +1006,21 @@
   #define	DB_REP_LEASE_TIMEOUT		9	/* Master leases. */
   
   /* Event notification types. */
  -#define	DB_EVENT_NO_SUCH_EVENT		 0 /* out-of-band sentinel value */
  -#define	DB_EVENT_PANIC			 1
  -#define	DB_EVENT_REG_ALIVE		 2
  -#define	DB_EVENT_REG_PANIC		 3
  -#define	DB_EVENT_REP_CLIENT		 4
  +#define	DB_EVENT_PANIC			 0
  +#define	DB_EVENT_REG_ALIVE		 1
  +#define	DB_EVENT_REG_PANIC		 2
  +#define	DB_EVENT_REP_CLIENT		 3
  +#define	DB_EVENT_REP_DUPMASTER		 4
   #define	DB_EVENT_REP_ELECTED		 5
  -#define	DB_EVENT_REP_MASTER		 6
  -#define	DB_EVENT_REP_NEWMASTER		 7
  -#define	DB_EVENT_REP_PERM_FAILED	 8
  -#define	DB_EVENT_REP_STARTUPDONE	 9
  -#define	DB_EVENT_WRITE_FAILED		10
  +#define	DB_EVENT_REP_ELECTION_FAILED	 6
  +#define	DB_EVENT_REP_JOIN_FAILURE	 7
  +#define	DB_EVENT_REP_MASTER		 8
  +#define	DB_EVENT_REP_MASTER_FAILURE	 9
  +#define	DB_EVENT_REP_NEWMASTER		10
  +#define	DB_EVENT_REP_PERM_FAILED	11
  +#define	DB_EVENT_REP_STARTUPDONE	12
  +#define	DB_EVENT_WRITE_FAILED		13
  +#define	DB_EVENT_NO_SUCH_EVENT		 0xffffffff /* OOB sentinel value */
   
   /* Replication Manager site status. */
   struct __db_repmgr_site {
  @@ -960,9 +1028,12 @@
   	char *host;
   	u_int port;
   
  -#define	DB_REPMGR_CONNECTED	0x01
  -#define	DB_REPMGR_DISCONNECTED	0x02
  +#define	DB_REPMGR_CONNECTED	1
  +#define	DB_REPMGR_DISCONNECTED	2
   	u_int32_t status;
  +
  +#define	DB_REPMGR_ISPEER	0x01
  +	u_int32_t flags;
   };
   
   /* Replication statistics. */
  @@ -976,9 +1047,9 @@
   	 * off somewhat (or, on unreasonable architectures under unlucky
   	 * circumstances, garbaged).
   	 */
  -	uintmax_t st_log_queued;	/* Log records currently queued.+ */
   	u_int32_t st_startup_complete;	/* Site completed client sync-up. */
   #ifndef __TEST_DB_NO_STATISTICS
  +	uintmax_t st_log_queued;	/* Log records currently queued.+ */
   	u_int32_t st_status;		/* Current replication status. */
   	DB_LSN st_next_lsn;		/* Next LSN to use or expect. */
   	DB_LSN st_waiting_lsn;		/* LSN we're awaiting, if any. */
  @@ -1060,6 +1131,8 @@
   					   queue length. */
   	uintmax_t st_connection_drop;	/* Existing connections dropped. */
   	uintmax_t st_connect_fail;	/* Failed new connection attempts. */
  +	uintmax_t st_elect_threads;	/* # of active election threads. */
  +	uintmax_t st_max_elect_threads;	/* Max concurrent e-threads ever. */
   };
   
   /*******************************************************
  @@ -1212,27 +1285,29 @@
   #define	DB_LOCK_DEADLOCK	(-30994)/* Deadlock. */
   #define	DB_LOCK_NOTGRANTED	(-30993)/* Lock unavailable. */
   #define	DB_LOG_BUFFER_FULL	(-30992)/* In-memory log buffer full. */
  -#define	DB_NOSERVER		(-30991)/* Server panic return. */
  -#define	DB_NOSERVER_HOME	(-30990)/* Bad home sent to server. */
  -#define	DB_NOSERVER_ID		(-30989)/* Bad ID sent to server. */
  -#define	DB_NOTFOUND		(-30988)/* Key/data pair not found (EOF). */
  -#define	DB_OLD_VERSION		(-30987)/* Out-of-date version. */
  -#define	DB_PAGE_NOTFOUND	(-30986)/* Requested page not found. */
  -#define	DB_REP_DUPMASTER	(-30985)/* There are two masters. */
  -#define	DB_REP_HANDLE_DEAD	(-30984)/* Rolled back a commit. */
  -#define	DB_REP_HOLDELECTION	(-30983)/* Time to hold an election. */
  -#define	DB_REP_IGNORE		(-30982)/* This msg should be ignored.*/
  -#define	DB_REP_ISPERM		(-30981)/* Cached not written perm written.*/
  -#define	DB_REP_JOIN_FAILURE	(-30980)/* Unable to join replication group. */
  -#define	DB_REP_LEASE_EXPIRED	(-30979)/* Master lease has expired. */
  -#define	DB_REP_LOCKOUT		(-30978)/* API/Replication lockout now. */
  -#define	DB_REP_NEWSITE		(-30977)/* New site entered system. */
  -#define	DB_REP_NOTPERM		(-30976)/* Permanent log record not written. */
  -#define	DB_REP_UNAVAIL		(-30975)/* Site cannot currently be reached. */
  -#define	DB_RUNRECOVERY		(-30974)/* Panic return. */
  -#define	DB_SECONDARY_BAD	(-30973)/* Secondary index corrupt. */
  -#define	DB_VERIFY_BAD		(-30972)/* Verify failed; bad format. */
  -#define	DB_VERSION_MISMATCH	(-30971)/* Environment version mismatch. */
  +#define	DB_LOG_VERIFY_BAD	(-30991)/* Log verification failed. */
  +#define	DB_NOSERVER		(-30990)/* Server panic return. */
  +#define	DB_NOSERVER_HOME	(-30989)/* Bad home sent to server. */
  +#define	DB_NOSERVER_ID		(-30988)/* Bad ID sent to server. */
  +#define	DB_NOTFOUND		(-30987)/* Key/data pair not found (EOF). */
  +#define	DB_OLD_VERSION		(-30986)/* Out-of-date version. */
  +#define	DB_PAGE_NOTFOUND	(-30985)/* Requested page not found. */
  +#define	DB_REP_DUPMASTER	(-30984)/* There are two masters. */
  +#define	DB_REP_HANDLE_DEAD	(-30983)/* Rolled back a commit. */
  +#define	DB_REP_HOLDELECTION	(-30982)/* Time to hold an election. */
  +#define	DB_REP_IGNORE		(-30981)/* This msg should be ignored.*/
  +#define	DB_REP_ISPERM		(-30980)/* Cached not written perm written.*/
  +#define	DB_REP_JOIN_FAILURE	(-30979)/* Unable to join replication group. */
  +#define	DB_REP_LEASE_EXPIRED	(-30978)/* Master lease has expired. */
  +#define	DB_REP_LOCKOUT		(-30977)/* API/Replication lockout now. */
  +#define	DB_REP_NEWSITE		(-30976)/* New site entered system. */
  +#define	DB_REP_NOTPERM		(-30975)/* Permanent log record not written. */
  +#define	DB_REP_UNAVAIL		(-30974)/* Site cannot currently be reached. */
  +#define	DB_RUNRECOVERY		(-30973)/* Panic return. */
  +#define	DB_SECONDARY_BAD	(-30972)/* Secondary index corrupt. */
  +#define	DB_TIMEOUT		(-30971)/* Timed out on read consistency. */
  +#define	DB_VERIFY_BAD		(-30970)/* Verify failed; bad format. */
  +#define	DB_VERSION_MISMATCH	(-30969)/* Environment version mismatch. */
   
   /* DB (private) error return codes. */
   #define	DB_ALREADY_ABORTED	(-30899)
  @@ -1240,17 +1315,14 @@
   #define	DB_EVENT_NOT_HANDLED	(-30897)/* Forward event to application. */
   #define	DB_NEEDSPLIT		(-30896)/* Page needs to be split. */
   #define	DB_REP_BULKOVF		(-30895)/* Rep bulk buffer overflow. */
  -#define	DB_REP_EGENCHG		(-30894)/* Egen changed while in election. */
  -#define	DB_REP_LOGREADY		(-30893)/* Rep log ready for recovery. */
  -#define	DB_REP_NEWMASTER	(-30892)/* We have learned of a new master. */
  -#define	DB_REP_PAGEDONE		(-30891)/* This page was already done. */
  -#define	DB_REP_PAGELOCKED	(-30890)/* Page we want is locked. */
  -#define	DB_SURPRISE_KID		(-30889)/* Child commit where parent
  +#define	DB_REP_LOGREADY		(-30894)/* Rep log ready for recovery. */
  +#define	DB_REP_NEWMASTER	(-30893)/* We have learned of a new master. */
  +#define	DB_REP_PAGEDONE		(-30892)/* This page was already done. */
  +#define	DB_SURPRISE_KID		(-30891)/* Child commit where parent
   					   didn't know it was a parent. */
  -#define	DB_SWAPBYTES		(-30888)/* Database needs byte swapping. */
  -#define	DB_TIMEOUT		(-30887)/* Timed out waiting for election. */
  -#define	DB_TXN_CKP		(-30886)/* Encountered ckp record in log. */
  -#define	DB_VERIFY_FATAL		(-30885)/* DB->verify cannot proceed. */
  +#define	DB_SWAPBYTES		(-30890)/* Database needs byte swapping. */
  +#define	DB_TXN_CKP		(-30889)/* Encountered ckp record in log. */
  +#define	DB_VERIFY_FATAL		(-30888)/* DB->verify cannot proceed. */
   
   /* Database handle. */
   struct __db {
  @@ -1572,6 +1644,9 @@
   	int  (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
   	int  (*stored_close) __P((DB *, u_int32_t));
   
  +	/* Alternative handle close function, used by C++ API. */
  +	int  (*alt_close) __P((DB *, u_int32_t));
  +
   #define	DB_OK_BTREE	0x01
   #define	DB_OK_HASH	0x02
   #define	DB_OK_QUEUE	0x04
  @@ -1713,7 +1788,7 @@
   		else {							\
   			writedata = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = __off;					\
  -			__p[-1] = (writedlen);				\
  +			__p[-1] = (u_int32_t)(writedlen);		\
   			__p[-2] = (u_int32_t)-1;			\
   			pointer = __p - 2;				\
   		}							\
  @@ -1742,12 +1817,12 @@
   		} else {						\
   			writekey = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = __off;					\
  -			__p[-1] = (writeklen);				\
  +			__p[-1] = (u_int32_t)(writeklen);		\
   			__p -= 2;					\
  -			__off += (writeklen);				\
  +			__off += (u_int32_t)(writeklen);		\
   			writedata = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = __off;					\
  -			__p[-1] = (writedlen);				\
  +			__p[-1] = (u_int32_t)(writedlen);		\
   			__p[-2] = (u_int32_t)-1;			\
   			pointer = __p - 2;				\
   		}							\
  @@ -1787,7 +1862,7 @@
   			writedata = (u_int8_t *)(dbt)->data + __off;	\
   			__p[0] = (u_int32_t)(recno);			\
   			__p[-1] = __off;				\
  -			__p[-2] = (writedlen);				\
  +			__p[-2] = (u_int32_t)(writedlen);		\
   			__p[-3] = 0;					\
   			pointer = __p - 3;				\
   		}							\
  @@ -1829,6 +1904,18 @@
   	} links;
   
   	/*
  +	 * Cursor queue of the owning transaction.
  +	 *
  +	 * !!!
  +	 * Explicit representations of structures from queue.h.
  +	 * TAILQ_ENTRY(__dbc) txn_cursors;
  +	 */
  +	struct {
  +		DBC *tqe_next;	/* next element */
  +		DBC **tqe_prev;	/* address of previous next element */
  +	} txn_cursors;
  +
  +	/*
   	 * The DBT *'s below are used by the cursor routines to return
   	 * data to the user when DBT flags indicate that DB should manage
   	 * the returned memory.  They point at a DBT containing the buffer
  @@ -1904,20 +1991,21 @@
   #define	DBC_DONTLOCK		0x00004	/* Don't lock on this cursor. */
   #define	DBC_DOWNREV		0x00008	/* Down rev replication master. */
   #define	DBC_DUPLICATE		0x00010	/* Create a duplicate cursor. */
  -#define	DBC_FROM_DB_GET		0x00020 /* Called from the DB->get() method. */
  -#define	DBC_MULTIPLE		0x00040	/* Return Multiple data. */
  -#define	DBC_MULTIPLE_KEY	0x00080	/* Return Multiple keys and data. */
  -#define	DBC_OPD			0x00100	/* Cursor references off-page dups. */
  -#define	DBC_OWN_LID		0x00200	/* Free lock id on destroy. */
  -#define	DBC_PARTITIONED		0x00400	/* Cursor for a partitioned db. */
  -#define	DBC_READ_COMMITTED	0x00800	/* Cursor has degree 2 isolation. */
  -#define	DBC_READ_UNCOMMITTED	0x01000	/* Cursor has degree 1 isolation. */
  -#define	DBC_RECOVER		0x02000	/* Recovery cursor; don't log/lock. */
  -#define	DBC_RMW			0x04000	/* Acquire write flag in read op. */
  -#define	DBC_TRANSIENT		0x08000	/* Cursor is transient. */
  -#define	DBC_WAS_READ_COMMITTED	0x10000	/* Cursor holds a read commited lock. */
  -#define	DBC_WRITECURSOR		0x20000	/* Cursor may be used to write (CDB). */
  -#define	DBC_WRITER		0x40000	/* Cursor immediately writing (CDB). */
  +#define	DBC_FAMILY		0x00020 /* Part of a locker family. */
  +#define	DBC_FROM_DB_GET		0x00040 /* Called from the DB->get() method. */
  +#define	DBC_MULTIPLE		0x00080	/* Return Multiple data. */
  +#define	DBC_MULTIPLE_KEY	0x00100	/* Return Multiple keys and data. */
  +#define	DBC_OPD			0x00200	/* Cursor references off-page dups. */
  +#define	DBC_OWN_LID		0x00400	/* Free lock id on destroy. */
  +#define	DBC_PARTITIONED		0x00800	/* Cursor for a partitioned db. */
  +#define	DBC_READ_COMMITTED	0x01000	/* Cursor has degree 2 isolation. */
  +#define	DBC_READ_UNCOMMITTED	0x02000	/* Cursor has degree 1 isolation. */
  +#define	DBC_RECOVER		0x04000	/* Recovery cursor; don't log/lock. */
  +#define	DBC_RMW			0x08000	/* Acquire write flag in read op. */
  +#define	DBC_TRANSIENT		0x10000	/* Cursor is transient. */
  +#define	DBC_WAS_READ_COMMITTED	0x20000	/* Cursor holds a read commited lock. */
  +#define	DBC_WRITECURSOR		0x40000	/* Cursor may be used to write (CDB). */
  +#define	DBC_WRITER		0x80000	/* Cursor immediately writing (CDB). */
   	u_int32_t flags;
   };
   
  @@ -1959,6 +2047,7 @@
   	db_timeout_t	compact_timeout;	/* Lock timeout. */
   	u_int32_t	compact_pages;		/* Max pages to process. */
   	/* Output Stats. */
  +	u_int32_t	compact_empty_buckets;	/* Empty hash buckets found. */
   	u_int32_t	compact_pages_free;	/* Number of pages freed. */
   	u_int32_t	compact_pages_examine;	/* Number of pages examine. */
   	u_int32_t	compact_levels;		/* Number of levels removed. */
  @@ -2200,6 +2289,7 @@
   	int  (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *));
   	int  (*get_lk_max_objects) __P((DB_ENV *, u_int32_t *));
   	int  (*get_lk_partitions) __P((DB_ENV *, u_int32_t *));
  +	int  (*get_lk_priority) __P((DB_ENV *, u_int32_t, u_int32_t *));
   	int  (*get_mp_max_openfd) __P((DB_ENV *, int *));
   	int  (*get_mp_max_write) __P((DB_ENV *, int *, db_timeout_t *));
   	int  (*get_mp_mmapsize) __P((DB_ENV *, size_t *));
  @@ -2238,9 +2328,15 @@
   	int  (*log_get_config) __P((DB_ENV *, u_int32_t, int *));
   	int  (*log_printf) __P((DB_ENV *, DB_TXN *, const char *, ...));
   	int  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
  +	int  (*log_put_record) __P((DB_ENV *, DB *, DB_TXN *, DB_LSN *,
  +		u_int32_t, u_int32_t, u_int32_t, u_int32_t,
  +		DB_LOG_RECSPEC *, ...));
  +	int  (*log_read_record) __P((DB_ENV *, DB **,
  +		void *, void *, DB_LOG_RECSPEC *, u_int32_t, void **));
   	int  (*log_set_config) __P((DB_ENV *, u_int32_t, int));
   	int  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
   	int  (*log_stat_print) __P((DB_ENV *, u_int32_t));
  +	int  (*log_verify) __P((DB_ENV *, const DB_LOG_VERIFY_CONFIG *));
   	int  (*lsn_reset) __P((DB_ENV *, const char *, u_int32_t));
   	int  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
   	int  (*memp_register) __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_t,
  @@ -2332,6 +2428,7 @@
   	int  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
   	int  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
   	int  (*set_lk_partitions) __P((DB_ENV *, u_int32_t));
  +	int  (*set_lk_priority) __P((DB_ENV *, u_int32_t, u_int32_t));
   	int  (*set_mp_max_openfd) __P((DB_ENV *, int));
   	int  (*set_mp_max_write) __P((DB_ENV *, int, db_timeout_t));
   	int  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
  @@ -2354,6 +2451,8 @@
   	int  (*set_tx_max) __P((DB_ENV *, u_int32_t));
   	int  (*set_tx_timestamp) __P((DB_ENV *, time_t *));
   	int  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
  +	int  (*txn_applied) __P((DB_ENV *,
  +		DB_TXN_TOKEN *, db_timeout_t, u_int32_t));
   	int  (*stat_print) __P((DB_ENV *, u_int32_t));
   	int  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
   	int  (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
  @@ -2370,9 +2469,9 @@
   };
   
   /*
  - * Dispatch structure for recovery and print routines.  Since internal and
  - * external routines take different arguments (ENV versus DB_ENV), we need
  - * something more elaborate than a single pointer and size.
  + * Dispatch structure for recovery, log verification and print routines. Since
  + * internal and external routines take different arguments (ENV versus DB_ENV),
  + * we need something more elaborate than a single pointer and size.
    */
   struct __db_distab {
   	int   (**int_dispatch) __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
  @@ -2381,9 +2480,18 @@
   	size_t	ext_size;
   };
   
  -#ifndef DB_DBM_HSEARCH
  -#define	DB_DBM_HSEARCH	0		/* No historic interfaces by default. */
  -#endif
  +/*
  + * Log verification configuration structure.
  + */
  +struct __db_logvrfy_config {
  +	int continue_after_fail, verbose;
  +	u_int32_t cachesize;
  +	const char *temp_envhome;
  +	const char *dbfile, *dbname;
  +	DB_LSN start_lsn, end_lsn;
  +	time_t start_time, end_time;
  +};
  +
   #if DB_DBM_HSEARCH != 0
   /*******************************************************
    * Dbm/Ndbm historic interfaces.
  @@ -2502,12 +2610,13 @@
   #define	DB_FCNTL_LOCKING			0x00000800
   #define	DB_FLUSH				0x00000001
   #define	DB_FORCE				0x00000001
  +#define	DB_FORCESYNC				0x00000001
   #define	DB_FOREIGN_ABORT			0x00000001
   #define	DB_FOREIGN_CASCADE			0x00000002
   #define	DB_FOREIGN_NULLIFY			0x00000004
   #define	DB_FREELIST_ONLY			0x00000001
   #define	DB_FREE_SPACE				0x00000002
  -#define	DB_IGNORE_LEASE				0x00002000
  +#define	DB_IGNORE_LEASE				0x00001000
   #define	DB_IMMUTABLE_KEY			0x00000002
   #define	DB_INIT_CDB				0x00000040
   #define	DB_INIT_LOCK				0x00000080
  @@ -2531,6 +2640,14 @@
   #define	DB_LOG_IN_MEMORY			0x00000008
   #define	DB_LOG_NOCOPY				0x00000008
   #define	DB_LOG_NOT_DURABLE			0x00000010
  +#define	DB_LOG_VERIFY_CAF			0x00000001
  +#define	DB_LOG_VERIFY_DBFILE			0x00000002
  +#define	DB_LOG_VERIFY_ERR			0x00000004
  +#define	DB_LOG_VERIFY_FORWARD			0x00000008
  +#define	DB_LOG_VERIFY_INTERR			0x00000010
  +#define	DB_LOG_VERIFY_PARTIAL			0x00000020
  +#define	DB_LOG_VERIFY_VERBOSE			0x00000040
  +#define	DB_LOG_VERIFY_WARNING			0x00000080
   #define	DB_LOG_WRNOSYNC				0x00000020
   #define	DB_LOG_ZERO				0x00000010
   #define	DB_MPOOL_CREATE				0x00000001
  @@ -2553,11 +2670,12 @@
   #define	DB_MUTEX_PROCESS_ONLY			0x00000008
   #define	DB_MUTEX_SELF_BLOCK			0x00000010
   #define	DB_MUTEX_SHARED				0x00000020
  +#define	DB_NOERROR				0x00001000
   #define	DB_NOLOCKING				0x00000400
   #define	DB_NOMMAP				0x00000008
   #define	DB_NOORDERCHK				0x00000002
   #define	DB_NOPANIC				0x00000800
  -#define	DB_NO_AUTO_COMMIT			0x00001000
  +#define	DB_NO_AUTO_COMMIT			0x00002000
   #define	DB_ODDFILESIZE				0x00000080
   #define	DB_ORDERCHKONLY				0x00000004
   #define	DB_OVERWRITE				0x00001000
  @@ -2567,7 +2685,7 @@
   #define	DB_PR_PAGE				0x00000010
   #define	DB_PR_RECOVERYTEST			0x00000020
   #define	DB_RDONLY				0x00000400
  -#define	DB_RDWRMASTER				0x00002000
  +#define	DB_RDWRMASTER				0x00004000
   #define	DB_READ_COMMITTED			0x00000400
   #define	DB_READ_UNCOMMITTED			0x00000200
   #define	DB_RECNUM				0x00000040
  @@ -2577,22 +2695,23 @@
   #define	DB_REGISTER				0x00008000
   #define	DB_RENUMBER				0x00000080
   #define	DB_REPMGR_CONF_2SITE_STRICT		0x00000001
  +#define	DB_REPMGR_CONF_ELECTIONS		0x00000002
   #define	DB_REPMGR_PEER				0x00000001
   #define	DB_REP_ANYWHERE				0x00000001
   #define	DB_REP_CLIENT				0x00000001
  -#define	DB_REP_CONF_BULK			0x00000002
  -#define	DB_REP_CONF_DELAYCLIENT			0x00000004
  -#define	DB_REP_CONF_INMEM			0x00000008
  -#define	DB_REP_CONF_LEASE			0x00000010
  -#define	DB_REP_CONF_NOAUTOINIT			0x00000020
  -#define	DB_REP_CONF_NOWAIT			0x00000040
  +#define	DB_REP_CONF_AUTOINIT			0x00000004
  +#define	DB_REP_CONF_BULK			0x00000008
  +#define	DB_REP_CONF_DELAYCLIENT			0x00000010
  +#define	DB_REP_CONF_INMEM			0x00000020
  +#define	DB_REP_CONF_LEASE			0x00000040
  +#define	DB_REP_CONF_NOWAIT			0x00000080
   #define	DB_REP_ELECTION				0x00000004
   #define	DB_REP_MASTER				0x00000002
   #define	DB_REP_NOBUFFER				0x00000002
   #define	DB_REP_PERMANENT			0x00000004
   #define	DB_REP_REREQUEST			0x00000008
   #define	DB_REVSPLITOFF				0x00000100
  -#define	DB_RMW					0x00001000
  +#define	DB_RMW					0x00002000
   #define	DB_RPCCLIENT				0x00000001
   #define	DB_SALVAGE				0x00000040
   #define	DB_SA_SKIPFIRSTKEY			0x00000080
  @@ -2628,13 +2747,14 @@
   #define	DB_SYSTEM_MEM				0x00010000
   #define	DB_THREAD				0x00000010
   #define	DB_TIME_NOTGRANTED			0x00008000
  -#define	DB_TRUNCATE				0x00004000
  +#define	DB_TRUNCATE				0x00008000
  +#define	DB_TXN_FAMILY				0x00000008
   #define	DB_TXN_NOSYNC				0x00000001
   #define	DB_TXN_NOT_DURABLE			0x00000002
   #define	DB_TXN_NOWAIT				0x00000010
   #define	DB_TXN_SNAPSHOT				0x00000002
   #define	DB_TXN_SYNC				0x00000004
  -#define	DB_TXN_WAIT				0x00000008
  +#define	DB_TXN_WAIT				0x00000040
   #define	DB_TXN_WRITE_NOSYNC			0x00000020
   #define	DB_UNREF				0x00020000
   #define	DB_UPGRADE				0x00000001
  @@ -2653,13 +2773,14 @@
   #define	DB_VERB_REP_MISC			0x00000400
   #define	DB_VERB_REP_MSGS			0x00000800
   #define	DB_VERB_REP_SYNC			0x00001000
  -#define	DB_VERB_REP_TEST			0x00002000
  -#define	DB_VERB_WAITSFOR			0x00004000
  +#define	DB_VERB_REP_SYSTEM			0x00002000
  +#define	DB_VERB_REP_TEST			0x00004000
  +#define	DB_VERB_WAITSFOR			0x00008000
   #define	DB_VERIFY				0x00000002
   #define	DB_VERIFY_PARTITION			0x00040000
   #define	DB_WRITECURSOR				0x00000008
   #define	DB_WRITELOCK				0x00000010
  -#define	DB_WRITEOPEN				0x00008000
  +#define	DB_WRITEOPEN				0x00010000
   #define	DB_YIELDCPU				0x00010000
   
   /* DO NOT EDIT: automatically built by dist/s_include. */
  @@ -2695,6 +2816,7 @@
   int db_env_set_func_yield __P((int (*)(u_long, u_long)));
   int db_env_create __P((DB_ENV **, u_int32_t));
   char *db_version __P((int *, int *, int *));
  +char *db_full_version __P((int *, int *, int *, int *, int *));
   int log_compare __P((const DB_LSN *, const DB_LSN *));
   int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
   #if DB_DBM_HSEARCH != 0
  @@ .
  rm -f db/build_windows/db_archive.dsp <<'@@ .'
  Index: db/build_windows/db_archive.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_checkpoint.dsp <<'@@ .'
  Index: db/build_windows/db_checkpoint.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/db_config.h
  ============================================================================
  $ cvs diff -u -r1.7 -r1.7.2.1 db_config.h
  --- db/build_windows/db_config.h	7 Jan 2010 22:02:22 -0000	1.7
  +++ db/build_windows/db_config.h	23 Aug 2010 13:36:33 -0000	1.7.2.1
  @@ -2,6 +2,9 @@
   /* Define to 1 if you want to build a version for running the test suite. */
   /* #undef CONFIG_TEST */
   
  +/* Defined to a size to limit the stack size of Berkeley DB threads. */
  +/* #undef DB_STACKSIZE */
  +
   /* We use DB_WIN32 much as one would use _WIN32 -- to specify that we're using
      an operating system environment that supports Win32 calls and semantics. We
      don't use _WIN32 because Cygwin/GCC also defines _WIN32, even though
  @@ -75,12 +78,18 @@
   #define HAVE_CRYPTO 1
   #endif
   
  +/* Define to 1 if using Intel IPP for cryptography. */
  +/* #undef HAVE_CRYPTO_IPP */
  +
   /* Define to 1 if you have the `ctime_r' function. */
   /* #undef HAVE_CTIME_R  */
   
   /* Define to 1 if ctime_r takes a buffer length as a third argument. */
   /* #undef HAVE_CTIME_R_3ARG */
   
  +/* Define to 1 if building the DBM API. */
  +#define HAVE_DBM 1
  +
   /* Define to 1 if you have the `directio' function. */
   /* #undef HAVE_DIRECTIO */
   
  @@ -91,6 +100,9 @@
   /* Define to 1 if you have the <dlfcn.h> header file. */
   /* #undef HAVE_DLFCN_H */
   
  +/* Define to 1 to use dtrace for performance event tracing. */
  +/* #undef HAVE_DTRACE */
  +
   /* Define to 1 if you have the <execinfo.h> header file. */
   /* #undef HAVE_EXECINFO_H */
   
  @@ -173,7 +185,7 @@
   /* #undef HAVE_INTTYPES_H */
   
   /* Define to 1 if you have the `isalpha' function. */
  -#define HAVE_ISALPHA 1
  +/* #undef HAVE_ISALPHA */
   
   /* Define to 1 if you have the `isdigit' function. */
   #define HAVE_ISDIGIT 1
  @@ -333,6 +345,9 @@
   /* Define to 1 if building partitioned database support. */
   #define HAVE_PARTITION 1
   
  +/* Define to 1 to enable some kind of performance event tracing. */
  +/* #undef HAVE_PERFMON */
  +
   /* Define to 1 if you have the `pread' function. */
   /* #undef HAVE_PREAD */
   
  @@ -423,6 +438,9 @@
   /* Define to 1 if building statistics support. */
   #define HAVE_STATISTICS 1
   
  +/* Define to 1 to enable performance event tracing of *_stat() statistics. */
  +/* #undef HAVE_STATISTICS_PERFMON */
  +
   /* Define to 1 if you have the <stdint.h> header file. */
   /* #undef HAVE_STDINT_H */
   
  @@ -477,6 +495,9 @@
   /* Define to 1 if you have the `sysconf' function. */
   /* #undef HAVE_SYSCONF */
   
  +/* Define to 1 to use stap for performance event tracing. */
  +/* #undef HAVE_SYSTEMTAP */
  +
   /* Define to 1 if port includes files in the Berkeley DB source code. */
   /* #undef HAVE_SYSTEM_INCLUDE_FILES */
   
  @@ -488,6 +509,9 @@
      */
   /* #undef HAVE_SYS_NDIR_H */
   
  +/* Define to 1 if you have the <sys/sdt.h> header file. */
  +/* #undef HAVE_SYS_SDT_H */
  +
   /* Define to 1 if you have the <sys/select.h> header file. */
   /* #undef HAVE_SYS_SELECT_H */
   
  @@ -542,13 +566,16 @@
   #define PACKAGE_NAME "Berkeley DB"
   
   /* Define to the full name and version of this package. */
  -#define PACKAGE_STRING "Berkeley DB 4.8.26"
  +#define PACKAGE_STRING "Berkeley DB 5.0.26"
   
   /* Define to the one symbol short name of this package. */
  -#define PACKAGE_TARNAME "db-4.8.26"
  +#define PACKAGE_TARNAME "db-5.0.26"
  +
  +/* Define to the home page for this package. */
  +#define PACKAGE_URL "http://www.oracle.com/technology/software/products/berkeley-db/index.html"
   
   /* Define to the version of this package. */
  -#define PACKAGE_VERSION "4.8.26"
  +#define PACKAGE_VERSION "5.0.26"
   
   /* The size of a `char', as computed by sizeof. */
   /* #undef SIZEOF_CHAR */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/db_cxx.h
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 db_cxx.h
  --- db/build_windows/db_cxx.h	16 Sep 2009 19:34:43 -0000	1.4
  +++ db/build_windows/db_cxx.h	23 Aug 2010 13:36:33 -0000	1.4.2.1
  @@ -2,7 +2,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -364,6 +364,8 @@
   	u_int32_t flags_;
   	u_int32_t construct_flags_;
   
  +	static int alt_close(DB *, u_int32_t);
  +
   public:
   	// These are public only because they need to be called
   	// via C callback functions.  They should never be used by
  @@ -522,6 +524,8 @@
   	virtual int set_lk_max_objects(u_int32_t);
   	virtual int get_lk_partitions(u_int32_t *);
   	virtual int set_lk_partitions(u_int32_t);
  +	virtual int get_lk_priority(u_int32_t, u_int32_t *);
  +	virtual int set_lk_priority(u_int32_t, u_int32_t);
   	virtual int get_mp_mmapsize(size_t *);
   	virtual int set_mp_mmapsize(size_t);
   	virtual int get_mp_max_openfd(int *);
  @@ -555,9 +559,11 @@
   	virtual int get_verbose(u_int32_t which, int *);
   	virtual int set_verbose(u_int32_t which, int);
   
  -	// Version information.  A static method so it can be obtained anytime.
  +	// Version information.  Static methods, can be called at any time.
   	//
   	static char *version(int *major, int *minor, int *patch);
  +	static char *full_version(int *family, int *release,
  +	    int *major, int *minor, int *patch);
   
   	// Convert DB errors to strings
   	static char *strerror(int);
  @@ -612,6 +618,7 @@
   	virtual int log_set_config(u_int32_t, int);
   	virtual int log_stat(DB_LOG_STAT **spp, u_int32_t flags);
   	virtual int log_stat_print(u_int32_t flags);
  +	virtual int log_verify(DB_LOG_VERIFY_CONFIG *);
   
   	// Mpool functions
   	//
  @@ -994,8 +1001,10 @@
   	int discard(u_int32_t flags);
   	u_int32_t id();
   	int get_name(const char **namep);
  +	int get_priority(u_int32_t *priorityp);
   	int prepare(u_int8_t *gid);
   	int set_name(const char *name);
  +	int set_priority(u_int32_t priority);
   	int set_timeout(db_timeout_t timeout, u_int32_t flags);
   
   	virtual DB_TXN *get_DB_TXN()
  @@ .
  rm -f db/build_windows/db_deadlock.dsp <<'@@ .'
  Index: db/build_windows/db_deadlock.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_dll.dsp <<'@@ .'
  Index: db/build_windows/db_dll.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_dump.dsp <<'@@ .'
  Index: db/build_windows/db_dump.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_hotbackup.dsp <<'@@ .'
  Index: db/build_windows/db_hotbackup.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/db_int.h
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 db_int.h
  --- db/build_windows/db_int.h	16 Sep 2009 19:34:43 -0000	1.4
  +++ db/build_windows/db_int.h	23 Aug 2010 13:36:33 -0000	1.4.2.1
  @@ -2,7 +2,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -20,7 +20,7 @@
   #endif
   #include <sys/stat.h>
   
  -#if defined(__INCLUDE_SELECT_H)
  +#if defined(HAVE_REPLICATION_THREADS)
   #ifdef HAVE_SYS_SELECT_H
   #include <sys/select.h>
   #endif
  @@ -46,7 +46,7 @@
   #include <sys/uio.h>
   #endif
   
  -#if defined(__INCLUDE_NETWORKING)
  +#if defined(HAVE_REPLICATION_THREADS)
   #ifdef HAVE_SYS_SOCKET_H
   #include <sys/socket.h>
   #endif
  @@ -72,44 +72,43 @@
   #include <string.h>
   #include <unistd.h>
   
  -#if defined(__INCLUDE_DIRECTORY)
  -#if HAVE_DIRENT_H
  -# include <dirent.h>
  -# define NAMLEN(dirent) strlen((dirent)->d_name)
  -#else
  -# define dirent direct
  -# define NAMLEN(dirent) (dirent)->d_namlen
  -# if HAVE_SYS_NDIR_H
  -#  include <sys/ndir.h>
  -# endif
  -# if HAVE_SYS_DIR_H
  -#  include <sys/dir.h>
  -# endif
  -# if HAVE_NDIR_H
  -#  include <ndir.h>
  -# endif
  -#endif
  -#endif /* __INCLUDE_DIRECTORY */
  -
   #endif /* !HAVE_SYSTEM_INCLUDE_FILES */
   
   #ifdef DB_WIN32
   #include "dbinc/win_db.h"
   #endif
   
  +#ifdef HAVE_DBM
  +#undef	DB_DBM_HSEARCH
  +#define	DB_DBM_HSEARCH 1
  +#endif
  +
   #include "db.h"
   #include "clib_port.h"
   
   #include "dbinc/queue.h"
   #include "dbinc/shqueue.h"
  +#include "dbinc/perfmon.h"
   
   #if defined(__cplusplus)
   extern "C" {
   #endif
   
  +/*
  + * The Windows compiler needs to be told about structures that are available
  + * outside a dll.
  + */
  +#if defined(DB_WIN32) && defined(_MSC_VER) && \
  +    !defined(DB_CREATE_DLL) && !defined(_LIB)
  +#define	__DB_IMPORT __declspec(dllimport)
  +#else
  +#define	__DB_IMPORT
  +#endif
  +
   /*******************************************************
    * Forward structure declarations.
    *******************************************************/
  +struct __db_commit_info; typedef struct __db_commit_info DB_COMMIT_INFO;
   struct __db_reginfo_t;	typedef struct __db_reginfo_t REGINFO;
   struct __db_txnhead;	typedef struct __db_txnhead DB_TXNHEAD;
   struct __db_txnlist;	typedef struct __db_txnlist DB_TXNLIST;
  @@ -117,6 +116,24 @@
   struct __vrfy_dbinfo;   typedef struct __vrfy_dbinfo VRFY_DBINFO;
   struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO;
   
  +struct __db_log_verify_info;
  +struct __txn_verify_info;
  +struct __lv_filereg_info;
  +struct __lv_ckp_info;
  +struct __lv_timestamp_info;
  +typedef struct __db_log_verify_info DB_LOG_VRFY_INFO;
  +typedef struct __txn_verify_info VRFY_TXN_INFO;
  +typedef struct __lv_filereg_info VRFY_FILEREG_INFO;
  +typedef struct __lv_filelife VRFY_FILELIFE;
  +typedef struct __lv_ckp_info VRFY_CKP_INFO;
  +typedef struct __lv_timestamp_info VRFY_TIMESTAMP_INFO;
  +
  +/*
  + * TXNINFO_HANDLER --
  + *	Callback function pointer type for __iterate_txninfo.
  + */
  +typedef int (*TXNINFO_HANDLER) __P((DB_LOG_VRFY_INFO *, VRFY_TXN_INFO *, void *));
  +
   typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB;
   
   /*******************************************************
  @@ -139,6 +156,12 @@
   
   #define	RECNO_OOB	0		/* Illegal record number. */
   
  +/*
  + * Define a macro which has no runtime effect, yet avoids triggering empty
  + * statement compiler warnings. Use it as the text of conditionally-null macros.
  + */
  +#define	NOP_STATEMENT	do { } while (0)
  +
   /* Test for a power-of-two (tests true for zero, which doesn't matter here). */
   #define	POWER_OF_TWO(x)	(((x) & ((x) - 1)) == 0)
   
  @@ -168,6 +191,14 @@
   	(void *)(((uintptr_t)(p) + (bound) - 1) & ~(((uintptr_t)(bound)) - 1))
   
   /*
  + * Berkeley DB uses the va_copy macro from C99, not all compilers include
  + * it, so add a dumb implementation compatible with pre C99 implementations.
  + */
  +#ifndef	va_copy
  +#define	va_copy(d, s)	((d) = (s))
  +#endif
  +
  +/*
    * Print an address as a u_long (a u_long is the largest type we can print
    * portably).  Most 64-bit systems have made longs 64-bits, so this should
    * work.
  @@ -242,10 +273,47 @@
   #undef	STAT
   #ifdef	HAVE_STATISTICS
   #define	STAT(x)	x
  +#define	STAT_ADJUST(env, cat, id, val, amount)		\
  +	do {						\
  +		(val) += (amount);			\
  +		STAT_PERFMON1((env), cat, id, (val));	\
  +	} while (0)
  +#define	STAT_INC(env, cat, id, val) 			\
  +	 STAT_ADJUST(env, cat, id, val, 1) 
  +#define	STAT_DEC(env, cat, id, val) 			\
  +	 STAT_ADJUST(env, cat, id, val, -1)
  +#define	STAT_SET(env, cat, id, val, newwal) 		\
  +	do {						\
  +		(val) = (newval);			\
  +		STAT_PERFMON1((env), cat, id, (val));	\
  +	} while (0)
   #else
  -#define	STAT(x)
  +#define	STAT(x)					NOP_STATEMENT
  +#define	STAT_ADJUST(env, cat, id, val, amount)	NOP_STATEMENT
  +#define	STAT_INC(env, cat, id, val)		NOP_STATEMENT
  +#define	STAT_DEC(env, cat, id, val)		NOP_STATEMENT
  +#define	STAT_SET(env, cat, id, val, newwal)	NOP_STATEMENT
   #endif
   
  +/* 
  + * These macros are used when an error condition is first noticed. They allow
  + * one to be notified (via e.g. DTrace, SystemTap, ...) when an error occurs
  + * deep inside DB, rather than when it is returned back through the API.
  + *
  + * The second actual argument to these is the second part of the error or
  + * warning event name. They work when 'errcode' is a symbolic name e.g.
  + * EINVAL or DB_LOCK_DEALOCK, not a variable.  Noticing system call failures
  + * would be handled by tracing on syscall exit returning < 0.
  + */
  +#define	ERR_ORIGIN(env, errcode)        \
  +	(PERFMON0(env, error, errcode), errcode)
  +
  +#define	ERR_ORIGIN_MSG(env, errcode, msg)	\
  +	(PERFMON1(env, error, errcode, msg), errcode)
  +
  +#define	WARNING_ORIGIN(env, errcode)	\
  +	(PERFMON0(env, warning, errcode), errcode)
  +
   /*
    * Structure used for callback message aggregation.
    *
  @@ -268,6 +336,18 @@
   		DB_MSGBUF_INIT(a);					\
   	}								\
   } while (0)
  +#define	DB_MSGBUF_REP_FLUSH(env, a, diag_msg, regular_msg) do {		\
  +	if ((a)->buf != NULL) {						\
  +		if ((a)->cur != (a)->buf && diag_msg)			\
  +			__db_repmsg(env, "%s", (a)->buf);		\
  +		if (regular_msg)					\
  +			DB_MSGBUF_FLUSH(env, a);			\
  +		else {							\
  +			__os_free(env, (a)->buf);			\
  +			DB_MSGBUF_INIT(a);				\
  +		}							\
  +	}								\
  +} while (0)
   #define	STAT_FMT(msg, fmt, type, v) do {				\
   	DB_MSGBUF __mb;							\
   	DB_MSGBUF_INIT(&__mb);						\
  @@ -336,6 +416,10 @@
   				    (ret) == DB_REP_NEWSITE || \
   				    (ret) == DB_REP_NOTPERM)
   #define	DB_RETOK_REPMGR_START(ret) ((ret) == 0 || (ret) == DB_REP_IGNORE)
  +#define	DB_RETOK_TXNAPPLIED(ret) ((ret) == 0 || \
  +				    (ret) == DB_NOTFOUND ||		\
  +				    (ret) == DB_TIMEOUT ||		\
  +				    (ret) == DB_KEYEMPTY)
   
   /* Find a reasonable operation-not-supported error. */
   #ifdef	EOPNOTSUPP
  @@ -485,11 +569,11 @@
   		CHECK_THREAD(env);					\
   } while (0)
   #else
  -#define	CHECK_MTX_THREAD(env, mtx)
  +#define	CHECK_MTX_THREAD(env, mtx)	NOP_STATEMENT
   #endif
   #else
  -#define	CHECK_THREAD(env)
  -#define	CHECK_MTX_THREAD(env, mtx)
  +#define	CHECK_THREAD(env)		NOP_STATEMENT
  +#define	CHECK_MTX_THREAD(env, mtx)	NOP_STATEMENT
   #endif
   
   typedef enum {
  @@ -625,6 +709,10 @@
   	int (*dbt_usercopy)
   	    __P((DBT *, u_int32_t, void *, u_int32_t, u_int32_t));
   
  +	int (*log_verify_wrap) __P((ENV *, const char *, u_int32_t,  
  +	    const char *, const char *, time_t, time_t, u_int32_t,  u_int32_t,
  +	    u_int32_t, u_int32_t, int, int));
  +
   	REGINFO	*reginfo;		/* REGINFO structure reference */
   
   #define	DB_TEST_ELECTINIT	 1	/* after __rep_elect_init */
  @@ -636,7 +724,8 @@
   #define	DB_TEST_POSTSYNC	 7	/* after syncing the log */
   #define	DB_TEST_PREDESTROY	 8	/* before destroy op */
   #define	DB_TEST_PREOPEN		 9	/* before __os_open */
  -#define	DB_TEST_SUBDB_LOCKS	 10	/* subdb locking tests */
  +#define	DB_TEST_REPMGR_PERM	 10	/* repmgr perm/archiving tests */
  +#define	DB_TEST_SUBDB_LOCKS	 11	/* subdb locking tests */
   	int	test_abort;		/* Abort value for testing */
   	int	test_check;		/* Checkpoint value for testing */
   	int	test_copy;		/* Copy value for testing */
  @@ -709,7 +798,7 @@
   };
   
   /* Actions that __db_master_update can take. */
  -typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
  +typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN, MU_MOVE } mu_action;
   
   /*
    * Access-method-common macro for determining whether a cursor
  @@ -759,6 +848,11 @@
   		(dbc)->rdata = &(dbc)->my_rdata;	\
   	} while (0)
   
  +#define	COMPACT_TRUNCATE(c_data) do {			\
  +	if (c_data->compact_truncate > 1)		\
  +		c_data->compact_truncate--;		\
  +} while (0)
  +
   /*******************************************************
    * Mpool.
    *******************************************************/
  @@ -813,10 +907,10 @@
    */
   
   #define	LOG_COMPARE(lsn0, lsn1)						\
  -    ((lsn0)->file != (lsn1)->file ?					\
  -    ((lsn0)->file < (lsn1)->file ? -1 : 1) :				\
  -    ((lsn0)->offset != (lsn1)->offset ?					\
  -    ((lsn0)->offset < (lsn1)->offset ? -1 : 1) : 0))
  +	((lsn0)->file != (lsn1)->file ?					\
  +	((lsn0)->file < (lsn1)->file ? -1 : 1) :			\
  +	((lsn0)->offset != (lsn1)->offset ?				\
  +	((lsn0)->offset < (lsn1)->offset ? -1 : 1) : 0))
   
   /*******************************************************
    * Txn.
  @@ -825,7 +919,7 @@
   #define	NOWAIT_FLAG(txn) \
   	((txn) != NULL && F_ISSET((txn), TXN_NOWAIT) ? DB_LOCK_NOWAIT : 0)
   #define	IS_REAL_TXN(txn)						\
  -	((txn) != NULL && !F_ISSET(txn, TXN_CDSGROUP))
  +	((txn) != NULL && !F_ISSET(txn, TXN_FAMILY))
   #define	IS_SUBTRANSACTION(txn)						\
   	((txn) != NULL && (txn)->parent != NULL)
   
  @@ -838,7 +932,7 @@
   /*******************************************************
    * Compression
    *******************************************************/
  -#define CMP_INT_SPARE_VAL	0xFC	/* Smallest byte value that the integer
  +#define	CMP_INT_SPARE_VAL	0xFC	/* Smallest byte value that the integer
   					   compression algorithm doesn't use */
   
   /*******************************************************
  @@ .
  rm -f db/build_windows/db_java.dsp <<'@@ .'
  Index: db/build_windows/db_java.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_java.dsp.postbuild <<'@@ .'
  Index: db/build_windows/db_java.dsp.postbuild
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_java_xa.dsp <<'@@ .'
  Index: db/build_windows/db_java_xa.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_java_xaj.mak <<'@@ .'
  Index: db/build_windows/db_java_xaj.mak
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_load.dsp <<'@@ .'
  Index: db/build_windows/db_load.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_printlog.dsp <<'@@ .'
  Index: db/build_windows/db_printlog.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_recover.dsp <<'@@ .'
  Index: db/build_windows/db_recover.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_small.dsp <<'@@ .'
  Index: db/build_windows/db_small.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_stat.dsp <<'@@ .'
  Index: db/build_windows/db_stat.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_static.dsp <<'@@ .'
  Index: db/build_windows/db_static.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_tcl.dsp <<'@@ .'
  Index: db/build_windows/db_tcl.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_test.dsp <<'@@ .'
  Index: db/build_windows/db_test.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_upgrade.dsp <<'@@ .'
  Index: db/build_windows/db_upgrade.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/db_verify.dsp <<'@@ .'
  Index: db/build_windows/db_verify.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/dbkill.cpp
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 dbkill.cpp
  --- db/build_windows/dbkill.cpp	16 Sep 2009 19:34:43 -0000	1.4
  +++ db/build_windows/dbkill.cpp	23 Aug 2010 13:36:33 -0000	1.4.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1999-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1999, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  rm -f db/build_windows/dynamic_dsp.src <<'@@ .'
  Index: db/build_windows/dynamic_dsp.src
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_access.dsp <<'@@ .'
  Index: db/build_windows/ex_access.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_btrec.dsp <<'@@ .'
  Index: db/build_windows/ex_btrec.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_csvcode.dsp <<'@@ .'
  Index: db/build_windows/ex_csvcode.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_csvcode.dsp.postbuild <<'@@ .'
  Index: db/build_windows/ex_csvcode.dsp.postbuild
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_csvload.dsp <<'@@ .'
  Index: db/build_windows/ex_csvload.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_csvquery.dsp <<'@@ .'
  Index: db/build_windows/ex_csvquery.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_env.dsp <<'@@ .'
  Index: db/build_windows/ex_env.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_lock.dsp <<'@@ .'
  Index: db/build_windows/ex_lock.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_mpool.dsp <<'@@ .'
  Index: db/build_windows/ex_mpool.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_rep_base.dsp <<'@@ .'
  Index: db/build_windows/ex_rep_base.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_rep_mgr.dsp <<'@@ .'
  Index: db/build_windows/ex_rep_mgr.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_sequence.dsp <<'@@ .'
  Index: db/build_windows/ex_sequence.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_tpcb.dsp <<'@@ .'
  Index: db/build_windows/ex_tpcb.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_txnguide.dsp <<'@@ .'
  Index: db/build_windows/ex_txnguide.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/ex_txnguide_inmem.dsp <<'@@ .'
  Index: db/build_windows/ex_txnguide_inmem.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/example_database_load.dsp <<'@@ .'
  Index: db/build_windows/example_database_load.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/example_database_read.dsp <<'@@ .'
  Index: db/build_windows/example_database_read.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_access.dsp <<'@@ .'
  Index: db/build_windows/excxx_access.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_btrec.dsp <<'@@ .'
  Index: db/build_windows/excxx_btrec.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_env.dsp <<'@@ .'
  Index: db/build_windows/excxx_env.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_example_database_load.dsp <<'@@ .'
  Index: db/build_windows/excxx_example_database_load.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_example_database_read.dsp <<'@@ .'
  Index: db/build_windows/excxx_example_database_read.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_lock.dsp <<'@@ .'
  Index: db/build_windows/excxx_lock.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_mpool.dsp <<'@@ .'
  Index: db/build_windows/excxx_mpool.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_repquote.dsp <<'@@ .'
  Index: db/build_windows/excxx_repquote.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_sequence.dsp <<'@@ .'
  Index: db/build_windows/excxx_sequence.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_tpcb.dsp <<'@@ .'
  Index: db/build_windows/excxx_tpcb.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_txnguide.dsp <<'@@ .'
  Index: db/build_windows/excxx_txnguide.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/excxx_txnguide_inmem.dsp <<'@@ .'
  Index: db/build_windows/excxx_txnguide_inmem.dsp
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/include.tcl
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 include.tcl
  --- db/build_windows/include.tcl	16 Sep 2009 19:34:43 -0000	1.4
  +++ db/build_windows/include.tcl	23 Aug 2010 13:36:35 -0000	1.4.2.1
  @@ -2,7 +2,7 @@
   
   set tclsh_path SET_YOUR_TCLSH_PATH
   set buildpath Win32/Debug
  -set tcllib libdb_tcl48d.dll
  +set tcllib libdb_tcl50d.dll
   
   set src_root ..
   set test_path ../test
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/libdb.def
  ============================================================================
  $ cvs diff -u -r1.5 -r1.5.2.1 libdb.def
  --- db/build_windows/libdb.def	7 Jan 2010 22:02:22 -0000	1.5
  +++ db/build_windows/libdb.def	23 Aug 2010 13:36:35 -0000	1.5.2.1
  @@ -9,196 +9,212 @@
   	db_sequence_create	@6
   	db_strerror	@7
   	db_version	@8
  -	log_compare	@9
  -	__db_dbm_close	@10
  -	__db_dbm_delete	@11
  -	__db_dbm_fetch	@12
  -	__db_dbm_firstkey	@13
  -	__db_dbm_init	@14
  -	__db_dbm_nextkey	@15
  -	__db_dbm_store	@16
  -	__db_get_flags_fn	@17
  -	__db_get_seq_flags_fn	@18
  -	__db_hcreate	@19
  -	__db_hdestroy	@20
  -	__db_hsearch	@21
  -	__db_loadme	@22
  -	__db_ndbm_clearerr	@23
  -	__db_ndbm_close	@24
  -	__db_ndbm_delete	@25
  -	__db_ndbm_dirfno	@26
  -	__db_ndbm_error	@27
  -	__db_ndbm_fetch	@28
  -	__db_ndbm_firstkey	@29
  -	__db_ndbm_nextkey	@30
  -	__db_ndbm_open	@31
  -	__db_ndbm_pagfno	@32
  -	__db_ndbm_rdonly	@33
  -	__db_ndbm_store	@34
  -	__db_win32_mutex_lock	@35
  -	__db_win32_mutex_unlock	@36
  -	__env_panic	@37
  -	__ham_func2	@38
  -	__ham_func3	@39
  -	__ham_func4	@40
  -	__ham_func5	@41
  -	__ham_test	@42
  -	__lock_id_set	@43
  -	__os_calloc	@44
  -	__os_closehandle	@45
  -	__os_dirfree	@46
  -	__os_dirlist	@47
  -	__os_free	@48
  -	__os_fsync	@49
  -	__os_get_syserr	@50
  -	__os_getenv	@51
  -	__os_ioinfo	@52
  -	__os_malloc	@53
  -	__os_mkdir	@54
  -	__os_open	@55
  -	__os_openhandle	@56
  -	__os_posix_err	@57
  -	__os_read	@58
  -	__os_realloc	@59
  -	__os_rename	@60
  -	__os_strdup	@61
  -	__os_umalloc	@62
  -	__os_unlink	@63
  -	__os_write	@64
  -	__txn_id_set	@65
  -	__bam_adj_read	@66
  -	__bam_cadjust_read	@67
  -	__bam_cdel_read	@68
  -	__bam_curadj_read	@69
  -	__bam_merge_44_read	@70
  -	__bam_merge_read	@71
  -	__bam_pgin	@72
  -	__bam_pgno_read	@73
  -	__bam_pgout	@74
  -	__bam_rcuradj_read	@75
  -	__bam_relink_43_read	@76
  -	__bam_relink_read	@77
  -	__bam_repl_read	@78
  -	__bam_root_read	@79
  -	__bam_rsplit_read	@80
  -	__bam_split_read	@81
  -	__bam_split_42_read	@82
  -	__config_split	@83
  -	__crdel_inmem_create_read	@84
  -	__crdel_inmem_remove_read	@85
  -	__crdel_inmem_rename_read	@86
  -	__crdel_metasub_read	@87
  -	__db_Cstrsep	@88
  -	__db_add_recovery_int	@89
  -	__db_addrem_read	@90
  -	__db_big_read	@91
  -	__db_cksum_read	@92
  -	__db_compress_count_int	@93
  -	__db_compress_int	@94
  -	__db_debug_read	@95
  -	__db_decompress_count_int	@96
  -	__db_decompress_int	@97
  -	__db_decompress_int32	@98
  -	__db_dispatch	@99
  -	__db_dl	@100
  -	__db_dumptree	@101
  -	__db_err	@102
  -	__db_errx	@103
  -	__db_getlong	@104
  -	__db_getulong	@105
  -	__db_global_values	@106
  -	__db_isbigendian	@107
  -	__db_mkpath	@108
  -	__db_msg	@109
  -	__db_noop_read	@110
  -	__db_ovref_read	@111
  -	__db_pg_alloc_42_read	@112
  -	__db_pg_alloc_read	@113
  -	__db_pg_free_42_read	@114
  -	__db_pg_free_read	@115
  -	__db_pg_freedata_42_read	@116
  -	__db_pg_freedata_read	@117
  -	__db_pg_init_read	@118
  -	__db_pg_sort_44_read	@119
  -	__db_pg_trunc_read	@120
  -	__db_pgin	@121
  -	__db_pgout	@122
  -	__db_pr_callback	@123
  -	__db_relink_42_read	@124
  -	__db_rpath	@125
  -	__db_stat_pp	@126
  -	__db_stat_print_pp	@127
  -	__db_util_cache	@128
  -	__db_util_interrupted	@129
  -	__db_util_logset	@130
  -	__db_util_siginit	@131
  -	__db_util_sigresend	@132
  -	__db_verify_internal	@133
  -	__dbt_usercopy	@134
  -	__dbt_userfree	@135
  -	__dbreg_register_read	@136
  -	__fop_create_42_read	@137
  -	__fop_create_read	@138
  -	__fop_file_remove_read	@139
  -	__fop_remove_read	@140
  -	__fop_rename_42_read	@141
  -	__fop_rename_read	@142
  -	__fop_write_42_read	@143
  -	__fop_write_read	@144
  -	__ham_chgpg_read	@145
  -	__ham_copypage_read	@146
  -	__ham_curadj_read	@147
  -	__ham_get_meta	@148
  -	__ham_groupalloc_42_read	@149
  -	__ham_groupalloc_read	@150
  -	__ham_insdel_read	@151
  -	__ham_metagroup_42_read	@152
  -	__ham_metagroup_read	@153
  -	__ham_newpage_read	@154
  -	__ham_pgin	@155
  -	__ham_pgout	@156
  -	__ham_release_meta	@157
  -	__ham_replace_read	@158
  -	__ham_splitdata_read	@159
  -	__lock_list_print	@160
  -	__log_stat_pp	@161
  -	__mutex_set_wait_info	@162
  -	__os_abort	@163
  -	__os_abspath	@164
  -	__os_cpu_count	@165
  -	__os_ctime	@166
  -	__os_exists	@167
  -	__os_fdlock	@168
  -	__os_fileid	@169
  -	__os_freeaddrinfo	@170
  -	__os_get_errno	@171
  -	__os_getaddrinfo	@172
  -	__os_gettime	@173
  -	__os_id	@174
  -	__os_io	@175
  -	__os_isroot	@176
  -	__os_mapfile	@177
  -	__os_physwrite	@178
  -	__os_seek	@179
  -	__os_set_errno	@180
  -	__os_truncate	@181
  -	__os_ufree	@182
  -	__os_unique_id	@183
  -	__os_unmapfile	@184
  -	__os_urealloc	@185
  -	__os_yield	@186
  -	__qam_add_read	@187
  -	__qam_del_read	@188
  -	__qam_delext_read	@189
  -	__qam_incfirst_read	@190
  -	__qam_mvptr_read	@191
  -	__qam_pgin_out	@192
  -	__rep_stat_print	@193
  -	__txn_child_read	@194
  -	__txn_ckp_42_read	@195
  -	__txn_ckp_read	@196
  -	__txn_prepare_read	@197
  -	__txn_recycle_read	@198
  -	__txn_regop_42_read	@199
  -	__txn_regop_read	@200
  -	__txn_xa_regop_42_read	@201
  +	db_full_version	@9
  +	log_compare	@10
  +	__db_dbm_close	@11
  +	__db_dbm_delete	@12
  +	__db_dbm_fetch	@13
  +	__db_dbm_firstkey	@14
  +	__db_dbm_init	@15
  +	__db_dbm_nextkey	@16
  +	__db_dbm_store	@17
  +	__db_get_flags_fn	@18
  +	__db_get_seq_flags_fn	@19
  +	__db_hcreate	@20
  +	__db_hdestroy	@21
  +	__db_hsearch	@22
  +	__db_loadme	@23
  +	__db_ndbm_clearerr	@24
  +	__db_ndbm_close	@25
  +	__db_ndbm_delete	@26
  +	__db_ndbm_dirfno	@27
  +	__db_ndbm_error	@28
  +	__db_ndbm_fetch	@29
  +	__db_ndbm_firstkey	@30
  +	__db_ndbm_nextkey	@31
  +	__db_ndbm_open	@32
  +	__db_ndbm_pagfno	@33
  +	__db_ndbm_rdonly	@34
  +	__db_ndbm_store	@35
  +	__db_win32_mutex_lock	@36
  +	__db_win32_mutex_unlock	@37
  +	__env_panic	@38
  +	__ham_func2	@39
  +	__ham_func3	@40
  +	__ham_func4	@41
  +	__ham_func5	@42
  +	__ham_test	@43
  +	__lock_id_set	@44
  +	__mutex_alloc	@45
  +	__mutex_free	@46
  +	__os_calloc	@47
  +	__os_closehandle	@48
  +	__os_dirfree	@49
  +	__os_dirlist	@50
  +	__os_free	@51
  +	__os_fsync	@52
  +	__os_get_syserr	@53
  +	__os_getenv	@54
  +	__os_ioinfo	@55
  +	__os_malloc	@56
  +	__os_mkdir	@57
  +	__os_open	@58
  +	__os_openhandle	@59
  +	__os_posix_err	@60
  +	__os_read	@61
  +	__os_realloc	@62
  +	__os_rename	@63
  +	__os_strdup	@64
  +	__os_umalloc	@65
  +	__os_unlink	@66
  +	__os_write	@67
  +	__txn_id_set	@68
  +	__bam_adj_desc	@69
  +	__bam_cadjust_desc	@70
  +	__bam_cdel_desc	@71
  +	__bam_curadj_desc	@72
  +	__bam_irep_desc	@73
  +	__bam_merge_44_desc	@74
  +	__bam_pgin	@75
  +	__bam_pgout	@76
  +	__bam_rcuradj_desc	@77
  +	__bam_relink_43_desc	@78
  +	__bam_repl_desc	@79
  +	__bam_root_desc	@80
  +	__bam_rsplit_desc	@81
  +	__bam_split_42_desc	@82
  +	__bam_split_48_desc	@83
  +	__bam_split_desc	@84
  +	__config_split	@85
  +	__crdel_inmem_create_desc	@86
  +	__crdel_inmem_remove_desc	@87
  +	__crdel_inmem_rename_desc	@88
  +	__crdel_metasub_desc	@89
  +	__db_Cstrsep	@90
  +	__db_add_recovery_int	@91
  +	__db_addrem_42_desc	@92
  +	__db_addrem_desc	@93
  +	__db_big_42_desc	@94
  +	__db_big_desc	@95
  +	__db_cksum_desc	@96
  +	__db_close	@97
  +	__db_compress_count_int	@98
  +	__db_compress_int	@99
  +	__db_debug_desc	@100
  +	__db_decompress_count_int	@101
  +	__db_decompress_int	@102
  +	__db_decompress_int32	@103
  +	__db_dispatch	@104
  +	__db_dl	@105
  +	__db_dumptree	@106
  +	__db_err	@107
  +	__db_errx	@108
  +	__db_getlong	@109
  +	__db_getulong	@110
  +	__db_global_values	@111
  +	__db_isbigendian	@112
  +	__db_merge_desc	@113
  +	__db_mkpath	@114
  +	__db_msg	@115
  +	__db_noop_desc	@116
  +	__db_ovref_desc	@117
  +	__db_pg_alloc_42_desc	@118
  +	__db_pg_alloc_desc	@119
  +	__db_pg_free_42_desc	@120
  +	__db_pg_free_desc	@121
  +	__db_pg_freedata_42_desc	@122
  +	__db_pg_freedata_desc	@123
  +	__db_pg_init_desc	@124
  +	__db_pg_sort_44_desc	@125
  +	__db_pg_trunc_desc	@126
  +	__db_pgin	@127
  +	__db_pgno_desc	@128
  +	__db_pgout	@129
  +	__db_pr_callback	@130
  +	__db_realloc_desc	@131
  +	__db_relink_42_desc	@132
  +	__db_relink_desc	@133
  +	__db_rpath	@134
  +	__db_stat_pp	@135
  +	__db_stat_print_pp	@136
  +	__db_util_cache	@137
  +	__db_util_interrupted	@138
  +	__db_util_logset	@139
  +	__db_util_siginit	@140
  +	__db_util_sigresend	@141
  +	__db_verify_internal	@142
  +	__dbreg_register_desc	@143
  +	__dbt_usercopy	@144
  +	__dbt_userfree	@145
  +	__fop_create_42_desc	@146
  +	__fop_create_desc	@147
  +	__fop_file_remove_desc	@148
  +	__fop_remove_desc	@149
  +	__fop_rename_42_desc	@150
  +	__fop_rename_desc	@151
  +	__fop_write_42_desc	@152
  +	__fop_write_desc	@153
  +	__ham_changeslot_desc	@154
  +	__ham_chgpg_desc	@155
  +	__ham_contract_desc	@156
  +	__ham_copypage_desc	@157
  +	__ham_curadj_desc	@158
  +	__ham_get_meta	@159
  +	__ham_groupalloc_42_desc	@160
  +	__ham_groupalloc_desc	@161
  +	__ham_insdel_42_desc	@162
  +	__ham_insdel_desc	@163
  +	__ham_metagroup_42_desc	@164
  +	__ham_metagroup_desc	@165
  +	__ham_newpage_desc	@166
  +	__ham_pgin	@167
  +	__ham_pgout	@168
  +	__ham_release_meta	@169
  +	__ham_replace_42_desc	@170
  +	__ham_replace_desc	@171
  +	__ham_splitdata_desc	@172
  +	__lock_list_print	@173
  +	__log_print_record	@174
  +	__log_stat_pp	@175
  +	__log_verify_pp	@176
  +	__log_verify	@177
  +	__mutex_set_wait_info	@178
  +	__os_abort	@179
  +	__os_abspath	@180
  +	__os_cpu_count	@181
  +	__os_ctime	@182
  +	__os_exists	@183
  +	__os_fdlock	@184
  +	__os_fileid	@185
  +	__os_freeaddrinfo	@186
  +	__os_get_errno	@187
  +	__os_getaddrinfo	@188
  +	__os_gettime	@189
  +	__os_id	@190
  +	__os_io	@191
  +	__os_isroot	@192
  +	__os_mapfile	@193
  +	__os_physwrite	@194
  +	__os_seek	@195
  +	__os_set_errno	@196
  +	__os_truncate	@197
  +	__os_ufree	@198
  +	__os_unique_id	@199
  +	__os_unmapfile	@200
  +	__os_urealloc	@201
  +	__os_yield	@202
  +	__qam_add_desc	@203
  +	__qam_del_desc	@204
  +	__qam_delext_desc	@205
  +	__qam_incfirst_desc	@206
  +	__qam_mvptr_desc	@207
  +	__qam_pgin_out	@208
  +	__rep_stat_print	@209
  +	__txn_child_desc	@210
  +	__txn_ckp_42_desc	@211
  +	__txn_ckp_desc	@212
  +	__txn_prepare_desc	@213
  +	__txn_recycle_desc	@214
  +	__txn_regop_42_desc	@215
  +	__txn_regop_desc	@216
  +	__txn_xa_regop_42_desc	@217
  @@ .
  patch -p0 <<'@@ .'
  Index: db/build_windows/libdb.rc
  ============================================================================
  $ cvs diff -u -r1.7 -r1.7.2.1 libdb.rc
  --- db/build_windows/libdb.rc	7 Jan 2010 22:02:22 -0000	1.7
  +++ db/build_windows/libdb.rc	23 Aug 2010 13:36:35 -0000	1.7.2.1
  @@ -1,6 +1,6 @@
   1 VERSIONINFO
  - FILEVERSION 4,0,8,26
  - PRODUCTVERSION 4,0,8,26
  + FILEVERSION 5,0,0,26
  + PRODUCTVERSION 5,0,0,26
    FILEFLAGSMASK 0x3fL
   #ifdef _DEBUG
    FILEFLAGS 0x1L
  @@ -17,13 +17,13 @@
           BLOCK "040904b0"
           BEGIN
               VALUE "CompanyName", "Oracle\0"
  -            VALUE "FileDescription", "Berkeley DB 4.8 DLL\0"
  -            VALUE "FileVersion", "4.8.26\0"
  -            VALUE "InternalName", "libdb48.dll\0"
  +            VALUE "FileDescription", "Berkeley DB 5.0 DLL\0"
  +            VALUE "FileVersion", "5.0.26\0"
  +            VALUE "InternalName", "libdb50.dll\0"
               VALUE "LegalCopyright", "Copyright © Oracle 1997-2009\0"
  -            VALUE "OriginalFilename", "libdb48.dll\0"
  +            VALUE "OriginalFilename", "libdb50.dll\0"
               VALUE "ProductName", "Oracle libdb\0"
  -            VALUE "ProductVersion", "4.8.26\0"
  +            VALUE "ProductVersion", "5.0.26\0"
           END
       END
       BLOCK "VarFileInfo"
  @@ .
  rm -f db/build_windows/srcfile_dsp.src <<'@@ .'
  Index: db/build_windows/srcfile_dsp.src
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  rm -f db/build_windows/static_dsp.src <<'@@ .'
  Index: db/build_windows/static_dsp.src
  ============================================================================
  [NO CHANGE SUMMARY BECAUSE FILE AS A WHOLE IS JUST REMOVED]
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/getcwd.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 getcwd.c
  --- db/clib/getcwd.c	16 Sep 2009 19:34:47 -0000	1.9
  +++ db/clib/getcwd.c	23 Aug 2010 13:36:38 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1989, 1991, 1993
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/getopt.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 getopt.c
  --- db/clib/getopt.c	16 Sep 2009 19:34:47 -0000	1.9
  +++ db/clib/getopt.c	23 Aug 2010 13:36:38 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1987, 1993, 1994
  @@ -34,9 +34,17 @@
    * $Id$
    */
   
  -#include "db_config.h"
  -
  -#include "db_int.h"
  +/* 
  + * Avoid inclusion of internal header files as this
  + * file is used by example code.
  + *
  + * Unconditional inclusion of stdio and string are
  + * OK in this file.  It will work on all platforms
  + * for which this file is used
  + */
  +extern char *__db_rpath(const char *);
  +#include <stdio.h>
  +#include <string.h>
   
   int	__db_getopt_reset;	/* global reset for VxWorks. */
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/isalpha.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 isalpha.c
  --- db/clib/isalpha.c	16 Sep 2009 19:34:47 -0000	1.4
  +++ db/clib/isalpha.c	23 Aug 2010 13:36:38 -0000	1.4.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2005-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2005, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/isdigit.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 isdigit.c
  --- db/clib/isdigit.c	16 Sep 2009 19:34:47 -0000	1.4
  +++ db/clib/isdigit.c	23 Aug 2010 13:36:38 -0000	1.4.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2005-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2005, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/isprint.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 isprint.c
  --- db/clib/isprint.c	16 Sep 2009 19:34:47 -0000	1.4
  +++ db/clib/isprint.c	23 Aug 2010 13:36:38 -0000	1.4.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2005-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2005, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/isspace.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 isspace.c
  --- db/clib/isspace.c	16 Sep 2009 19:34:47 -0000	1.4
  +++ db/clib/isspace.c	23 Aug 2010 13:36:38 -0000	1.4.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2005-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2005, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/memcmp.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 memcmp.c
  --- db/clib/memcmp.c	16 Sep 2009 19:34:47 -0000	1.9
  +++ db/clib/memcmp.c	23 Aug 2010 13:36:38 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/memmove.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 memmove.c
  --- db/clib/memmove.c	16 Sep 2009 19:34:47 -0000	1.9
  +++ db/clib/memmove.c	23 Aug 2010 13:36:38 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/printf.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 printf.c
  --- db/clib/printf.c	16 Sep 2009 19:34:47 -0000	1.4
  +++ db/clib/printf.c	23 Aug 2010 13:36:38 -0000	1.4.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2005-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2005, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/raise.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 raise.c
  --- db/clib/raise.c	16 Sep 2009 19:34:47 -0000	1.9
  +++ db/clib/raise.c	23 Aug 2010 13:36:38 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/snprintf.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 snprintf.c
  --- db/clib/snprintf.c	16 Sep 2009 19:34:47 -0000	1.9
  +++ db/clib/snprintf.c	23 Aug 2010 13:36:38 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/clib/strerror.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 strerror.c
  --- db/clib/strerror.c	16 Sep 2009 19:34:47 -0000	1.9
  +++ db/clib/strerror.c	23 Aug 2010 13:36:38 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1988, 1993
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/crypto_stub.c
  ============================================================================
  $ cvs diff -u -r1.8 -r1.8.2.1 crypto_stub.c
  --- db/common/crypto_stub.c	16 Sep 2009 19:34:48 -0000	1.8
  +++ db/common/crypto_stub.c	23 Aug 2010 13:36:39 -0000	1.8.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/db_byteorder.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 db_byteorder.c
  --- db/common/db_byteorder.c	16 Sep 2009 19:34:48 -0000	1.9
  +++ db/common/db_byteorder.c	23 Aug 2010 13:36:39 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/db_err.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 db_err.c
  --- db/common/db_err.c	16 Sep 2009 19:34:48 -0000	1.9
  +++ db/common/db_err.c	23 Aug 2010 13:36:39 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,6 @@
   #include "dbinc/db_page.h"
   #include "dbinc/db_am.h"
   #include "dbinc/lock.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   #include "dbinc/txn.h"
   
  @@ -281,6 +280,8 @@
   		return ("DB_LOCK_NOTGRANTED: Lock not granted");
   	case DB_LOG_BUFFER_FULL:
   		return ("DB_LOG_BUFFER_FULL: In-memory log buffer is full");
  +	case DB_LOG_VERIFY_BAD:
  +		return ("DB_LOG_VERIFY_BAD: Log verification failed");
   	case DB_NOSERVER:
   		return ("DB_NOSERVER: Fatal error, no RPC server");
   	case DB_NOSERVER_HOME:
  @@ -323,6 +324,8 @@
   	case DB_SECONDARY_BAD:
   		return
   	    ("DB_SECONDARY_BAD: Secondary index inconsistent with primary");
  +	case DB_TIMEOUT:
  +		return ("DB_TIMEOUT: Operation timed out");
   	case DB_VERIFY_BAD:
   		return ("DB_VERIFY_BAD: Database verification failed");
   	case DB_VERSION_MISMATCH:
  @@ -611,6 +614,36 @@
   }
   
   /*
  + * __db_repmsg --
  + *	Replication system message routine.
  + *
  + * PUBLIC: void __db_repmsg __P((const ENV *, const char *, ...))
  + * PUBLIC:    __attribute__ ((__format__ (__printf__, 2, 3)));
  + */
  +void
  +#ifdef STDC_HEADERS
  +__db_repmsg(const ENV *env, const char *fmt, ...)
  +#else
  +__db_repmsg(env, fmt, va_alist)
  +	const ENV *env;
  +	const char *fmt;
  +	va_dcl
  +#endif
  +{
  +	va_list ap;
  +	char buf[2048];		/* !!!: END OF THE STACK DON'T TRUST SPRINTF. */
  +
  +#ifdef STDC_HEADERS
  +	va_start(ap, fmt);
  +#else
  +	va_start(ap);
  +#endif
  +	(void)vsnprintf(buf, sizeof(buf), fmt, ap);
  +	__rep_msg(env, buf);
  +	va_end(ap);
  +}
  +
  +/*
    * __db_msgcall --
    *	Do the message work for callback functions.
    */
  @@ -722,7 +755,7 @@
   	int read_op;
   {
   	ENV *env;
  -	int isp, ret;
  +	int related, ret;
   
   	env = dbp->env;
   
  @@ -743,7 +776,11 @@
   	 *	a transaction handle in a non-transactional environment
   	 *	a transaction handle for a non-transactional database
   	 */
  -	if (txn == NULL || F_ISSET(txn, TXN_PRIVATE)) {
  +	if (!read_op && txn != NULL && F_ISSET(txn, TXN_READONLY)) {
  +		__db_errx(env,
  +		    "Read-only transaction cannot be used for an update");
  +		return (EINVAL);
  +	} else if (txn == NULL || F_ISSET(txn, TXN_PRIVATE)) {
   		if (dbp->cur_locker != NULL &&
   		    dbp->cur_locker->id >= TXN_MINIMUM)
   			goto open_err;
  @@ -753,15 +790,10 @@
   		    "Transaction not specified for a transactional database");
   			return (EINVAL);
   		}
  -	} else if (F_ISSET(txn, TXN_CDSGROUP)) {
  -		if (!CDB_LOCKING(env)) {
  -			__db_errx(env,
  -			    "CDS groups can only be used in a CDS environment");
  -			return (EINVAL);
  -		}
  +	} else if (F_ISSET(txn, TXN_FAMILY)) {
   		/*
  -		 * CDS group handles can be passed to any method, since they
  -		 * only determine locker IDs.
  +		 * Family transaction handles can be passed to any method,
  +		 * since they only determine locker IDs.
   		 */
   		return (0);
   	} else {
  @@ -776,13 +808,14 @@
   
   		if (F_ISSET(txn, TXN_DEADLOCK))
   			return (__db_txn_deadlock_err(env, txn));
  +
   		if (dbp->cur_locker != NULL &&
   		    dbp->cur_locker->id >= TXN_MINIMUM &&
   		     dbp->cur_locker->id != txn->txnid) {
  -			if ((ret = __lock_locker_is_parent(env,
  -			     dbp->cur_locker, txn->locker, &isp)) != 0)
  +			if ((ret = __lock_locker_same_family(env,
  +			     dbp->cur_locker, txn->locker, &related)) != 0)
   				return (ret);
  -			if (!isp)
  +			if (!related)
   				goto open_err;
   		}
   	}
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/db_getlong.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 db_getlong.c
  --- db/common/db_getlong.c	16 Sep 2009 19:34:48 -0000	1.10
  +++ db/common/db_getlong.c	23 Aug 2010 13:36:39 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/db_idspace.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 db_idspace.c
  --- db/common/db_idspace.c	16 Sep 2009 19:34:48 -0000	1.9
  +++ db/common/db_idspace.c	23 Aug 2010 13:36:39 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2001-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2001, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/db_log2.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 db_log2.c
  --- db/common/db_log2.c	16 Sep 2009 19:34:48 -0000	1.9
  +++ db/common/db_log2.c	23 Aug 2010 13:36:39 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1995, 1996
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/mkpath.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 mkpath.c
  --- db/common/mkpath.c	16 Sep 2009 19:34:48 -0000	1.4
  +++ db/common/mkpath.c	23 Aug 2010 13:36:39 -0000	1.4.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/util_arg.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 util_arg.c
  --- db/common/util_arg.c	16 Sep 2009 19:34:48 -0000	1.10
  +++ db/common/util_arg.c	23 Aug 2010 13:36:39 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2001-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2001, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/util_cache.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 util_cache.c
  --- db/common/util_cache.c	16 Sep 2009 19:34:48 -0000	1.9
  +++ db/common/util_cache.c	23 Aug 2010 13:36:39 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2000-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2000, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/util_log.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 util_log.c
  --- db/common/util_log.c	16 Sep 2009 19:34:48 -0000	1.9
  +++ db/common/util_log.c	23 Aug 2010 13:36:39 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2000-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2000, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/common/util_sig.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 util_sig.c
  --- db/common/util_sig.c	16 Sep 2009 19:34:48 -0000	1.9
  +++ db/common/util_sig.c	23 Aug 2010 13:36:39 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2000-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2000, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/crypto/aes_method.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 aes_method.c
  --- db/crypto/aes_method.c	16 Sep 2009 19:34:48 -0000	1.10
  +++ db/crypto/aes_method.c	23 Aug 2010 13:36:40 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2001-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2001, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * Some parts of this code originally written by Adam Stubblefield,
    * -- astubble@rice.edu.
  @@ -15,6 +15,10 @@
   #include "dbinc/crypto.h"
   #include "dbinc/hmac.h"
   
  +#ifdef HAVE_CRYPTO_IPP
  +#include <ippcp.h>
  +#endif
  +
   static void __aes_err __P((ENV *, int));
   static int __aes_derivekeys __P((ENV *, DB_CIPHER *, u_int8_t *, size_t));
   
  @@ -31,6 +35,10 @@
   {
   	AES_CIPHER *aes_cipher;
   	int ret;
  +#ifdef	HAVE_CRYPTO_IPP
  +	int ctx_size = 0;
  +	IppStatus ipp_ret;
  +#endif
   
   	db_cipher->adj_size = __aes_adj_size;
   	db_cipher->close = __aes_close;
  @@ -39,6 +47,21 @@
   	db_cipher->init = __aes_init;
   	if ((ret = __os_calloc(env, 1, sizeof(AES_CIPHER), &aes_cipher)) != 0)
   		return (ret);
  +#ifdef	HAVE_CRYPTO_IPP
  +	/*
  +	 * IPP AES encryption context size can only be obtained through this
  +	 * function call, cannot directly declare IppsRijndael128Spec within
  +	 * AES_CIPHER struct.
  +	 */
  +	if ((ipp_ret = ippsRijndael128GetSize(&ctx_size)) != ippStsNoErr) {
  +		__aes_err(env, (int)ipp_ret);
  +		return (EAGAIN);
  +	}
  +	if ((ret = __os_malloc(env, ctx_size, &aes_cipher->ipp_ctx)) != 0) {
  +		__os_free(env, aes_cipher);
  +		return (ret);
  +	}
  +#endif
   	db_cipher->data = aes_cipher;
   	return (0);
   }
  @@ -70,6 +93,10 @@
   	ENV *env;
   	void *data;
   {
  +#ifdef	HAVE_CRYPTO_IPP
  +	AES_CIPHER *aes_cipher = (AES_CIPHER *)data;
  +	__os_free(env, aes_cipher->ipp_ctx);
  +#endif
   	__os_free(env, data);
   	return (0);
   }
  @@ -90,7 +117,11 @@
   	size_t cipher_len;
   {
   	AES_CIPHER *aes;
  +#ifdef	HAVE_CRYPTO_IPP
  +	IppStatus ipp_ret;
  +#else
   	cipherInstance c;
  +#endif
   	int ret;
   
   	aes = (AES_CIPHER *)aes_data;
  @@ -98,6 +129,15 @@
   		return (EINVAL);
   	if ((cipher_len % DB_AES_CHUNK) != 0)
   		return (EINVAL);
  +
  +#ifdef	HAVE_CRYPTO_IPP
  +	if ((ipp_ret = ippsRijndael128DecryptCBC((const Ipp8u *)cipher,
  +	    (Ipp8u *)cipher, cipher_len, (IppsRijndael128Spec *)aes->ipp_ctx,
  +	    (const Ipp8u *)iv, 0)) != ippStsNoErr) {
  +		__aes_err(env, (int)ipp_ret);
  +		return (EAGAIN);
  +	}
  +#else
   	/*
   	 * Initialize the cipher
   	 */
  @@ -112,6 +152,7 @@
   		__aes_err(env, ret);
   		return (EAGAIN);
   	}
  +#endif
   	return (0);
   }
   
  @@ -131,7 +172,11 @@
   	size_t data_len;
   {
   	AES_CIPHER *aes;
  +#ifdef	HAVE_CRYPTO_IPP
  +	IppStatus ipp_ret;
  +#else
   	cipherInstance c;
  +#endif
   	u_int32_t tmp_iv[DB_IV_BYTES/4];
   	int ret;
   
  @@ -152,6 +197,14 @@
   	if ((ret = __db_generate_iv(env, tmp_iv)) != 0)
   		return (ret);
   
  +#ifdef	HAVE_CRYPTO_IPP
  +	if ((ipp_ret = ippsRijndael128EncryptCBC((const Ipp8u *)data,
  +	    (Ipp8u *)data, data_len, (IppsRijndael128Spec *)aes->ipp_ctx,
  +	    (const Ipp8u *)tmp_iv, 0)) != ippStsNoErr) {
  +		__aes_err(env, (int)ipp_ret);
  +		return (EAGAIN);
  +	}
  +#else
   	/*
   	 * Initialize the cipher
   	 */
  @@ -166,6 +219,7 @@
   		__aes_err(env, ret);
   		return (EAGAIN);
   	}
  +#endif
   	memcpy(iv, tmp_iv, DB_IV_BYTES);
   	return (0);
   }
  @@ -198,7 +252,11 @@
   {
   	AES_CIPHER *aes;
   	SHA1_CTX ctx;
  +#ifdef	HAVE_CRYPTO_IPP
  +	IppStatus ipp_ret;
  +#else
   	int ret;
  +#endif
   	u_int32_t temp[DB_MAC_KEY/4];
   
   	if (passwd == NULL)
  @@ -213,6 +271,14 @@
   	__db_SHA1Update(&ctx, passwd, plen);
   	__db_SHA1Final((u_int8_t *)temp, &ctx);
   
  +#ifdef	HAVE_CRYPTO_IPP
  +	if ((ipp_ret = ippsRijndael128Init((const Ipp8u *)temp,
  +	    IppsRijndaelKey128, (IppsRijndael128Spec *)aes->ipp_ctx))
  +	    != ippStsNoErr) {
  +		__aes_err(env, (int)ipp_ret);
  +		return (EAGAIN);
  +	}
  +#else
   	if ((ret = __db_makeKey(&aes->encrypt_ki, DIR_ENCRYPT,
   	    DB_AES_KEYLEN, (char *)temp)) != TRUE) {
   		__aes_err(env, ret);
  @@ -223,6 +289,7 @@
   		__aes_err(env, ret);
   		return (EAGAIN);
   	}
  +#endif
   	return (0);
   }
   
  @@ -239,6 +306,20 @@
   	char *errstr;
   
   	switch (err) {
  +#ifdef	HAVE_CRYPTO_IPP
  +	case ippStsNullPtrErr:
  +		errstr = "IPP AES NULL pointer error";
  +		break;
  +	case ippStsLengthErr:
  +		errstr = "IPP AES length error";
  +		break;
  +	case ippStsContextMatchErr:
  +		errstr = "IPP AES context does not match operation";
  +		break;
  +	case ippStsUnderRunErr:
  +		errstr = "IPP AES srclen size error";
  +		break;
  +#else
   	case BAD_KEY_DIR:
   		errstr = "AES key direction is invalid";
   		break;
  @@ -263,6 +344,7 @@
   	case BAD_OTHER:
   		errstr = "AES unknown error";
   		break;
  +#endif
   	default:
   		errstr = "AES error unrecognized";
   		break;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/crypto/crypto.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 crypto.c
  --- db/crypto/crypto.c	16 Sep 2009 19:34:48 -0000	1.10
  +++ db/crypto/crypto.c	23 Aug 2010 13:36:40 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * Some parts of this code originally written by Adam Stubblefield
    * -- astubble@rice.edu
  @@ .
  patch -p0 <<'@@ .'
  Index: db/csharp/Internal/DB.cs
  ============================================================================
  $ cvs diff -u -r1.1.1.2 -r1.1.1.2.2.1 DB.cs
  --- db/csharp/Internal/DB.cs	1 Apr 2010 15:24:12 -0000	1.1.1.2
  +++ db/csharp/Internal/DB.cs	23 Aug 2010 13:36:40 -0000	1.1.1.2.2.1
  @@ -207,10 +207,7 @@
   }
   
     internal int get_multiple() {
  -		int ret;
  -		ret = libdb_csharpPINVOKE.DB_get_multiple(swigCPtr);
  -		DatabaseException.ThrowException(ret);
  -		return ret;
  +		return libdb_csharpPINVOKE.DB_get_multiple(swigCPtr);
   }
   
     internal int get_open_flags(ref uint flags) {
  @@ .
  patch -p0 <<'@@ .'
  Index: db/csharp/Properties/AssemblyInfo.cs
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.2.1 AssemblyInfo.cs
  --- db/csharp/Properties/AssemblyInfo.cs	7 Jan 2010 22:02:22 -0000	1.2
  +++ db/csharp/Properties/AssemblyInfo.cs	23 Aug 2010 13:36:41 -0000	1.2.2.1
  @@ -10,7 +10,7 @@
   [assembly: AssemblyConfiguration("")]
   [assembly: AssemblyCompany("Oracle")]
   [assembly: AssemblyProduct("")]
  -[assembly: AssemblyCopyright("Copyright © Oracle Corporation 2009")]
  +[assembly: AssemblyCopyright("Copyright © 2009, 2010 Oracle Corporation and/or its affiliates.  All rights reserved.")]
   [assembly: AssemblyTrademark("")]
   [assembly: AssemblyCulture("")]
   
  @@ -29,4 +29,4 @@
   //      Build Number
   //      Revision
   //
  -[assembly: AssemblyVersion("4.8.26")]
  +[assembly: AssemblyVersion("5.0.26")]
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_db.cpp
  ============================================================================
  $ cvs diff -u -r1.12 -r1.12.2.1 cxx_db.cpp
  --- db/cxx/cxx_db.cpp	16 Sep 2009 19:34:49 -0000	1.12
  +++ db/cxx/cxx_db.cpp	23 Aug 2010 13:36:41 -0000	1.12.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -152,6 +152,7 @@
   	// Associate the DB with this object
   	imp_ = db;
   	db->api_internal = this;
  +	db->alt_close = this->alt_close;
   
   	// Create a new DbEnv from a DB_ENV* if it was created locally.
   	// It is deleted in Db::close().
  @@ -808,3 +809,13 @@
   }
   
   DB_METHOD_QUIET(get_transactional, (), (db))
  +
  +int Db::alt_close(DB *pdb, u_int32_t flags)
  +{
  +	int ret;
  +	
  +	((Db *)(pdb->api_internal))->imp_ = NULL;
  +	ret = pdb->close(pdb, flags);
  +
  +	return ret;
  +}
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_dbc.cpp
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 cxx_dbc.cpp
  --- db/cxx/cxx_dbc.cpp	16 Sep 2009 19:34:49 -0000	1.10
  +++ db/cxx/cxx_dbc.cpp	23 Aug 2010 13:36:41 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_dbt.cpp
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 cxx_dbt.cpp
  --- db/cxx/cxx_dbt.cpp	16 Sep 2009 19:34:49 -0000	1.10
  +++ db/cxx/cxx_dbt.cpp	23 Aug 2010 13:36:41 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_env.cpp
  ============================================================================
  $ cvs diff -u -r1.12 -r1.12.2.1 cxx_env.cpp
  --- db/cxx/cxx_env.cpp	16 Sep 2009 19:34:49 -0000	1.12
  +++ db/cxx/cxx_env.cpp	23 Aug 2010 13:36:41 -0000	1.12.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -320,8 +320,16 @@
   {
   	DB_ENV *dbenv = unwrap(this);
   
  +	/* 
  +	 * Specify DB_FORCESYNC to make sure databases are sync'ed to disk.
  +	 * Users can call DbEnv::close with 0 as real parameter to close all
  +	 * but the last environment object/handle. Doing so can avoid
  +	 * unnecessary database syncs. The last environment object/handle
  +	 * must be closed with DB_FORCESYNC parameter, or be closed via this
  +	 * function.
  +	 */
   	if (dbenv != NULL) {
  -		(void)dbenv->close(dbenv, 0);
  +		(void)dbenv->close(dbenv, DB_FORCESYNC);
   		cleanup();
   	}
   }
  @@ -494,6 +502,14 @@
       (dbenv, spp, flags))
   DBENV_METHOD(log_stat_print, (u_int32_t flags), (dbenv, flags))
   
  +int DbEnv::log_verify(DB_LOG_VERIFY_CONFIG *config)
  +{
  +	DB_ENV *dbenv = unwrap(this);
  +
  +	// Simply return the error, don't throw exceptions.
  +	return dbenv->log_verify(dbenv, config);
  +}
  +
   DBENV_METHOD(lsn_reset, (const char *file, u_int32_t flags),
       (dbenv, file, flags))
   
  @@ -745,6 +761,8 @@
   DBENV_METHOD(set_lk_max_objects, (u_int32_t max_objects), (dbenv, max_objects))
   DBENV_METHOD(get_lk_partitions, (u_int32_t *partitionsp), (dbenv, partitionsp))
   DBENV_METHOD(set_lk_partitions, (u_int32_t partitions), (dbenv, partitions))
  +DBENV_METHOD(get_lk_priority, (u_int32_t lockerid, u_int32_t *priorityp), (dbenv, lockerid, priorityp))
  +DBENV_METHOD(set_lk_priority, (u_int32_t lockerid, u_int32_t priority), (dbenv, lockerid, priority))
   DBENV_METHOD(get_mp_max_openfd, (int *maxopenfdp), (dbenv, maxopenfdp))
   DBENV_METHOD(set_mp_max_openfd, (int maxopenfd), (dbenv, maxopenfd))
   DBENV_METHOD(get_mp_max_write, (int *maxwritep, db_timeout_t *maxwrite_sleepp),
  @@ -1210,6 +1228,13 @@
   }
   
   // static method
  +char *DbEnv::full_version(int *family, int *release,
  +    int *major, int *minor, int *patch)
  +{
  +	return (db_full_version(family, release, major, minor, patch));
  +}
  +
  +// static method
   DbEnv *DbEnv::wrap_DB_ENV(DB_ENV *dbenv)
   {
   	DbEnv *wrapped_env = get_DbEnv(dbenv);
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_except.cpp
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 cxx_except.cpp
  --- db/cxx/cxx_except.cpp	16 Sep 2009 19:34:49 -0000	1.9
  +++ db/cxx/cxx_except.cpp	23 Aug 2010 13:36:41 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_lock.cpp
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 cxx_lock.cpp
  --- db/cxx/cxx_lock.cpp	16 Sep 2009 19:34:49 -0000	1.9
  +++ db/cxx/cxx_lock.cpp	23 Aug 2010 13:36:41 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_logc.cpp
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 cxx_logc.cpp
  --- db/cxx/cxx_logc.cpp	16 Sep 2009 19:34:49 -0000	1.11
  +++ db/cxx/cxx_logc.cpp	23 Aug 2010 13:36:41 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_mpool.cpp
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 cxx_mpool.cpp
  --- db/cxx/cxx_mpool.cpp	16 Sep 2009 19:34:49 -0000	1.9
  +++ db/cxx/cxx_mpool.cpp	23 Aug 2010 13:36:41 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_multi.cpp
  ============================================================================
  $ cvs diff -u -r1.8 -r1.8.2.1 cxx_multi.cpp
  --- db/cxx/cxx_multi.cpp	16 Sep 2009 19:34:49 -0000	1.8
  +++ db/cxx/cxx_multi.cpp	23 Aug 2010 13:36:41 -0000	1.8.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_seq.cpp
  ============================================================================
  $ cvs diff -u -r1.7 -r1.7.2.1 cxx_seq.cpp
  --- db/cxx/cxx_seq.cpp	16 Sep 2009 19:34:49 -0000	1.7
  +++ db/cxx/cxx_seq.cpp	23 Aug 2010 13:36:41 -0000	1.7.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/cxx/cxx_txn.cpp
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 cxx_txn.cpp
  --- db/cxx/cxx_txn.cpp	16 Sep 2009 19:34:49 -0000	1.9
  +++ db/cxx/cxx_txn.cpp	23 Aug 2010 13:36:41 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1997-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1997, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -99,8 +99,10 @@
   }
   
   DBTXN_METHOD(get_name, 0, (const char **namep), (txn, namep))
  +DBTXN_METHOD(get_priority, 0, (u_int32_t *priorityp), (txn, priorityp))
   DBTXN_METHOD(prepare, 0, (u_int8_t *gid), (txn, gid))
   DBTXN_METHOD(set_name, 0, (const char *name), (txn, name))
  +DBTXN_METHOD(set_priority, 0, (u_int32_t priority), (txn, priority))
   DBTXN_METHOD(set_timeout, 0, (db_timeout_t timeout, u_int32_t flags),
       (txn, timeout, flags))
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/crdel.src
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 crdel.src
  --- db/db/crdel.src	16 Sep 2009 19:34:50 -0000	1.9
  +++ db/db/crdel.src	23 Aug 2010 13:36:42 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -14,7 +14,6 @@
   INCLUDE #include "dbinc/db_page.h"
   INCLUDE #include "dbinc/db_dispatch.h"
   INCLUDE #include "dbinc/db_am.h"
  -INCLUDE #include "dbinc/log.h"
   INCLUDE #include "dbinc/txn.h"
   INCLUDE
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/crdel_auto.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 crdel_auto.c
  --- db/db/crdel_auto.c	16 Sep 2009 19:34:50 -0000	1.10
  +++ db/db/crdel_auto.c	23 Aug 2010 13:36:42 -0000	1.10.2.1
  @@ -6,919 +6,33 @@
   #include "dbinc/db_page.h"
   #include "dbinc/db_dispatch.h"
   #include "dbinc/db_am.h"
  -#include "dbinc/log.h"
   #include "dbinc/txn.h"
   
  -/*
  - * PUBLIC: int __crdel_metasub_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __crdel_metasub_args **));
  - */
  -int
  -__crdel_metasub_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__crdel_metasub_args **argpp;
  -{
  -	__crdel_metasub_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__crdel_metasub_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->page, 0, sizeof(argp->page));
  -	LOGCOPY_32(env,&argp->page.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->page.data = bp;
  -	bp += argp->page.size;
  -	if (LOG_SWAPPED(env) && dbpp != NULL && *dbpp != NULL) {
  -		int t_ret;
  -		if ((t_ret = __db_pageswap(*dbpp, (PAGE *)argp->page.data,
  -		    (size_t)argp->page.size, NULL, 1)) != 0)
  -			return (t_ret);
  -	}
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __crdel_metasub_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
  - */
  -int
  -__crdel_metasub_log(dbp, txnp, ret_lsnp, flags, pgno, page, lsn)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	const DBT *page;
  -	DB_LSN * lsn;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___crdel_metasub;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (page == NULL ? 0 : page->size)
  -	    + sizeof(*lsn);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (page == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &page->size);
  -		bp += sizeof(page->size);
  -		memcpy(bp, page->data, page->size);
  -		if (LOG_SWAPPED(env))
  -			if ((ret = __db_pageswap(dbp,
  -			    (PAGE *)bp, (size_t)page->size, (DBT *)NULL, 0)) != 0)
  -				return (ret);
  -		bp += page->size;
  -	}
  -
  -	if (lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn);
  -	} else
  -		memset(bp, 0, sizeof(*lsn));
  -	bp += sizeof(*lsn);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__crdel_metasub_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __crdel_inmem_create_read __P((ENV *, void *,
  - * PUBLIC:     __crdel_inmem_create_args **));
  - */
  -int
  -__crdel_inmem_create_read(env, recbuf, argpp)
  -	ENV *env;
  -	void *recbuf;
  -	__crdel_inmem_create_args **argpp;
  -{
  -	__crdel_inmem_create_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__crdel_inmem_create_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->name, 0, sizeof(argp->name));
  -	LOGCOPY_32(env,&argp->name.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->name.data = bp;
  -	bp += argp->name.size;
  -
  -	memset(&argp->fid, 0, sizeof(argp->fid));
  -	LOGCOPY_32(env,&argp->fid.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->fid.data = bp;
  -	bp += argp->fid.size;
  -
  -	LOGCOPY_32(env, &argp->pgsize, bp);
  -	bp += sizeof(argp->pgsize);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __crdel_inmem_create_log __P((ENV *, DB_TXN *,
  - * PUBLIC:     DB_LSN *, u_int32_t, int32_t, const DBT *, const DBT *,
  - * PUBLIC:     u_int32_t));
  - */
  -int
  -__crdel_inmem_create_log(env, txnp, ret_lsnp, flags,
  -    fileid, name, fid, pgsize)
  -	ENV *env;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	int32_t fileid;
  -	const DBT *name;
  -	const DBT *fid;
  -	u_int32_t pgsize;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	rlsnp = ret_lsnp;
  -	rectype = DB___crdel_inmem_create;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (name == NULL ? 0 : name->size)
  -	    + sizeof(u_int32_t) + (fid == NULL ? 0 : fid->size)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)fileid;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (name == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &name->size);
  -		bp += sizeof(name->size);
  -		memcpy(bp, name->data, name->size);
  -		bp += name->size;
  -	}
  -
  -	if (fid == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &fid->size);
  -		bp += sizeof(fid->size);
  -		memcpy(bp, fid->data, fid->size);
  -		bp += fid->size;
  -	}
  -
  -	LOGCOPY_32(env, bp, &pgsize);
  -	bp += sizeof(pgsize);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__crdel_inmem_create_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __crdel_inmem_rename_read __P((ENV *, void *,
  - * PUBLIC:     __crdel_inmem_rename_args **));
  - */
  -int
  -__crdel_inmem_rename_read(env, recbuf, argpp)
  -	ENV *env;
  -	void *recbuf;
  -	__crdel_inmem_rename_args **argpp;
  -{
  -	__crdel_inmem_rename_args *argp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__crdel_inmem_rename_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	memset(&argp->oldname, 0, sizeof(argp->oldname));
  -	LOGCOPY_32(env,&argp->oldname.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->oldname.data = bp;
  -	bp += argp->oldname.size;
  -
  -	memset(&argp->newname, 0, sizeof(argp->newname));
  -	LOGCOPY_32(env,&argp->newname.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->newname.data = bp;
  -	bp += argp->newname.size;
  -
  -	memset(&argp->fid, 0, sizeof(argp->fid));
  -	LOGCOPY_32(env,&argp->fid.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->fid.data = bp;
  -	bp += argp->fid.size;
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __crdel_inmem_rename_log __P((ENV *, DB_TXN *,
  - * PUBLIC:     DB_LSN *, u_int32_t, const DBT *, const DBT *, const DBT *));
  - */
  -int
  -__crdel_inmem_rename_log(env, txnp, ret_lsnp, flags,
  -    oldname, newname, fid)
  -	ENV *env;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	const DBT *oldname;
  -	const DBT *newname;
  -	const DBT *fid;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	u_int32_t zero, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	rlsnp = ret_lsnp;
  -	rectype = DB___crdel_inmem_rename;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t) + (oldname == NULL ? 0 : oldname->size)
  -	    + sizeof(u_int32_t) + (newname == NULL ? 0 : newname->size)
  -	    + sizeof(u_int32_t) + (fid == NULL ? 0 : fid->size);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	if (oldname == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &oldname->size);
  -		bp += sizeof(oldname->size);
  -		memcpy(bp, oldname->data, oldname->size);
  -		bp += oldname->size;
  -	}
  -
  -	if (newname == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &newname->size);
  -		bp += sizeof(newname->size);
  -		memcpy(bp, newname->data, newname->size);
  -		bp += newname->size;
  -	}
  -
  -	if (fid == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &fid->size);
  -		bp += sizeof(fid->size);
  -		memcpy(bp, fid->data, fid->size);
  -		bp += fid->size;
  -	}
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__crdel_inmem_rename_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __crdel_inmem_remove_read __P((ENV *, void *,
  - * PUBLIC:     __crdel_inmem_remove_args **));
  - */
  -int
  -__crdel_inmem_remove_read(env, recbuf, argpp)
  -	ENV *env;
  -	void *recbuf;
  -	__crdel_inmem_remove_args **argpp;
  -{
  -	__crdel_inmem_remove_args *argp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__crdel_inmem_remove_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	memset(&argp->name, 0, sizeof(argp->name));
  -	LOGCOPY_32(env,&argp->name.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->name.data = bp;
  -	bp += argp->name.size;
  -
  -	memset(&argp->fid, 0, sizeof(argp->fid));
  -	LOGCOPY_32(env,&argp->fid.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->fid.data = bp;
  -	bp += argp->fid.size;
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __crdel_inmem_remove_log __P((ENV *, DB_TXN *,
  - * PUBLIC:     DB_LSN *, u_int32_t, const DBT *, const DBT *));
  - */
  -int
  -__crdel_inmem_remove_log(env, txnp, ret_lsnp, flags,
  -    name, fid)
  -	ENV *env;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	const DBT *name;
  -	const DBT *fid;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	u_int32_t zero, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	rlsnp = ret_lsnp;
  -	rectype = DB___crdel_inmem_remove;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t) + (name == NULL ? 0 : name->size)
  -	    + sizeof(u_int32_t) + (fid == NULL ? 0 : fid->size);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	if (name == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &name->size);
  -		bp += sizeof(name->size);
  -		memcpy(bp, name->data, name->size);
  -		bp += name->size;
  -	}
  -
  -	if (fid == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &fid->size);
  -		bp += sizeof(fid->size);
  -		memcpy(bp, fid->data, fid->size);
  -		bp += fid->size;
  -	}
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__crdel_inmem_remove_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  +DB_LOG_RECSPEC __crdel_metasub_desc[] = {
  +	{LOGREC_DB, SSZ(__crdel_metasub_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__crdel_metasub_args, pgno), "pgno", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__crdel_metasub_args, page), "page", ""},
  +	{LOGREC_POINTER, SSZ(__crdel_metasub_args, lsn), "lsn", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __crdel_inmem_create_desc[] = {
  +	{LOGREC_ARG, SSZ(__crdel_inmem_create_args, fileid), "fileid", "%ld"},
  +	{LOGREC_DBT, SSZ(__crdel_inmem_create_args, name), "name", ""},
  +	{LOGREC_DBT, SSZ(__crdel_inmem_create_args, fid), "fid", ""},
  +	{LOGREC_ARG, SSZ(__crdel_inmem_create_args, pgsize), "pgsize", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __crdel_inmem_rename_desc[] = {
  +	{LOGREC_DBT, SSZ(__crdel_inmem_rename_args, oldname), "oldname", ""},
  +	{LOGREC_DBT, SSZ(__crdel_inmem_rename_args, newname), "newname", ""},
  +	{LOGREC_DBT, SSZ(__crdel_inmem_rename_args, fid), "fid", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __crdel_inmem_remove_desc[] = {
  +	{LOGREC_DBT, SSZ(__crdel_inmem_remove_args, name), "name", ""},
  +	{LOGREC_DBT, SSZ(__crdel_inmem_remove_args, fid), "fid", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
   /*
    * PUBLIC: int __crdel_init_recover __P((ENV *, DB_DISTAB *));
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/crdel_autop.c
  ============================================================================
  $ cvs diff -u -r1.5 -r1.5.4.1 crdel_autop.c
  --- db/db/crdel_autop.c	27 May 2008 11:20:25 -0000	1.5
  +++ db/db/crdel_autop.c	23 Aug 2010 13:36:42 -0000	1.5.4.1
  @@ -7,7 +7,6 @@
   #include "dbinc/db_page.h"
   #include "dbinc/db_dispatch.h"
   #include "dbinc/db_am.h"
  -#include "dbinc/log.h"
   #include "dbinc/txn.h"
   
   /*
  @@ -15,44 +14,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__crdel_metasub_print(env, dbtp, lsnp, notused2, notused3)
  +__crdel_metasub_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__crdel_metasub_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __crdel_metasub_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__crdel_metasub%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tpage: ");
  -	for (i = 0; i < argp->page.size; i++) {
  -		ch = ((u_int8_t *)argp->page.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__crdel_metasub", __crdel_metasub_desc, info));
   }
   
   /*
  @@ -60,47 +31,16 @@
    * PUBLIC:     DB_LSN *, db_recops, void *));
    */
   int
  -__crdel_inmem_create_print(env, dbtp, lsnp, notused2, notused3)
  +__crdel_inmem_create_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__crdel_inmem_create_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret = __crdel_inmem_create_read(env, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__crdel_inmem_create%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tname: ");
  -	for (i = 0; i < argp->name.size; i++) {
  -		ch = ((u_int8_t *)argp->name.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tfid: ");
  -	for (i = 0; i < argp->fid.size; i++) {
  -		ch = ((u_int8_t *)argp->fid.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tpgsize: %lu\n", (u_long)argp->pgsize);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__crdel_inmem_create", __crdel_inmem_create_desc, info));
   }
   
   /*
  @@ -108,51 +48,16 @@
    * PUBLIC:     DB_LSN *, db_recops, void *));
    */
   int
  -__crdel_inmem_rename_print(env, dbtp, lsnp, notused2, notused3)
  +__crdel_inmem_rename_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__crdel_inmem_rename_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret = __crdel_inmem_rename_read(env, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__crdel_inmem_rename%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\toldname: ");
  -	for (i = 0; i < argp->oldname.size; i++) {
  -		ch = ((u_int8_t *)argp->oldname.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tnewname: ");
  -	for (i = 0; i < argp->newname.size; i++) {
  -		ch = ((u_int8_t *)argp->newname.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tfid: ");
  -	for (i = 0; i < argp->fid.size; i++) {
  -		ch = ((u_int8_t *)argp->fid.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__crdel_inmem_rename", __crdel_inmem_rename_desc, info));
   }
   
   /*
  @@ -160,45 +65,16 @@
    * PUBLIC:     DB_LSN *, db_recops, void *));
    */
   int
  -__crdel_inmem_remove_print(env, dbtp, lsnp, notused2, notused3)
  +__crdel_inmem_remove_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__crdel_inmem_remove_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret = __crdel_inmem_remove_read(env, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__crdel_inmem_remove%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tname: ");
  -	for (i = 0; i < argp->name.size; i++) {
  -		ch = ((u_int8_t *)argp->name.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tfid: ");
  -	for (i = 0; i < argp->fid.size; i++) {
  -		ch = ((u_int8_t *)argp->fid.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__crdel_inmem_remove", __crdel_inmem_remove_desc, info));
   }
   
   /*
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/crdel_rec.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 crdel_rec.c
  --- db/db/crdel_rec.c	16 Sep 2009 19:34:50 -0000	1.9
  +++ db/db/crdel_rec.c	23 Aug 2010 13:36:42 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -12,7 +12,6 @@
   #include "dbinc/db_page.h"
   #include "dbinc/fop.h"
   #include "dbinc/hash.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   #include "dbinc/txn.h"
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db.c
  --- db/db/db.c	16 Sep 2009 19:34:50 -0000	1.11
  +++ db/db/db.c	23 Aug 2010 13:36:42 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ -47,7 +47,6 @@
   #include "dbinc/fop.h"
   #include "dbinc/hash.h"
   #include "dbinc/lock.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   #include "dbinc/partition.h"
   #include "dbinc/qam.h"
  @@ -134,7 +133,7 @@
   
   	if (0) {
   err:		if (!F_ISSET(dbp, DB_AM_DISCARD))
  -			(void)__db_close(dbp, txn, 0);
  +			(void)__db_close(dbp, txn, DB_NOSYNC);
   	}
   
   	return (ret);
  @@ -353,6 +352,19 @@
   			goto err;
   		F_SET(sdbp, DB_AM_CREATED);
   		break;
  +
  +	case MU_MOVE:
  +		/* We should have found something if we're moving it. */
  +		if (ret != 0)
  +			goto err;
  +		t_pgno = sdbp->meta_pgno;
  +		DB_HTONL_SWAP(env, &t_pgno);
  +		memset(&ndata, 0, sizeof(ndata));
  +		ndata.data = &t_pgno;
  +		ndata.size = sizeof(db_pgno_t);
  +		if ((ret = __dbc_put(dbc, &key, &ndata, 0)) != 0)
  +			goto err;
  +		mdbp->mpf->mfp->revision++;
   	}
   
   err:
  @@ -679,7 +691,7 @@
   	int db_ref, deferred_close, ret, t_ret;
   
   	env = dbp->env;
  -	deferred_close = ret = 0;
  +	deferred_close = 0;
   
   	/*
   	 * Validate arguments, but as a DB handle destructor, we can't fail.
  @@ -821,19 +833,24 @@
   		ret = t_ret;
   
   	/*
  -	 * Go through the active cursors and call the cursor recycle routine,
  +	 * Go through the active cursors, unregister each cursor from its
  +	 * transaction if any, and call the cursor recycle routine,
   	 * which resolves pending operations and moves the cursors onto the
   	 * free list.  Then, walk the free list and call the cursor destroy
   	 * routine.  Note that any failure on a close is considered "really
   	 * bad" and we just break out of the loop and force forward.
   	 */
   	resync = TAILQ_FIRST(&dbp->active_queue) == NULL ? 0 : 1;
  -	while ((dbc = TAILQ_FIRST(&dbp->active_queue)) != NULL)
  +	while ((dbc = TAILQ_FIRST(&dbp->active_queue)) != NULL) {
  +		if (dbc->txn != NULL)
  +			TAILQ_REMOVE(&(dbc->txn->my_cursors), dbc, txn_cursors);
  +
   		if ((t_ret = __dbc_close(dbc)) != 0) {
   			if (ret == 0)
   				ret = t_ret;
   			break;
   		}
  +	}
   
   	while ((dbc = TAILQ_FIRST(&dbp->free_queue)) != NULL)
   		if ((t_ret = __dbc_destroy(dbc)) != 0) {
  @@ -1232,7 +1249,8 @@
   	page_dbt.size = dbp->pgsize;
   	page_dbt.data = page;
   
  -	ret = __crdel_metasub_log(dbp, txn, &new_lsn, 0, pgno, &page_dbt, lsn);
  +	ret = __crdel_metasub_log(dbp, txn, &new_lsn, F_ISSET(dbp,
  +	    DB_AM_NOT_DURABLE) ? DB_LOG_NOT_DURABLE : 0, pgno, &page_dbt, lsn);
   
   	if (ret == 0)
   		page->lsn = new_lsn;
  @@ -1240,6 +1258,58 @@
   }
   
   /*
  + * __db_walk_cursors
  + *	Walk all cursors for a database.
  + *
  + * PUBLIC: int __db_walk_cursors __P((DB *, DBC *,
  + * PUBLIC:	int (*) __P((DBC *, DBC *,
  + * PUBLIC:      u_int32_t *, db_pgno_t, u_int32_t, void *)),
  + * PUBLIC:      u_int32_t *, db_pgno_t, u_int32_t, void *));
  + */
  + int
  + __db_walk_cursors(dbp, my_dbc, func, countp, pgno, indx, args)
  +	DB *dbp;
  +	DBC *my_dbc;
  +	int (*func)__P((DBC *, DBC *,
  +	    u_int32_t *, db_pgno_t, u_int32_t, void *));
  +	u_int32_t *countp;
  +	db_pgno_t pgno;
  +	u_int32_t indx;
  +	void *args;
  +{
  +	ENV *env;
  +	DB *ldbp;
  +	DBC *dbc;
  +	int ret;
  +
  +	env = dbp->env;
  +	ret = 0;
  +
  +	MUTEX_LOCK(env, env->mtx_dblist);
  +	FIND_FIRST_DB_MATCH(env, dbp, ldbp);
  +	for (*countp = 0;
  +	    ldbp != NULL && ldbp->adj_fileid == dbp->adj_fileid;
  +	    ldbp = TAILQ_NEXT(ldbp, dblistlinks)) {
  +loop:		MUTEX_LOCK(env, ldbp->mutex);
  +		TAILQ_FOREACH(dbc, &ldbp->active_queue, links)
  +			if ((ret = (func)(dbc, my_dbc,
  +			    countp, pgno, indx, args)) != 0)
  +				break;
  +		/*
  +		 * We use the error to communicate that function
  +		 * dropped the mutex.
  +		 */
  +		if (ret == DB_LOCK_NOTGRANTED)
  +			goto loop;
  +		MUTEX_UNLOCK(env, ldbp->mutex);
  +		if (ret != 0)
  +			break;
  +	}
  +	MUTEX_UNLOCK(env, env->mtx_dblist);
  +	return (ret);
  +}
  +
  +/*
    * __db_backup_name
    *	Create the backup file name for a given file.
    *
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db.src
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 db.src
  --- db/db/db.src	7 Jan 2010 22:02:22 -0000	1.10
  +++ db/db/db.src	23 Aug 2010 13:36:42 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -14,7 +14,6 @@
   INCLUDE #include "dbinc/db_page.h"
   INCLUDE #include "dbinc/db_dispatch.h"
   INCLUDE #include "dbinc/db_am.h"
  -INCLUDE #include "dbinc/log.h"
   INCLUDE #include "dbinc/txn.h"
   INCLUDE
   
  @@ -34,7 +33,18 @@
    * If the dbt was NULL then the hdr is a complete item to be
    * pasted on the page.
    */
  -BEGIN addrem		42	41
  +BEGIN addrem		50	41
  +OP	opcode		u_int32_t	lu
  +DB	fileid		int32_t		ld
  +ARG	pgno		db_pgno_t	lu
  +ARG	indx		u_int32_t	lu
  +ARG	nbytes		u_int32_t	lu
  +HDR	hdr		DBT		s
  +DBT	dbt		DBT		s
  +POINTER	pagelsn		DB_LSN *	lu
  +END
  +
  +BEGIN_COMPAT addrem		42	41
   ARG	opcode		u_int32_t	lu
   DB	fileid		int32_t		ld
   ARG	pgno		db_pgno_t	lu
  @@ -60,7 +70,19 @@
    *		may be used later if we actually do overwrites of big key/
    *		data items in place.
    */
  -BEGIN big		42	43
  +BEGIN big		50	43
  +OP	opcode		u_int32_t	lu
  +DB	fileid		int32_t		ld
  +ARG	pgno		db_pgno_t	lu
  +ARG	prev_pgno	db_pgno_t	lu
  +ARG	next_pgno	db_pgno_t	lu
  +HDR	dbt		DBT		s
  +POINTER	pagelsn		DB_LSN *	lu
  +POINTER	prevlsn		DB_LSN *	lu
  +POINTER	nextlsn		DB_LSN *	lu
  +END
  +
  +BEGIN_COMPAT big		42	43
   ARG	opcode		u_int32_t	lu
   DB	fileid		int32_t		ld
   ARG	pgno		db_pgno_t	lu
  @@ -315,7 +337,7 @@
    * last_pgno:	current last page number.
    * list:	list of pages and lsns on free list.
    */
  -BEGIN pg_trunc		49	66
  +BEGIN pg_trunc		50	66
   DB	fileid		int32_t		ld
   ARG	meta		db_pgno_t	lu
   POINTER	meta_lsn	DB_LSN *	lu
  @@ -323,6 +345,87 @@
   POINTER	last_lsn	DB_LSN *	lu
   ARG	next_free	db_pgno_t	lu
   ARG	last_pgno	db_pgno_t	lu
  -DBT	list		DBT		s
  +PGLIST	list		DBT		s
  +END
  +
  +/*
  + * realloc: allocate a range of pages from the free list
  + * prev_pgno:	page number of the page preceeding the set of pages to
  + *			be allocated
  + * prev_lsn	LSN from the prev_pgno page
  + * next_free	page number of the page immediately following the set
  + *			of pages to be allocated
  + * ptype	The type of page being allocated
  + * list:	pairs of page numbers and LSNs corresponding to the pages on
  + *			the free list that are being reallocated
  + */
  +BEGIN realloc		50	36
  +DB	fileid		int32_t		ld
  +ARG	prev_pgno	db_pgno_t	lu
  +POINTER	page_lsn	DB_LSN *	lu
  +ARG	next_free	db_pgno_t	lu
  +ARG	ptype		u_int32_t	lu
  +PGLIST	list		DBT		s
   END
   
  +/*
  + * relink: relink next and previous page pointers
  + * NOTE: moved from btree so its number is from that range.
  + * pgno:	The page being removed.
  + * new_pgno:	The new page number, if any.
  + * prev_pgno:	The previous page, if any.
  + * lsn_prev:	The previous page's original lsn.
  + * next_pgno:	The next page, if any.
  + * lsn_next:	The previous page's original lsn.
  + */
  +BEGIN relink		44	147
  +DB	fileid		int32_t		ld
  +ARG	pgno		db_pgno_t	lu
  +ARG	new_pgno	db_pgno_t	lu
  +ARG	prev_pgno	db_pgno_t	lu
  +POINTER	lsn_prev	DB_LSN *	lu
  +ARG	next_pgno	db_pgno_t	lu
  +POINTER	lsn_next	DB_LSN *	lu
  +END
  +
  +/*
  + * Merge: merge two pages.
  + * NOTE: moved from btree so its number is from that range.
  + * pgno:	The page number of the target page.
  + * lsn:		Orignial LSN of the page.
  + * npgno:	The page number of the next, or merged, page.
  + * nlsn:	The LSN of hte next page.
  + * hdr:		The page header of the next page.
  + * data:	The data from the next page.
  + * pg_copy:	If 1, then the whole page was copied.
  + */
  +BEGIN merge		47	148
  +DB	fileid		int32_t		ld
  +ARG	pgno		db_pgno_t	lu
  +POINTER	lsn		DB_LSN *	lu
  +ARG	npgno		db_pgno_t	lu
  +POINTER nlsn		DB_LSN *	lu
  +PGDBT	hdr		DBT		s
  +PGDDBT	data		DBT		s
  +ARG	pg_copy		int32_t		lu
  +END
  +
  +
  +/*
  + * pgno -- Handles replacing a page number in a record
  + * reference on pgno by indx.
  + * NOTE: moved from btree so its number is from that range.
  + * pgno:	The page that is being updated.
  + * lsn:		The LSN of the page.
  + * indx:	The index of the record being updated.
  + * opgno:	Old page number.
  + * npgno:	New page number.
  + */
  +BEGIN pgno		44	149
  +DB	fileid		int32_t		ld
  +ARG	pgno		db_pgno_t	lu
  +POINTER	lsn		DB_LSN *	lu
  +ARG	indx		u_int32_t	lu
  +ARG	opgno		db_pgno_t	lu
  +ARG	npgno		db_pgno_t	lu
  +END
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_am.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 db_am.c
  --- db/db/db_am.c	16 Sep 2009 19:34:50 -0000	1.10
  +++ db/db/db_am.c	23 Aug 2010 13:36:42 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1998-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1998, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -13,7 +13,6 @@
   #include "dbinc/btree.h"
   #include "dbinc/hash.h"
   #include "dbinc/lock.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   #include "dbinc/partition.h"
   #include "dbinc/qam.h"
  @@ -45,11 +44,11 @@
   	DBC_INTERNAL *cp;
   	ENV *env;
   	db_threadid_t tid;
  -	int allocated, ret;
  +	int allocated, envlid, ret;
   	pid_t pid;
   
   	env = dbp->env;
  -	allocated = 0;
  +	allocated = envlid = 0;
   
   	/*
   	 * If dbcp is non-NULL it is assumed to point to an area to initialize
  @@ -66,13 +65,15 @@
   	 * If this DBP is being logged then refcount the log filename
   	 * relative to this transaction. We do this here because we have
   	 * the dbp->mutex which protects the refcount.  We want to avoid
  -	 * calling the function if we are duplicating a cursor.  This includes
  -	 * the case of creating an off page duplicate cursor. If we know this
  -	 * cursor will not be used in an update, we could avoid this,
  -	 * but we don't have that information.
  +	 * calling the function if the transaction handle has a shared parent
  +	 * locker or we are duplicating a cursor.  This includes the case of
  +	 * creating an off page duplicate cursor.
  +	 * If we knew this cursor will not be used in an update, we could avoid
  +	 * this, but we don't have that information.
   	 */
  -	if (txn != NULL && !LF_ISSET(DBC_OPD | DBC_DUPLICATE)
  -	    && !F_ISSET(dbp, DB_AM_RECOVER) &&
  +	if (txn != NULL && !F_ISSET(txn, TXN_FAMILY) &&
  +	    !LF_ISSET(DBC_OPD | DBC_DUPLICATE) &&
  +	    !F_ISSET(dbp, DB_AM_RECOVER) &&
   	    dbp->log_filename != NULL && !IS_REP_CLIENT(env) &&
   	    (ret = __txn_record_fname(env, txn, dbp->log_filename)) != 0) {
   		MUTEX_UNLOCK(env, dbp->mutex);
  @@ -112,9 +113,12 @@
   			 * environment handles.
   			 */
   			if (!DB_IS_THREADED(dbp)) {
  -				if (env->env_lref == NULL && (ret =
  -				    __lock_id(env, NULL, &env->env_lref)) != 0)
  -					goto err;
  +				if (env->env_lref == NULL) {
  +					if ((ret = __lock_id(env,
  +					    NULL, &env->env_lref)) != 0)
  +						goto err;
  +				       envlid = 1;
  +				}
   				dbc->lref = env->env_lref;
   			} else {
   				if ((ret =
  @@ -203,6 +207,23 @@
   	dbc->set_priority = __dbc_set_priority;
   	dbc->get_priority = __dbc_get_priority;
   	dbc->priority = dbp->priority;
  +	dbc->txn_cursors.tqe_next = NULL;
  +	dbc->txn_cursors.tqe_prev = NULL;
  +
  +	/*
  +	 * If the DB handle is not threaded, there is one locker ID for the
  +	 * whole environment.  There should only one family transaction active
  +	 * as well.  This doesn't apply to CDS group transactions, where the
  +	 * cursor can simply use the transaction's locker directly.
  +	 */
  +	if (!CDB_LOCKING(env) && txn != NULL && F_ISSET(txn, TXN_FAMILY) &&
  +	    (F_ISSET(dbc, DBC_OWN_LID) || envlid))  {
  +		if ((ret = __lock_addfamilylocker(env,
  +		    txn->txnid, dbc->lref->id, 1)) != 0)
  +			goto err;
  +		F_SET(dbc, DBC_FAMILY);
  +		txn = NULL;
  +	}
   
   	if ((dbc->txn = txn) != NULL)
   		dbc->locker = txn->locker;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_auto.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_auto.c
  --- db/db/db_auto.c	7 Jan 2010 22:02:22 -0000	1.11
  +++ db/db/db_auto.c	23 Aug 2010 13:36:42 -0000	1.11.2.1
  @@ -6,3220 +6,217 @@
   #include "dbinc/db_page.h"
   #include "dbinc/db_dispatch.h"
   #include "dbinc/db_am.h"
  -#include "dbinc/log.h"
   #include "dbinc/txn.h"
   
  -/*
  - * PUBLIC: int __db_addrem_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __db_addrem_args **));
  - */
  -int
  -__db_addrem_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_addrem_args **argpp;
  -{
  -	__db_addrem_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_addrem_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->opcode, bp);
  -	bp += sizeof(argp->opcode);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &argp->indx, bp);
  -	bp += sizeof(argp->indx);
  -
  -	LOGCOPY_32(env, &argp->nbytes, bp);
  -	bp += sizeof(argp->nbytes);
  -
  -	memset(&argp->hdr, 0, sizeof(argp->hdr));
  -	LOGCOPY_32(env,&argp->hdr.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->hdr.data = bp;
  -	bp += argp->hdr.size;
  -
  -	memset(&argp->dbt, 0, sizeof(argp->dbt));
  -	LOGCOPY_32(env,&argp->dbt.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->dbt.data = bp;
  -	bp += argp->dbt.size;
  -
  -	LOGCOPY_TOLSN(env, &argp->pagelsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_addrem_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, u_int32_t, db_pgno_t, u_int32_t, u_int32_t,
  - * PUBLIC:     const DBT *, const DBT *, DB_LSN *));
  - */
  -int
  -__db_addrem_log(dbp, txnp, ret_lsnp, flags,
  -    opcode, pgno, indx, nbytes, hdr,
  -    dbt, pagelsn)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	u_int32_t opcode;
  -	db_pgno_t pgno;
  -	u_int32_t indx;
  -	u_int32_t nbytes;
  -	const DBT *hdr;
  -	const DBT *dbt;
  -	DB_LSN * pagelsn;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_addrem;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (hdr == NULL ? 0 : hdr->size)
  -	    + sizeof(u_int32_t) + (dbt == NULL ? 0 : dbt->size)
  -	    + sizeof(*pagelsn);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, bp, &opcode);
  -	bp += sizeof(opcode);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, bp, &indx);
  -	bp += sizeof(indx);
  -
  -	LOGCOPY_32(env, bp, &nbytes);
  -	bp += sizeof(nbytes);
  -
  -	if (hdr == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &hdr->size);
  -		bp += sizeof(hdr->size);
  -		memcpy(bp, hdr->data, hdr->size);
  -		bp += hdr->size;
  -	}
  -
  -	if (dbt == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &dbt->size);
  -		bp += sizeof(dbt->size);
  -		memcpy(bp, dbt->data, dbt->size);
  -		bp += dbt->size;
  -	}
  -
  -	if (pagelsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(pagelsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, pagelsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, pagelsn);
  -	} else
  -		memset(bp, 0, sizeof(*pagelsn));
  -	bp += sizeof(*pagelsn);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_addrem_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_big_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __db_big_args **));
  - */
  -int
  -__db_big_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_big_args **argpp;
  -{
  -	__db_big_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_big_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->opcode, bp);
  -	bp += sizeof(argp->opcode);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->prev_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->dbt, 0, sizeof(argp->dbt));
  -	LOGCOPY_32(env,&argp->dbt.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->dbt.data = bp;
  -	bp += argp->dbt.size;
  -
  -	LOGCOPY_TOLSN(env, &argp->pagelsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_TOLSN(env, &argp->prevlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_TOLSN(env, &argp->nextlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_big_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, u_int32_t, db_pgno_t, db_pgno_t, db_pgno_t,
  - * PUBLIC:     const DBT *, DB_LSN *, DB_LSN *, DB_LSN *));
  - */
  -int
  -__db_big_log(dbp, txnp, ret_lsnp, flags,
  -    opcode, pgno, prev_pgno, next_pgno, dbt,
  -    pagelsn, prevlsn, nextlsn)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	u_int32_t opcode;
  -	db_pgno_t pgno;
  -	db_pgno_t prev_pgno;
  -	db_pgno_t next_pgno;
  -	const DBT *dbt;
  -	DB_LSN * pagelsn;
  -	DB_LSN * prevlsn;
  -	DB_LSN * nextlsn;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_big;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (dbt == NULL ? 0 : dbt->size)
  -	    + sizeof(*pagelsn)
  -	    + sizeof(*prevlsn)
  -	    + sizeof(*nextlsn);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, bp, &opcode);
  -	bp += sizeof(opcode);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)prev_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)next_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (dbt == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &dbt->size);
  -		bp += sizeof(dbt->size);
  -		memcpy(bp, dbt->data, dbt->size);
  -		bp += dbt->size;
  -	}
  -
  -	if (pagelsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(pagelsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, pagelsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, pagelsn);
  -	} else
  -		memset(bp, 0, sizeof(*pagelsn));
  -	bp += sizeof(*pagelsn);
  -
  -	if (prevlsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(prevlsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, prevlsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, prevlsn);
  -	} else
  -		memset(bp, 0, sizeof(*prevlsn));
  -	bp += sizeof(*prevlsn);
  -
  -	if (nextlsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(nextlsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, nextlsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, nextlsn);
  -	} else
  -		memset(bp, 0, sizeof(*nextlsn));
  -	bp += sizeof(*nextlsn);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_big_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_ovref_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __db_ovref_args **));
  - */
  -int
  -__db_ovref_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_ovref_args **argpp;
  -{
  -	__db_ovref_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_ovref_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->adjust = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_ovref_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, int32_t, DB_LSN *));
  - */
  -int
  -__db_ovref_log(dbp, txnp, ret_lsnp, flags, pgno, adjust, lsn)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	int32_t adjust;
  -	DB_LSN * lsn;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_ovref;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*lsn);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)adjust;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, lsn);
  -	} else
  -		memset(bp, 0, sizeof(*lsn));
  -	bp += sizeof(*lsn);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_ovref_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_relink_42_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __db_relink_42_args **));
  - */
  -int
  -__db_relink_42_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_relink_42_args **argpp;
  -{
  -	__db_relink_42_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_relink_42_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &argp->opcode, bp);
  -	bp += sizeof(argp->opcode);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->prev = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn_prev, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->lsn_next, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_debug_read __P((ENV *, void *, __db_debug_args **));
  - */
  -int
  -__db_debug_read(env, recbuf, argpp)
  -	ENV *env;
  -	void *recbuf;
  -	__db_debug_args **argpp;
  -{
  -	__db_debug_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_debug_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	memset(&argp->op, 0, sizeof(argp->op));
  -	LOGCOPY_32(env,&argp->op.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->op.data = bp;
  -	bp += argp->op.size;
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->key, 0, sizeof(argp->key));
  -	LOGCOPY_32(env,&argp->key.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->key.data = bp;
  -	bp += argp->key.size;
  -
  -	memset(&argp->data, 0, sizeof(argp->data));
  -	LOGCOPY_32(env,&argp->data.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->data.data = bp;
  -	bp += argp->data.size;
  -
  -	LOGCOPY_32(env, &argp->arg_flags, bp);
  -	bp += sizeof(argp->arg_flags);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_debug_log __P((ENV *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, const DBT *, int32_t, const DBT *, const DBT *,
  - * PUBLIC:     u_int32_t));
  - */
  -int
  -__db_debug_log(env, txnp, ret_lsnp, flags,
  -    op, fileid, key, data, arg_flags)
  -	ENV *env;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	const DBT *op;
  -	int32_t fileid;
  -	const DBT *key;
  -	const DBT *data;
  -	u_int32_t arg_flags;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_debug;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t) + (op == NULL ? 0 : op->size)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (key == NULL ? 0 : key->size)
  -	    + sizeof(u_int32_t) + (data == NULL ? 0 : data->size)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	if (op == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &op->size);
  -		bp += sizeof(op->size);
  -		memcpy(bp, op->data, op->size);
  -		bp += op->size;
  -	}
  -
  -	uinttmp = (u_int32_t)fileid;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (key == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &key->size);
  -		bp += sizeof(key->size);
  -		memcpy(bp, key->data, key->size);
  -		bp += key->size;
  -	}
  -
  -	if (data == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &data->size);
  -		bp += sizeof(data->size);
  -		memcpy(bp, data->data, data->size);
  -		bp += data->size;
  -	}
  -
  -	LOGCOPY_32(env, bp, &arg_flags);
  -	bp += sizeof(arg_flags);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_debug_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_noop_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __db_noop_args **));
  - */
  -int
  -__db_noop_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_noop_args **argpp;
  -{
  -	__db_noop_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_noop_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->prevlsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_noop_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *));
  - */
  -int
  -__db_noop_log(dbp, txnp, ret_lsnp, flags, pgno, prevlsn)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	DB_LSN * prevlsn;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_noop;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*prevlsn);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (prevlsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(prevlsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, prevlsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, prevlsn);
  -	} else
  -		memset(bp, 0, sizeof(*prevlsn));
  -	bp += sizeof(*prevlsn);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_noop_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_alloc_42_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __db_pg_alloc_42_args **));
  - */
  -int
  -__db_pg_alloc_42_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_pg_alloc_42_args **argpp;
  -{
  -	__db_pg_alloc_42_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_pg_alloc_42_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_TOLSN(env, &argp->meta_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->meta_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->page_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &argp->ptype, bp);
  -	bp += sizeof(argp->ptype);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_alloc_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __db_pg_alloc_args **));
  - */
  -int
  -__db_pg_alloc_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_pg_alloc_args **argpp;
  -{
  -	__db_pg_alloc_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_pg_alloc_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_TOLSN(env, &argp->meta_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->meta_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->page_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &argp->ptype, bp);
  -	bp += sizeof(argp->ptype);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->last_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_alloc_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, u_int32_t,
  - * PUBLIC:     db_pgno_t, db_pgno_t));
  - */
  -int
  -__db_pg_alloc_log(dbp, txnp, ret_lsnp, flags, meta_lsn, meta_pgno, page_lsn, pgno, ptype,
  -    next, last_pgno)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	DB_LSN * meta_lsn;
  -	db_pgno_t meta_pgno;
  -	DB_LSN * page_lsn;
  -	db_pgno_t pgno;
  -	u_int32_t ptype;
  -	db_pgno_t next;
  -	db_pgno_t last_pgno;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_pg_alloc;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*meta_lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*page_lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (meta_lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, meta_lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, meta_lsn);
  -	} else
  -		memset(bp, 0, sizeof(*meta_lsn));
  -	bp += sizeof(*meta_lsn);
  -
  -	uinttmp = (u_int32_t)meta_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (page_lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(page_lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, page_lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, page_lsn);
  -	} else
  -		memset(bp, 0, sizeof(*page_lsn));
  -	bp += sizeof(*page_lsn);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, bp, &ptype);
  -	bp += sizeof(ptype);
  -
  -	uinttmp = (u_int32_t)next;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)last_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_pg_alloc_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_free_42_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __db_pg_free_42_args **));
  - */
  -int
  -__db_pg_free_42_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_pg_free_42_args **argpp;
  -{
  -	__db_pg_free_42_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_pg_free_42_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->meta_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->meta_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->header, 0, sizeof(argp->header));
  -	LOGCOPY_32(env,&argp->header.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->header.data = bp;
  -	bp += argp->header.size;
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_free_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __db_pg_free_args **));
  - */
  -int
  -__db_pg_free_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_pg_free_args **argpp;
  -{
  -	__db_pg_free_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_pg_free_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->meta_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->meta_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->header, 0, sizeof(argp->header));
  -	LOGCOPY_32(env,&argp->header.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->header.data = bp;
  -	bp += argp->header.size;
  -	if (LOG_SWAPPED(env) && dbpp != NULL && *dbpp != NULL) {
  -		int t_ret;
  -		if ((t_ret = __db_pageswap(*dbpp, (PAGE *)argp->header.data,
  -		    (size_t)argp->header.size, NULL, 1)) != 0)
  -			return (t_ret);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->last_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_free_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *,
  - * PUBLIC:     db_pgno_t, db_pgno_t));
  - */
  -int
  -__db_pg_free_log(dbp, txnp, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header, next,
  -    last_pgno)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	DB_LSN * meta_lsn;
  -	db_pgno_t meta_pgno;
  -	const DBT *header;
  -	db_pgno_t next;
  -	db_pgno_t last_pgno;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_pg_free;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*meta_lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (header == NULL ? 0 : header->size)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (meta_lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, meta_lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, meta_lsn);
  -	} else
  -		memset(bp, 0, sizeof(*meta_lsn));
  -	bp += sizeof(*meta_lsn);
  -
  -	uinttmp = (u_int32_t)meta_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (header == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &header->size);
  -		bp += sizeof(header->size);
  -		memcpy(bp, header->data, header->size);
  -		if (LOG_SWAPPED(env))
  -			if ((ret = __db_pageswap(dbp,
  -			    (PAGE *)bp, (size_t)header->size, (DBT *)NULL, 0)) != 0)
  -				return (ret);
  -		bp += header->size;
  -	}
  -
  -	uinttmp = (u_int32_t)next;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)last_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_pg_free_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_cksum_read __P((ENV *, void *, __db_cksum_args **));
  - */
  -int
  -__db_cksum_read(env, recbuf, argpp)
  -	ENV *env;
  -	void *recbuf;
  -	__db_cksum_args **argpp;
  -{
  -	__db_cksum_args *argp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_cksum_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_cksum_log __P((ENV *, DB_TXN *, DB_LSN *, u_int32_t));
  - */
  -int
  -__db_cksum_log(env, txnp, ret_lsnp, flags)
  -	ENV *env;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	u_int32_t rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_cksum;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_cksum_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_freedata_42_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __db_pg_freedata_42_args **));
  - */
  -int
  -__db_pg_freedata_42_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_pg_freedata_42_args **argpp;
  -{
  -	__db_pg_freedata_42_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_pg_freedata_42_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->meta_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->meta_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->header, 0, sizeof(argp->header));
  -	LOGCOPY_32(env,&argp->header.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->header.data = bp;
  -	bp += argp->header.size;
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->data, 0, sizeof(argp->data));
  -	LOGCOPY_32(env,&argp->data.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->data.data = bp;
  -	bp += argp->data.size;
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_freedata_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __db_pg_freedata_args **));
  - */
  -int
  -__db_pg_freedata_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_pg_freedata_args **argpp;
  -{
  -	__db_pg_freedata_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_pg_freedata_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->meta_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->meta_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->header, 0, sizeof(argp->header));
  -	LOGCOPY_32(env,&argp->header.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->header.data = bp;
  -	bp += argp->header.size;
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->last_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->data, 0, sizeof(argp->data));
  -	LOGCOPY_32(env,&argp->data.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->data.data = bp;
  -	bp += argp->data.size;
  -	if (LOG_SWAPPED(env) && dbpp != NULL && *dbpp != NULL) {
  -		int t_ret;
  -		if ((t_ret = __db_pageswap(*dbpp,
  -		    (PAGE *)argp->header.data, (size_t)argp->header.size,
  -		    &argp->data, 1)) != 0)
  -			return (t_ret);
  -	}
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_freedata_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *,
  - * PUBLIC:     db_pgno_t, db_pgno_t, const DBT *));
  - */
  -int
  -__db_pg_freedata_log(dbp, txnp, ret_lsnp, flags, pgno, meta_lsn, meta_pgno, header, next,
  -    last_pgno, data)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	DB_LSN * meta_lsn;
  -	db_pgno_t meta_pgno;
  -	const DBT *header;
  -	db_pgno_t next;
  -	db_pgno_t last_pgno;
  -	const DBT *data;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_pg_freedata;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*meta_lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (header == NULL ? 0 : header->size)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (data == NULL ? 0 : data->size);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (meta_lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, meta_lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, meta_lsn);
  -	} else
  -		memset(bp, 0, sizeof(*meta_lsn));
  -	bp += sizeof(*meta_lsn);
  -
  -	uinttmp = (u_int32_t)meta_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (header == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &header->size);
  -		bp += sizeof(header->size);
  -		memcpy(bp, header->data, header->size);
  -		if (LOG_SWAPPED(env))
  -			if ((ret = __db_pageswap(dbp,
  -			    (PAGE *)bp, (size_t)header->size, (DBT *)data, 0)) != 0)
  -				return (ret);
  -		bp += header->size;
  -	}
  -
  -	uinttmp = (u_int32_t)next;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)last_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (data == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &data->size);
  -		bp += sizeof(data->size);
  -		memcpy(bp, data->data, data->size);
  -		if (LOG_SWAPPED(env) && F_ISSET(data, DB_DBT_APPMALLOC))
  -			__os_free(env, data->data);
  -		bp += data->size;
  -	}
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_pg_freedata_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_init_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __db_pg_init_args **));
  - */
  -int
  -__db_pg_init_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_pg_init_args **argpp;
  -{
  -	__db_pg_init_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_pg_init_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->header, 0, sizeof(argp->header));
  -	LOGCOPY_32(env,&argp->header.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->header.data = bp;
  -	bp += argp->header.size;
  -
  -	memset(&argp->data, 0, sizeof(argp->data));
  -	LOGCOPY_32(env,&argp->data.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->data.data = bp;
  -	bp += argp->data.size;
  -	if (LOG_SWAPPED(env) && dbpp != NULL && *dbpp != NULL) {
  -		int t_ret;
  -		if ((t_ret = __db_pageswap(*dbpp,
  -		    (PAGE *)argp->header.data, (size_t)argp->header.size,
  -		    &argp->data, 1)) != 0)
  -			return (t_ret);
  -	}
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_init_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, const DBT *, const DBT *));
  - */
  -int
  -__db_pg_init_log(dbp, txnp, ret_lsnp, flags, pgno, header, data)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t pgno;
  -	const DBT *header;
  -	const DBT *data;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_pg_init;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (header == NULL ? 0 : header->size)
  -	    + sizeof(u_int32_t) + (data == NULL ? 0 : data->size);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (header == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &header->size);
  -		bp += sizeof(header->size);
  -		memcpy(bp, header->data, header->size);
  -		if (LOG_SWAPPED(env))
  -			if ((ret = __db_pageswap(dbp,
  -			    (PAGE *)bp, (size_t)header->size, (DBT *)data, 0)) != 0)
  -				return (ret);
  -		bp += header->size;
  -	}
  -
  -	if (data == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &data->size);
  -		bp += sizeof(data->size);
  -		memcpy(bp, data->data, data->size);
  -		if (LOG_SWAPPED(env) && F_ISSET(data, DB_DBT_APPMALLOC))
  -			__os_free(env, data->data);
  -		bp += data->size;
  -	}
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_pg_init_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_sort_44_read __P((ENV *, DB **, void *,
  - * PUBLIC:     void *, __db_pg_sort_44_args **));
  - */
  -int
  -__db_pg_sort_44_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_pg_sort_44_args **argpp;
  -{
  -	__db_pg_sort_44_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_pg_sort_44_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->meta = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->meta_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->last_free = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->last_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->last_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->list, 0, sizeof(argp->list));
  -	LOGCOPY_32(env,&argp->list.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->list.data = bp;
  -	bp += argp->list.size;
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_trunc_read __P((ENV *, DB **, void *, void *,
  - * PUBLIC:     __db_pg_trunc_args **));
  - */
  -int
  -__db_pg_trunc_read(env, dbpp, td, recbuf, argpp)
  -	ENV *env;
  -	DB **dbpp;
  -	void *td;
  -	void *recbuf;
  -	__db_pg_trunc_args **argpp;
  -{
  -	__db_pg_trunc_args *argp;
  -	u_int32_t uinttmp;
  -	u_int8_t *bp;
  -	int ret;
  -
  -	if ((ret = __os_malloc(env,
  -	    sizeof(__db_pg_trunc_args) + sizeof(DB_TXN), &argp)) != 0)
  -		return (ret);
  -	bp = recbuf;
  -	argp->txnp = (DB_TXN *)&argp[1];
  -	memset(argp->txnp, 0, sizeof(DB_TXN));
  -
  -	argp->txnp->td = td;
  -	LOGCOPY_32(env, &argp->type, bp);
  -	bp += sizeof(argp->type);
  -
  -	LOGCOPY_32(env, &argp->txnp->txnid, bp);
  -	bp += sizeof(argp->txnp->txnid);
  -
  -	LOGCOPY_TOLSN(env, &argp->prev_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->fileid = (int32_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -	if (dbpp != NULL) {
  -		*dbpp = NULL;
  -		ret = __dbreg_id_to_db(
  -		    env, argp->txnp, dbpp, argp->fileid, 1);
  -	}
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->meta = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->meta_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->last_free = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_TOLSN(env, &argp->last_lsn, bp);
  -	bp += sizeof(DB_LSN);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->next_free = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	LOGCOPY_32(env, &uinttmp, bp);
  -	argp->last_pgno = (db_pgno_t)uinttmp;
  -	bp += sizeof(uinttmp);
  -
  -	memset(&argp->list, 0, sizeof(argp->list));
  -	LOGCOPY_32(env,&argp->list.size, bp);
  -	bp += sizeof(u_int32_t);
  -	argp->list.data = bp;
  -	bp += argp->list.size;
  -
  -	*argpp = argp;
  -	return (ret);
  -}
  -
  -/*
  - * PUBLIC: int __db_pg_trunc_log __P((DB *, DB_TXN *, DB_LSN *,
  - * PUBLIC:     u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t,
  - * PUBLIC:     db_pgno_t, const DBT *));
  - */
  -int
  -__db_pg_trunc_log(dbp, txnp, ret_lsnp, flags, meta, meta_lsn, last_free, last_lsn, next_free,
  -    last_pgno, list)
  -	DB *dbp;
  -	DB_TXN *txnp;
  -	DB_LSN *ret_lsnp;
  -	u_int32_t flags;
  -	db_pgno_t meta;
  -	DB_LSN * meta_lsn;
  -	db_pgno_t last_free;
  -	DB_LSN * last_lsn;
  -	db_pgno_t next_free;
  -	db_pgno_t last_pgno;
  -	const DBT *list;
  -{
  -	DBT logrec;
  -	DB_LSN *lsnp, null_lsn, *rlsnp;
  -	DB_TXNLOGREC *lr;
  -	ENV *env;
  -	u_int32_t zero, uinttmp, rectype, txn_num;
  -	u_int npad;
  -	u_int8_t *bp;
  -	int is_durable, ret;
  -
  -	COMPQUIET(lr, NULL);
  -
  -	env = dbp->env;
  -	rlsnp = ret_lsnp;
  -	rectype = DB___db_pg_trunc;
  -	npad = 0;
  -	ret = 0;
  -
  -	if (LF_ISSET(DB_LOG_NOT_DURABLE) ||
  -	    F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
  -		if (txnp == NULL)
  -			return (0);
  -		is_durable = 0;
  -	} else
  -		is_durable = 1;
  -
  -	if (txnp == NULL) {
  -		txn_num = 0;
  -		lsnp = &null_lsn;
  -		null_lsn.file = null_lsn.offset = 0;
  -	} else {
  -		if (TAILQ_FIRST(&txnp->kids) != NULL &&
  -		    (ret = __txn_activekids(env, rectype, txnp)) != 0)
  -			return (ret);
  -		/*
  -		 * We need to assign begin_lsn while holding region mutex.
  -		 * That assignment is done inside the DbEnv->log_put call,
  -		 * so pass in the appropriate memory location to be filled
  -		 * in by the log_put code.
  -		 */
  -		DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
  -		txn_num = txnp->txnid;
  -	}
  -
  -	DB_ASSERT(env, dbp->log_filename != NULL);
  -	if (dbp->log_filename->id == DB_LOGFILEID_INVALID &&
  -	    (ret = __dbreg_lazy_id(dbp)) != 0)
  -		return (ret);
  -
  -	logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*meta_lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(*last_lsn)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t)
  -	    + sizeof(u_int32_t) + (list == NULL ? 0 : list->size);
  -	if (CRYPTO_ON(env)) {
  -		npad = env->crypto_handle->adj_size(logrec.size);
  -		logrec.size += npad;
  -	}
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0)
  -			return (ret);
  -	} else {
  -		if ((ret = __os_malloc(env,
  -		    logrec.size + sizeof(DB_TXNLOGREC), &lr)) != 0)
  -			return (ret);
  -#ifdef DIAGNOSTIC
  -		if ((ret =
  -		    __os_malloc(env, logrec.size, &logrec.data)) != 0) {
  -			__os_free(env, lr);
  -			return (ret);
  -		}
  -#else
  -		logrec.data = lr->data;
  -#endif
  -	}
  -	if (npad > 0)
  -		memset((u_int8_t *)logrec.data + logrec.size - npad, 0, npad);
  -
  -	bp = logrec.data;
  -
  -	LOGCOPY_32(env, bp, &rectype);
  -	bp += sizeof(rectype);
  -
  -	LOGCOPY_32(env, bp, &txn_num);
  -	bp += sizeof(txn_num);
  -
  -	LOGCOPY_FROMLSN(env, bp, lsnp);
  -	bp += sizeof(DB_LSN);
  -
  -	uinttmp = (u_int32_t)dbp->log_filename->id;
  -	LOGCOPY_32(env, bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)meta;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (meta_lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(meta_lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, meta_lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, meta_lsn);
  -	} else
  -		memset(bp, 0, sizeof(*meta_lsn));
  -	bp += sizeof(*meta_lsn);
  -
  -	uinttmp = (u_int32_t)last_free;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (last_lsn != NULL) {
  -		if (txnp != NULL) {
  -			LOG *lp = env->lg_handle->reginfo.primary;
  -			if (LOG_COMPARE(last_lsn, &lp->lsn) >= 0 && (ret =
  -			    __log_check_page_lsn(env, dbp, last_lsn)) != 0)
  -				return (ret);
  -		}
  -		LOGCOPY_FROMLSN(env, bp, last_lsn);
  -	} else
  -		memset(bp, 0, sizeof(*last_lsn));
  -	bp += sizeof(*last_lsn);
  -
  -	uinttmp = (u_int32_t)next_free;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	uinttmp = (u_int32_t)last_pgno;
  -	LOGCOPY_32(env,bp, &uinttmp);
  -	bp += sizeof(uinttmp);
  -
  -	if (list == NULL) {
  -		zero = 0;
  -		LOGCOPY_32(env, bp, &zero);
  -		bp += sizeof(u_int32_t);
  -	} else {
  -		LOGCOPY_32(env, bp, &list->size);
  -		bp += sizeof(list->size);
  -		memcpy(bp, list->data, list->size);
  -		bp += list->size;
  -	}
  -
  -	DB_ASSERT(env,
  -	    (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
  -
  -	if (is_durable || txnp == NULL) {
  -		if ((ret = __log_put(env, rlsnp,(DBT *)&logrec,
  -		    flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
  -			*lsnp = *rlsnp;
  -			if (rlsnp != ret_lsnp)
  -				 *ret_lsnp = *rlsnp;
  -		}
  -	} else {
  -		ret = 0;
  -#ifdef DIAGNOSTIC
  -		/*
  -		 * Set the debug bit if we are going to log non-durable
  -		 * transactions so they will be ignored by recovery.
  -		 */
  -		memcpy(lr->data, logrec.data, logrec.size);
  -		rectype |= DB_debug_FLAG;
  -		LOGCOPY_32(env, logrec.data, &rectype);
  -
  -		if (!IS_REP_CLIENT(env))
  -			ret = __log_put(env,
  -			    rlsnp, (DBT *)&logrec, flags | DB_LOG_NOCOPY);
  -#endif
  -		STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
  -		F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
  -		LSN_NOT_LOGGED(*ret_lsnp);
  -	}
  -
  -#ifdef LOG_DIAGNOSTIC
  -	if (ret != 0)
  -		(void)__db_pg_trunc_print(env,
  -		    (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
  -#endif
  -
  -#ifdef DIAGNOSTIC
  -	__os_free(env, logrec.data);
  -#else
  -	if (is_durable || txnp == NULL)
  -		__os_free(env, logrec.data);
  -#endif
  -	return (ret);
  -}
  -
  +DB_LOG_RECSPEC __db_addrem_desc[] = {
  +	{LOGREC_OP, SSZ(__db_addrem_args, opcode), "opcode", "%lu"},
  +	{LOGREC_DB, SSZ(__db_addrem_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_addrem_args, pgno), "pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_addrem_args, indx), "indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_addrem_args, nbytes), "nbytes", "%lu"},
  +	{LOGREC_HDR, SSZ(__db_addrem_args, hdr), "hdr", ""},
  +	{LOGREC_DBT, SSZ(__db_addrem_args, dbt), "dbt", ""},
  +	{LOGREC_POINTER, SSZ(__db_addrem_args, pagelsn), "pagelsn", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_addrem_42_desc[] = {
  +	{LOGREC_ARG, SSZ(__db_addrem_42_args, opcode), "opcode", "%lu"},
  +	{LOGREC_DB, SSZ(__db_addrem_42_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_addrem_42_args, pgno), "pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_addrem_42_args, indx), "indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_addrem_42_args, nbytes), "nbytes", "%lu"},
  +	{LOGREC_DBT, SSZ(__db_addrem_42_args, hdr), "hdr", ""},
  +	{LOGREC_DBT, SSZ(__db_addrem_42_args, dbt), "dbt", ""},
  +	{LOGREC_POINTER, SSZ(__db_addrem_42_args, pagelsn), "pagelsn", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_big_desc[] = {
  +	{LOGREC_OP, SSZ(__db_big_args, opcode), "opcode", "%lu"},
  +	{LOGREC_DB, SSZ(__db_big_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_big_args, pgno), "pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_big_args, prev_pgno), "prev_pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_big_args, next_pgno), "next_pgno", "%lu"},
  +	{LOGREC_HDR, SSZ(__db_big_args, dbt), "dbt", ""},
  +	{LOGREC_POINTER, SSZ(__db_big_args, pagelsn), "pagelsn", ""},
  +	{LOGREC_POINTER, SSZ(__db_big_args, prevlsn), "prevlsn", ""},
  +	{LOGREC_POINTER, SSZ(__db_big_args, nextlsn), "nextlsn", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_big_42_desc[] = {
  +	{LOGREC_ARG, SSZ(__db_big_42_args, opcode), "opcode", "%lu"},
  +	{LOGREC_DB, SSZ(__db_big_42_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_big_42_args, pgno), "pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_big_42_args, prev_pgno), "prev_pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_big_42_args, next_pgno), "next_pgno", "%lu"},
  +	{LOGREC_DBT, SSZ(__db_big_42_args, dbt), "dbt", ""},
  +	{LOGREC_POINTER, SSZ(__db_big_42_args, pagelsn), "pagelsn", ""},
  +	{LOGREC_POINTER, SSZ(__db_big_42_args, prevlsn), "prevlsn", ""},
  +	{LOGREC_POINTER, SSZ(__db_big_42_args, nextlsn), "nextlsn", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_ovref_desc[] = {
  +	{LOGREC_DB, SSZ(__db_ovref_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_ovref_args, pgno), "pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_ovref_args, adjust), "adjust", "%ld"},
  +	{LOGREC_POINTER, SSZ(__db_ovref_args, lsn), "lsn", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_relink_42_desc[] = {
  +	{LOGREC_ARG, SSZ(__db_relink_42_args, opcode), "opcode", "%lu"},
  +	{LOGREC_DB, SSZ(__db_relink_42_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_relink_42_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_relink_42_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_relink_42_args, prev), "prev", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_relink_42_args, lsn_prev), "lsn_prev", ""},
  +	{LOGREC_ARG, SSZ(__db_relink_42_args, next), "next", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_relink_42_args, lsn_next), "lsn_next", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_debug_desc[] = {
  +	{LOGREC_DBT, SSZ(__db_debug_args, op), "op", ""},
  +	{LOGREC_ARG, SSZ(__db_debug_args, fileid), "fileid", "%ld"},
  +	{LOGREC_DBT, SSZ(__db_debug_args, key), "key", ""},
  +	{LOGREC_DBT, SSZ(__db_debug_args, data), "data", ""},
  +	{LOGREC_ARG, SSZ(__db_debug_args, arg_flags), "arg_flags", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_noop_desc[] = {
  +	{LOGREC_DB, SSZ(__db_noop_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_noop_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_noop_args, prevlsn), "prevlsn", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pg_alloc_42_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pg_alloc_42_args, fileid), "fileid", ""},
  +	{LOGREC_POINTER, SSZ(__db_pg_alloc_42_args, meta_lsn), "meta_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_alloc_42_args, meta_pgno), "meta_pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_alloc_42_args, page_lsn), "page_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_alloc_42_args, pgno), "pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pg_alloc_42_args, ptype), "ptype", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pg_alloc_42_args, next), "next", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pg_alloc_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pg_alloc_args, fileid), "fileid", ""},
  +	{LOGREC_POINTER, SSZ(__db_pg_alloc_args, meta_lsn), "meta_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_alloc_args, meta_pgno), "meta_pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_alloc_args, page_lsn), "page_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_alloc_args, pgno), "pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pg_alloc_args, ptype), "ptype", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pg_alloc_args, next), "next", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pg_alloc_args, last_pgno), "last_pgno", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pg_free_42_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pg_free_42_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_free_42_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_free_42_args, meta_lsn), "meta_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_free_42_args, meta_pgno), "meta_pgno", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__db_pg_free_42_args, header), "header", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_free_42_args, next), "next", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pg_free_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pg_free_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_free_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_free_args, meta_lsn), "meta_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_free_args, meta_pgno), "meta_pgno", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__db_pg_free_args, header), "header", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_free_args, next), "next", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pg_free_args, last_pgno), "last_pgno", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_cksum_desc[] = {
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pg_freedata_42_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pg_freedata_42_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_freedata_42_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_freedata_42_args, meta_lsn), "meta_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_freedata_42_args, meta_pgno), "meta_pgno", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__db_pg_freedata_42_args, header), "header", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_freedata_42_args, next), "next", "%lu"},
  +	{LOGREC_PGDDBT, SSZ(__db_pg_freedata_42_args, data), "data", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pg_freedata_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pg_freedata_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_freedata_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_freedata_args, meta_lsn), "meta_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_freedata_args, meta_pgno), "meta_pgno", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__db_pg_freedata_args, header), "header", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_freedata_args, next), "next", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pg_freedata_args, last_pgno), "last_pgno", "%lu"},
  +	{LOGREC_PGDDBT, SSZ(__db_pg_freedata_args, data), "data", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pg_init_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pg_init_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_init_args, pgno), "pgno", "%lu"},
  +	{LOGREC_PGDBT, SSZ(__db_pg_init_args, header), "header", ""},
  +	{LOGREC_PGDDBT, SSZ(__db_pg_init_args, data), "data", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pg_sort_44_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pg_sort_44_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_sort_44_args, meta), "meta", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_sort_44_args, meta_lsn), "meta_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_sort_44_args, last_free), "last_free", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_sort_44_args, last_lsn), "last_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_sort_44_args, last_pgno), "last_pgno", "%lu"},
  +	{LOGREC_DBT, SSZ(__db_pg_sort_44_args, list), "list", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pg_trunc_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pg_trunc_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_trunc_args, meta), "meta", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_trunc_args, meta_lsn), "meta_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_trunc_args, last_free), "last_free", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pg_trunc_args, last_lsn), "last_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pg_trunc_args, next_free), "next_free", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pg_trunc_args, last_pgno), "last_pgno", "%lu"},
  +	{LOGREC_PGLIST, SSZ(__db_pg_trunc_args, list), "list", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_realloc_desc[] = {
  +	{LOGREC_DB, SSZ(__db_realloc_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_realloc_args, prev_pgno), "prev_pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_realloc_args, page_lsn), "page_lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_realloc_args, next_free), "next_free", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_realloc_args, ptype), "ptype", "%lu"},
  +	{LOGREC_PGLIST, SSZ(__db_realloc_args, list), "list", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_relink_desc[] = {
  +	{LOGREC_DB, SSZ(__db_relink_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_relink_args, pgno), "pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_relink_args, new_pgno), "new_pgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_relink_args, prev_pgno), "prev_pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_relink_args, lsn_prev), "lsn_prev", ""},
  +	{LOGREC_ARG, SSZ(__db_relink_args, next_pgno), "next_pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_relink_args, lsn_next), "lsn_next", ""},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_merge_desc[] = {
  +	{LOGREC_DB, SSZ(__db_merge_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_merge_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_merge_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_merge_args, npgno), "npgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_merge_args, nlsn), "nlsn", ""},
  +	{LOGREC_PGDBT, SSZ(__db_merge_args, hdr), "hdr", ""},
  +	{LOGREC_PGDDBT, SSZ(__db_merge_args, data), "data", ""},
  +	{LOGREC_ARG, SSZ(__db_merge_args, pg_copy), "pg_copy", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
  +DB_LOG_RECSPEC __db_pgno_desc[] = {
  +	{LOGREC_DB, SSZ(__db_pgno_args, fileid), "fileid", ""},
  +	{LOGREC_ARG, SSZ(__db_pgno_args, pgno), "pgno", "%lu"},
  +	{LOGREC_POINTER, SSZ(__db_pgno_args, lsn), "lsn", ""},
  +	{LOGREC_ARG, SSZ(__db_pgno_args, indx), "indx", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pgno_args, opgno), "opgno", "%lu"},
  +	{LOGREC_ARG, SSZ(__db_pgno_args, npgno), "npgno", "%lu"},
  +	{LOGREC_Done, 0, "", ""}
  +};
   /*
    * PUBLIC: int __db_init_recover __P((ENV *, DB_DISTAB *));
    */
  @@ -3263,5 +260,17 @@
   	if ((ret = __db_add_recovery_int(env, dtabp,
   	    __db_pg_trunc_recover, DB___db_pg_trunc)) != 0)
   		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_realloc_recover, DB___db_realloc)) != 0)
  +		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_relink_recover, DB___db_relink)) != 0)
  +		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_merge_recover, DB___db_merge)) != 0)
  +		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_pgno_recover, DB___db_pgno)) != 0)
  +		return (ret);
   	return (0);
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_autop.c
  ============================================================================
  $ cvs diff -u -r1.6 -r1.6.2.1 db_autop.c
  --- db/db/db_autop.c	7 Jan 2010 22:02:22 -0000	1.6
  +++ db/db/db_autop.c	23 Aug 2010 13:36:42 -0000	1.6.2.1
  @@ -7,7 +7,6 @@
   #include "dbinc/db_page.h"
   #include "dbinc/db_dispatch.h"
   #include "dbinc/db_am.h"
  -#include "dbinc/log.h"
   #include "dbinc/txn.h"
   
   /*
  @@ -15,104 +14,66 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_addrem_print(env, dbtp, lsnp, notused2, notused3)
  +__db_addrem_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_addrem_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	return(__log_print_record(env, dbtp, lsnp, "__db_addrem", __db_addrem_desc, info));
  +}
   
  -	if ((ret =
  -	    __db_addrem_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_addrem%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\topcode: %lu\n", (u_long)argp->opcode);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tindx: %lu\n", (u_long)argp->indx);
  -	(void)printf("\tnbytes: %lu\n", (u_long)argp->nbytes);
  -	(void)printf("\thdr: ");
  -	for (i = 0; i < argp->hdr.size; i++) {
  -		ch = ((u_int8_t *)argp->hdr.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tdbt: ");
  -	for (i = 0; i < argp->dbt.size; i++) {
  -		ch = ((u_int8_t *)argp->dbt.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tpagelsn: [%lu][%lu]\n",
  -	    (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +/*
  + * PUBLIC: int __db_addrem_42_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC:     db_recops, void *));
  + */
  +int
  +__db_addrem_42_print(env, dbtp, lsnp, notused2, info)
  +	ENV *env;
  +	DBT *dbtp;
  +	DB_LSN *lsnp;
  +	db_recops notused2;
  +	void *info;
  +{
  +	COMPQUIET(notused2, DB_TXN_PRINT);
  +
  +	return(__log_print_record(env, dbtp, lsnp, "__db_addrem_42", __db_addrem_42_desc, info));
   }
   
   /*
    * PUBLIC: int __db_big_print __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
    */
   int
  -__db_big_print(env, dbtp, lsnp, notused2, notused3)
  +__db_big_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_big_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	return(__log_print_record(env, dbtp, lsnp, "__db_big", __db_big_desc, info));
  +}
   
  -	if ((ret =
  -	    __db_big_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_big%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\topcode: %lu\n", (u_long)argp->opcode);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tprev_pgno: %lu\n", (u_long)argp->prev_pgno);
  -	(void)printf("\tnext_pgno: %lu\n", (u_long)argp->next_pgno);
  -	(void)printf("\tdbt: ");
  -	for (i = 0; i < argp->dbt.size; i++) {
  -		ch = ((u_int8_t *)argp->dbt.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tpagelsn: [%lu][%lu]\n",
  -	    (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset);
  -	(void)printf("\tprevlsn: [%lu][%lu]\n",
  -	    (u_long)argp->prevlsn.file, (u_long)argp->prevlsn.offset);
  -	(void)printf("\tnextlsn: [%lu][%lu]\n",
  -	    (u_long)argp->nextlsn.file, (u_long)argp->nextlsn.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +/*
  + * PUBLIC: int __db_big_42_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC:     db_recops, void *));
  + */
  +int
  +__db_big_42_print(env, dbtp, lsnp, notused2, info)
  +	ENV *env;
  +	DBT *dbtp;
  +	DB_LSN *lsnp;
  +	db_recops notused2;
  +	void *info;
  +{
  +	COMPQUIET(notused2, DB_TXN_PRINT);
  +
  +	return(__log_print_record(env, dbtp, lsnp, "__db_big_42", __db_big_42_desc, info));
   }
   
   /*
  @@ -120,37 +81,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_ovref_print(env, dbtp, lsnp, notused2, notused3)
  +__db_ovref_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_ovref_args *argp;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __db_ovref_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_ovref%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tadjust: %ld\n", (long)argp->adjust);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_ovref", __db_ovref_desc, info));
   }
   
   /*
  @@ -158,43 +98,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_relink_42_print(env, dbtp, lsnp, notused2, notused3)
  +__db_relink_42_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_relink_42_args *argp;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __db_relink_42_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_relink_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\topcode: %lu\n", (u_long)argp->opcode);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tlsn: [%lu][%lu]\n",
  -	    (u_long)argp->lsn.file, (u_long)argp->lsn.offset);
  -	(void)printf("\tprev: %lu\n", (u_long)argp->prev);
  -	(void)printf("\tlsn_prev: [%lu][%lu]\n",
  -	    (u_long)argp->lsn_prev.file, (u_long)argp->lsn_prev.offset);
  -	(void)printf("\tnext: %lu\n", (u_long)argp->next);
  -	(void)printf("\tlsn_next: [%lu][%lu]\n",
  -	    (u_long)argp->lsn_next.file, (u_long)argp->lsn_next.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_relink_42", __db_relink_42_desc, info));
   }
   
   /*
  @@ -202,53 +115,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_debug_print(env, dbtp, lsnp, notused2, notused3)
  +__db_debug_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_debug_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret = __db_debug_read(env, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_debug%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\top: ");
  -	for (i = 0; i < argp->op.size; i++) {
  -		ch = ((u_int8_t *)argp->op.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tkey: ");
  -	for (i = 0; i < argp->key.size; i++) {
  -		ch = ((u_int8_t *)argp->key.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tdata: ");
  -	for (i = 0; i < argp->data.size; i++) {
  -		ch = ((u_int8_t *)argp->data.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\targ_flags: %lu\n", (u_long)argp->arg_flags);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_debug", __db_debug_desc, info));
   }
   
   /*
  @@ -256,36 +132,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_noop_print(env, dbtp, lsnp, notused2, notused3)
  +__db_noop_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_noop_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __db_noop_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_noop%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tprevlsn: [%lu][%lu]\n",
  -	    (u_long)argp->prevlsn.file, (u_long)argp->prevlsn.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_noop", __db_noop_desc, info));
   }
   
   /*
  @@ -293,41 +149,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_pg_alloc_42_print(env, dbtp, lsnp, notused2, notused3)
  +__db_pg_alloc_42_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_pg_alloc_42_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __db_pg_alloc_42_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_pg_alloc_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
  -	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
  -	(void)printf("\tpage_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->page_lsn.file, (u_long)argp->page_lsn.offset);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tptype: %lu\n", (u_long)argp->ptype);
  -	(void)printf("\tnext: %lu\n", (u_long)argp->next);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pg_alloc_42", __db_pg_alloc_42_desc, info));
   }
   
   /*
  @@ -335,42 +166,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_pg_alloc_print(env, dbtp, lsnp, notused2, notused3)
  +__db_pg_alloc_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_pg_alloc_args *argp;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __db_pg_alloc_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_pg_alloc%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
  -	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
  -	(void)printf("\tpage_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->page_lsn.file, (u_long)argp->page_lsn.offset);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tptype: %lu\n", (u_long)argp->ptype);
  -	(void)printf("\tnext: %lu\n", (u_long)argp->next);
  -	(void)printf("\tlast_pgno: %lu\n", (u_long)argp->last_pgno);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pg_alloc", __db_pg_alloc_desc, info));
   }
   
   /*
  @@ -378,46 +183,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_pg_free_42_print(env, dbtp, lsnp, notused2, notused3)
  +__db_pg_free_42_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_pg_free_42_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __db_pg_free_42_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_pg_free_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
  -	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
  -	(void)printf("\theader: ");
  -	for (i = 0; i < argp->header.size; i++) {
  -		ch = ((u_int8_t *)argp->header.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tnext: %lu\n", (u_long)argp->next);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pg_free_42", __db_pg_free_42_desc, info));
   }
   
   /*
  @@ -425,47 +200,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_pg_free_print(env, dbtp, lsnp, notused2, notused3)
  +__db_pg_free_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_pg_free_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __db_pg_free_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_pg_free%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
  -	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
  -	(void)printf("\theader: ");
  -	for (i = 0; i < argp->header.size; i++) {
  -		ch = ((u_int8_t *)argp->header.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tnext: %lu\n", (u_long)argp->next);
  -	(void)printf("\tlast_pgno: %lu\n", (u_long)argp->last_pgno);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pg_free", __db_pg_free_desc, info));
   }
   
   /*
  @@ -473,31 +217,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_cksum_print(env, dbtp, lsnp, notused2, notused3)
  +__db_cksum_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_cksum_args *argp;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret = __db_cksum_read(env, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_cksum%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_cksum", __db_cksum_desc, info));
   }
   
   /*
  @@ -505,52 +234,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_pg_freedata_42_print(env, dbtp, lsnp, notused2, notused3)
  +__db_pg_freedata_42_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_pg_freedata_42_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __db_pg_freedata_42_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_pg_freedata_42%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
  -	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
  -	(void)printf("\theader: ");
  -	for (i = 0; i < argp->header.size; i++) {
  -		ch = ((u_int8_t *)argp->header.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tnext: %lu\n", (u_long)argp->next);
  -	(void)printf("\tdata: ");
  -	for (i = 0; i < argp->data.size; i++) {
  -		ch = ((u_int8_t *)argp->data.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pg_freedata_42", __db_pg_freedata_42_desc, info));
   }
   
   /*
  @@ -558,53 +251,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_pg_freedata_print(env, dbtp, lsnp, notused2, notused3)
  +__db_pg_freedata_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_pg_freedata_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  -
  -	if ((ret =
  -	    __db_pg_freedata_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_pg_freedata%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
  -	(void)printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
  -	(void)printf("\theader: ");
  -	for (i = 0; i < argp->header.size; i++) {
  -		ch = ((u_int8_t *)argp->header.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tnext: %lu\n", (u_long)argp->next);
  -	(void)printf("\tlast_pgno: %lu\n", (u_long)argp->last_pgno);
  -	(void)printf("\tdata: ");
  -	for (i = 0; i < argp->data.size; i++) {
  -		ch = ((u_int8_t *)argp->data.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pg_freedata", __db_pg_freedata_desc, info));
   }
   
   /*
  @@ -612,48 +268,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_pg_init_print(env, dbtp, lsnp, notused2, notused3)
  +__db_pg_init_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_pg_init_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __db_pg_init_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_pg_init%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tpgno: %lu\n", (u_long)argp->pgno);
  -	(void)printf("\theader: ");
  -	for (i = 0; i < argp->header.size; i++) {
  -		ch = ((u_int8_t *)argp->header.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\tdata: ");
  -	for (i = 0; i < argp->data.size; i++) {
  -		ch = ((u_int8_t *)argp->data.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pg_init", __db_pg_init_desc, info));
   }
   
   /*
  @@ -661,48 +285,16 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_pg_sort_44_print(env, dbtp, lsnp, notused2, notused3)
  +__db_pg_sort_44_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_pg_sort_44_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  -
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	if ((ret =
  -	    __db_pg_sort_44_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_pg_sort_44%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tmeta: %lu\n", (u_long)argp->meta);
  -	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
  -	(void)printf("\tlast_free: %lu\n", (u_long)argp->last_free);
  -	(void)printf("\tlast_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->last_lsn.file, (u_long)argp->last_lsn.offset);
  -	(void)printf("\tlast_pgno: %lu\n", (u_long)argp->last_pgno);
  -	(void)printf("\tlist: ");
  -	for (i = 0; i < argp->list.size; i++) {
  -		ch = ((u_int8_t *)argp->list.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pg_sort_44", __db_pg_sort_44_desc, info));
   }
   
   /*
  @@ -710,49 +302,84 @@
    * PUBLIC:     db_recops, void *));
    */
   int
  -__db_pg_trunc_print(env, dbtp, lsnp, notused2, notused3)
  +__db_pg_trunc_print(env, dbtp, lsnp, notused2, info)
   	ENV *env;
   	DBT *dbtp;
   	DB_LSN *lsnp;
   	db_recops notused2;
  -	void *notused3;
  +	void *info;
   {
  -	__db_pg_trunc_args *argp;
  -	u_int32_t i;
  -	int ch;
  -	int ret;
  +	COMPQUIET(notused2, DB_TXN_PRINT);
   
  -	notused2 = DB_TXN_PRINT;
  -	notused3 = NULL;
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pg_trunc", __db_pg_trunc_desc, info));
  +}
   
  -	if ((ret =
  -	    __db_pg_trunc_read(env, NULL, NULL, dbtp->data, &argp)) != 0)
  -		return (ret);
  -	(void)printf(
  -    "[%lu][%lu]__db_pg_trunc%s: rec: %lu txnp %lx prevlsn [%lu][%lu]\n",
  -	    (u_long)lsnp->file, (u_long)lsnp->offset,
  -	    (argp->type & DB_debug_FLAG) ? "_debug" : "",
  -	    (u_long)argp->type,
  -	    (u_long)argp->txnp->txnid,
  -	    (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset);
  -	(void)printf("\tfileid: %ld\n", (long)argp->fileid);
  -	(void)printf("\tmeta: %lu\n", (u_long)argp->meta);
  -	(void)printf("\tmeta_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset);
  -	(void)printf("\tlast_free: %lu\n", (u_long)argp->last_free);
  -	(void)printf("\tlast_lsn: [%lu][%lu]\n",
  -	    (u_long)argp->last_lsn.file, (u_long)argp->last_lsn.offset);
  -	(void)printf("\tnext_free: %lu\n", (u_long)argp->next_free);
  -	(void)printf("\tlast_pgno: %lu\n", (u_long)argp->last_pgno);
  -	(void)printf("\tlist: ");
  -	for (i = 0; i < argp->list.size; i++) {
  -		ch = ((u_int8_t *)argp->list.data)[i];
  -		printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
  -	}
  -	(void)printf("\n");
  -	(void)printf("\n");
  -	__os_free(env, argp);
  -	return (0);
  +/*
  + * PUBLIC: int __db_realloc_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC:     db_recops, void *));
  + */
  +int
  +__db_realloc_print(env, dbtp, lsnp, notused2, info)
  +	ENV *env;
  +	DBT *dbtp;
  +	DB_LSN *lsnp;
  +	db_recops notused2;
  +	void *info;
  +{
  +	COMPQUIET(notused2, DB_TXN_PRINT);
  +
  +	return(__log_print_record(env, dbtp, lsnp, "__db_realloc", __db_realloc_desc, info));
  +}
  +
  +/*
  + * PUBLIC: int __db_relink_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC:     db_recops, void *));
  + */
  +int
  +__db_relink_print(env, dbtp, lsnp, notused2, info)
  +	ENV *env;
  +	DBT *dbtp;
  +	DB_LSN *lsnp;
  +	db_recops notused2;
  +	void *info;
  +{
  +	COMPQUIET(notused2, DB_TXN_PRINT);
  +
  +	return(__log_print_record(env, dbtp, lsnp, "__db_relink", __db_relink_desc, info));
  +}
  +
  +/*
  + * PUBLIC: int __db_merge_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC:     db_recops, void *));
  + */
  +int
  +__db_merge_print(env, dbtp, lsnp, notused2, info)
  +	ENV *env;
  +	DBT *dbtp;
  +	DB_LSN *lsnp;
  +	db_recops notused2;
  +	void *info;
  +{
  +	COMPQUIET(notused2, DB_TXN_PRINT);
  +
  +	return(__log_print_record(env, dbtp, lsnp, "__db_merge", __db_merge_desc, info));
  +}
  +
  +/*
  + * PUBLIC: int __db_pgno_print __P((ENV *, DBT *, DB_LSN *,
  + * PUBLIC:     db_recops, void *));
  + */
  +int
  +__db_pgno_print(env, dbtp, lsnp, notused2, info)
  +	ENV *env;
  +	DBT *dbtp;
  +	DB_LSN *lsnp;
  +	db_recops notused2;
  +	void *info;
  +{
  +	COMPQUIET(notused2, DB_TXN_PRINT);
  +
  +	return(__log_print_record(env, dbtp, lsnp, "__db_pgno", __db_pgno_desc, info));
   }
   
   /*
  @@ -798,5 +425,17 @@
   	if ((ret = __db_add_recovery_int(env, dtabp,
   	    __db_pg_trunc_print, DB___db_pg_trunc)) != 0)
   		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_realloc_print, DB___db_realloc)) != 0)
  +		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_relink_print, DB___db_relink)) != 0)
  +		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_merge_print, DB___db_merge)) != 0)
  +		return (ret);
  +	if ((ret = __db_add_recovery_int(env, dtabp,
  +	    __db_pgno_print, DB___db_pgno)) != 0)
  +		return (ret);
   	return (0);
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_cam.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 db_cam.c
  --- db/db/db_cam.c	16 Sep 2009 19:34:50 -0000	1.10
  +++ db/db/db_cam.c	23 Aug 2010 13:36:42 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2000-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2000, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -141,6 +141,16 @@
   			memset(&opd->mylock, 0, sizeof(opd->mylock));
   	}
   
  +	/*
  +	 * Remove this cursor's locker ID from its family.
  +	 */
  +	if (F_ISSET(dbc, DBC_OWN_LID) && F_ISSET(dbc, DBC_FAMILY)) {
  +		if ((t_ret = __lock_familyremove(env->lk_handle,
  +		    dbc->lref)) != 0 && ret == 0)
  +			ret = t_ret;
  +		F_CLR(dbc, DBC_FAMILY);
  +	}
  +
   	if ((txn = dbc->txn) != NULL)
   		txn->cursors--;
   
  @@ -150,7 +160,6 @@
   		if (txn != NULL)
   			txn->cursors--;
   		TAILQ_INSERT_TAIL(&dbp->free_queue, opd, links);
  -		opd = NULL;
   	}
   	TAILQ_INSERT_TAIL(&dbp->free_queue, dbc, links);
   	MUTEX_UNLOCK(env, dbp->mutex);
  @@ -1443,7 +1452,7 @@
   	env = dbp->env;
   	fdbc = sdbc = NULL;
   	sdbp = NULL;
  -	ret = t_ret = 0;
  +	t_ret = 0;
   	rmw = FLD_ISSET(*put_statep, DBC_PUT_RMW) ? DB_RMW : 0;
   
   	/*
  @@ -1714,7 +1723,7 @@
   
   	dbp = dbc->dbp;
   	env = dbp->env;
  -	ret = t_ret = s_count = 0;
  +	t_ret = 0;
   	put_state = 0;
   	sdbp = NULL;
   	pdbc = dbc_n = NULL;
  @@ -3272,10 +3281,8 @@
   	 */
   	if (closeme == NULL)
   		ret = 0;
  -	else if (txn == NULL)
  -		ret = __db_close(closeme, NULL, 0);
   	else
  -		ret = __txn_closeevent(env, txn, closeme);
  +		ret = __db_close(closeme, txn, 0);
   
   	return (ret);
   }
  @@ -3310,10 +3317,8 @@
   
   	if (doclose == 0)
   		ret = 0;
  -	else if (txn == NULL)
  -		ret = __db_close(sdbp, NULL, 0);
   	else
  -		ret = __txn_closeevent(env, txn, sdbp);
  +		ret = __db_close(sdbp, txn, 0);
   	return (ret);
   }
   
  @@ -3448,15 +3453,15 @@
   	DB *sdbp;
   	DBT *skeyp;
   {
  -	DBT *firstkey, *lastkey, *key1, *key2;
  +	DBT *first_key, *last_key, *key1, *key2;
   	ENV *env;
   
   	env = sdbp->env;
   
  -	firstkey = (DBT *)skeyp->data;
  -	lastkey = firstkey + skeyp->size;
  -	for (key1 = firstkey; key1 < lastkey; key1++)
  -		for (key2 = key1 + 1; key2 < lastkey; key2++)
  +	first_key = (DBT *)skeyp->data;
  +	last_key = first_key + skeyp->size;
  +	for (key1 = first_key; key1 < last_key; key1++)
  +		for (key2 = key1 + 1; key2 < last_key; key2++)
   			DB_ASSERT(env,
   			    ((BTREE *)sdbp->bt_internal)->bt_compare(sdbp,
   			    key1, key2) != 0);
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_cds.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.4.2.1 db_cds.c
  --- db/db/db_cds.c	16 Sep 2009 19:34:50 -0000	1.4
  +++ db/db/db_cds.c	23 Aug 2010 13:36:42 -0000	1.4.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 2000-2009 Oracle.  All rights reserved.
  + * Copyright (c) 2000, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -154,7 +154,7 @@
   	if ((ret = __lock_id(env, &txn->txnid, &txn->locker)) != 0)
   		goto err;
   
  -	txn->flags = TXN_CDSGROUP;
  +	txn->flags = TXN_FAMILY;
   	txn->abort = __cdsgroup_abort;
   	txn->commit = __cdsgroup_commit;
   	txn->discard = __cdsgroup_discard;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_conv.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 db_conv.c
  --- db/db/db_conv.c	16 Sep 2009 19:34:50 -0000	1.9
  +++ db/db/db_conv.c	23 Aug 2010 13:36:42 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ -47,7 +47,6 @@
   #include "dbinc/db_swap.h"
   #include "dbinc/btree.h"
   #include "dbinc/hash.h"
  -#include "dbinc/log.h"
   #include "dbinc/qam.h"
   
   /*
  @@ -162,8 +161,22 @@
   	case P_INVALID:
   		if (pginfo->type == DB_QUEUE)
   			return (__qam_pgin_out(env, pg, pp, cookie));
  -		else
  -			return (__ham_pgin(dbp, pg, pp, cookie));
  +		/*
  +		 * This page is either newly allocated from the end of the
  +		 * file, or from the free list, or it is an as-yet unwritten
  +		 * hash bucket page. In this last case it needs to be
  +		 * initialized, but never byte-swapped. Otherwise the header
  +		 * may need swapping. It will not be a metadata page, so the
  +		 * byte swapping code of __ham_pgin is adequate.  If hash
  +		 * is not configured fall back to btree swapping.
  +		 */
  +#ifdef HAVE_HASH
  +		return (__ham_pgin(dbp, pg, pp, cookie));
  +#else
  +		return (__bam_pgin(dbp, pg, pp, cookie));
  +#endif
  +		/* NOTREACHED. */
  +		break;
   	case P_HASH_UNSORTED:
   	case P_HASH:
   	case P_HASHMETA:
  @@ -217,10 +230,22 @@
   	ret = 0;
   	switch (pagep->type) {
   	case P_INVALID:
  -		if (pginfo->type == DB_QUEUE)
  +		switch (pginfo->type) {
  +		case DB_QUEUE:
   			ret = __qam_pgin_out(env, pg, pp, cookie);
  -		else
  +			break;
  +#ifdef HAVE_HASH
  +		case DB_HASH:
   			ret = __ham_pgout(dbp, pg, pp, cookie);
  +			break;
  +#endif
  +		case DB_BTREE:
  +		case DB_RECNO:
  +			ret = __bam_pgout(dbp, pg, pp, cookie);
  +			break;
  +		default:
  +			return (__db_pgfmt(env, pg));
  +		}
   		break;
   	case P_HASH:
   	case P_HASH_UNSORTED:
  @@ -450,8 +475,6 @@
   	if (pagesize == 0)
   		return (0);
   
  -	env = dbp->env;
  -
   	if (pgin) {
   		M_32_SWAP(h->lsn.file);
   		M_32_SWAP(h->lsn.offset);
  @@ -462,6 +485,10 @@
   		M_16_SWAP(h->hf_offset);
   	}
   
  +	if (dbp == NULL)
  +		return (0);
  +	env = dbp->env;
  +
   	pgend = (u_int8_t *)h + pagesize;
   
   	inp = P_INP(dbp, h);
  @@ -645,25 +672,23 @@
    *	that case, pdata is not NULL we reconsitute
    *
    * PUBLIC: int __db_pageswap
  - * PUBLIC:         __P((DB *, void *, size_t, DBT *, int));
  + * PUBLIC:         __P((ENV *, DB *, void *, size_t, DBT *, int));
    */
   int
  -__db_pageswap(dbp, pp, len, pdata, pgin)
  +__db_pageswap(env, dbp, pp, len, pdata, pgin)
  +	ENV *env;
   	DB *dbp;
   	void *pp;
   	size_t len;
   	DBT *pdata;
   	int pgin;
   {
  -	ENV *env;
   	db_pgno_t pg;
   	size_t pgsize;
   	void *pgcopy;
   	int ret;
   	u_int16_t hoffset;
   
  -	env = dbp->env;
  -
   	switch (TYPE(pp)) {
   	case P_BTREEMETA:
   		return (__bam_mswap(env, pp));
  @@ -731,3 +756,112 @@
   
   	return (ret);
   }
  +
  +/*
  + * __db_recordswap --
  + *	Byteswap any database record.
  + *
  + * PUBLIC: void __db_recordswap __P((u_int32_t,
  + * PUBLIC:     u_int32_t, void *, void *, u_int32_t));
  + */
  +void
  +__db_recordswap(op, size, hdr, data, pgin)
  +	u_int32_t op;
  +	u_int32_t size;
  +	void *hdr, *data;
  +	u_int32_t pgin;
  +{
  +	BKEYDATA *bk;
  +	BOVERFLOW *bo;
  +	BINTERNAL *bi;
  +	RINTERNAL *ri;
  +	db_indx_t tmp;
  +	u_int8_t *p, *end;
  +
  +	if (size == 0)
  +		return;
  +	switch (OP_PAGE_GET(op)) {
  +	case P_LDUP:
  +	case P_LBTREE:
  +	case P_LRECNO:
  +		bk = (BKEYDATA *)hdr;
  +		switch (B_TYPE(bk->type)) {
  +		case B_KEYDATA:
  +			M_16_SWAP(bk->len);
  +			break;
  +		case B_DUPLICATE:
  +		case B_OVERFLOW:
  +			bo = (BOVERFLOW *)hdr;
  +			M_32_SWAP(bo->pgno);
  +			M_32_SWAP(bo->tlen);
  +			break;
  +		default:
  +			DB_ASSERT(NULL, bk->type != bk->type);
  +		}
  +		break;
  +	case P_IBTREE:
  +		bi = (BINTERNAL *)hdr;
  +		M_16_SWAP(bi->len);
  +		M_32_SWAP(bi->pgno);
  +		M_32_SWAP(bi->nrecs);
  +		if (B_TYPE(bi->type) == B_OVERFLOW) {
  +			if (data == NULL) {
  +				DB_ASSERT(NULL,
  +				    size == BINTERNAL_SIZE(BOVERFLOW_SIZE));
  +				bo = (BOVERFLOW *)bi->data;
  +			} else
  +				bo = (BOVERFLOW *)data;
  +			M_32_SWAP(bo->pgno);
  +		}
  +		break;
  +	case P_IRECNO:
  +		ri = (RINTERNAL *)hdr;
  +		M_32_SWAP(ri->pgno);
  +		M_32_SWAP(ri->nrecs);
  +		break;
  +	case P_OVERFLOW:
  +		break;
  +	case P_HASH:
  +	case P_HASH_UNSORTED:
  +		switch (OP_MODE_GET(op)) {
  +		/* KEYDATA and DUPLICATE records do not inclued the header. */
  +		case H_KEYDATA:
  +			break;
  +		case H_DUPLICATE:
  +			p = (u_int8_t *)hdr;
  +			for (end = p + size; p < end;) {
  +				if (pgin) {
  +					P_16_SWAP(p);
  +					memcpy(&tmp,
  +					    p, sizeof(db_indx_t));
  +					p += sizeof(db_indx_t);
  +				} else {
  +					memcpy(&tmp,
  +					    p, sizeof(db_indx_t));
  +					SWAP16(p);
  +				}
  +				p += tmp;
  +				SWAP16(p);
  +			}
  +			break;
  +		/* These two record types include the full header. */
  +		case H_OFFDUP:
  +			p = (u_int8_t *)hdr;
  +			p += SSZ(HOFFPAGE, pgno);
  +			SWAP32(p);			/* pgno */
  +			break;
  +		case H_OFFPAGE:
  +			p = (u_int8_t *)hdr;
  +			p += SSZ(HOFFPAGE, pgno);
  +			SWAP32(p);			/* pgno */
  +			SWAP32(p);			/* tlen */
  +			break;
  +		default:
  +			DB_ASSERT(NULL, op != op);
  +		}
  +		break;
  +
  +	default:
  +		DB_ASSERT(NULL, op != op);
  +	}
  +}
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_dispatch.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_dispatch.c
  --- db/db/db_dispatch.c	16 Sep 2009 19:34:50 -0000	1.11
  +++ db/db/db_dispatch.c	23 Aug 2010 13:36:42 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1995, 1996
  @@ -44,9 +44,9 @@
   #include "dbinc/hash.h"
   #include "dbinc/fop.h"
   #include "dbinc/lock.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   #include "dbinc/txn.h"
  +#include "dbinc/log_verify.h"
   
   static int __db_txnlist_find_internal __P((ENV *, DB_TXNHEAD *,
   		db_txnlist_type, u_int32_t,  DB_TXNLIST **,
  @@ -62,27 +62,39 @@
    * recovery paradigm will supply a different dispatch function to txn_open.
    *
    * PUBLIC: int __db_dispatch __P((ENV *,
  - * PUBLIC:     DB_DISTAB *, DBT *, DB_LSN *, db_recops, DB_TXNHEAD *));
  + * PUBLIC:     DB_DISTAB *, DBT *, DB_LSN *, db_recops, void *));
    */
   int
  -__db_dispatch(env, dtab, db, lsnp, redo, info)
  +__db_dispatch(env, dtab, db, lsnp, redo, params)
   	ENV *env;		/* The environment. */
   	DB_DISTAB *dtab;
   	DBT *db;		/* The log record upon which to dispatch. */
   	DB_LSN *lsnp;		/* The lsn of the record being dispatched. */
   	db_recops redo;		/* Redo this op (or undo it). */
  -	DB_TXNHEAD *info;	/* Transaction list. */
  +	void *params;
   {
   	DB_ENV *dbenv;
  +	DB_TXNHEAD *info;	/* Transaction list. */
  +	DB_LOG_VRFY_INFO *lvh;
   	DB_LSN prev_lsn;
   	u_int32_t rectype, status, txnid, urectype;
   	int make_call, ret;
   
   	dbenv = env->dbenv;
  +	make_call = ret = 0;
  +	lvh = NULL;
  +	info = NULL;
   	LOGCOPY_32(env, &rectype, db->data);
   	LOGCOPY_32(env, &txnid, (u_int8_t *)db->data + sizeof(rectype));
   
  -	make_call = ret = 0;
  +	/*
  +	 * Log verification passes a DB_LOG_VRFY_INFO structure, others
  +	 * pass a DB_TXNHEAD structure.
  +	 */
  +	if (redo != DB_TXN_LOG_VERIFY)
  +		info = (DB_TXNHEAD *)params;
  +	else
  +		lvh = (DB_LOG_VRFY_INFO *)params;
   
   	/* If we don't have a dispatch table, it's hard to dispatch. */
   	DB_ASSERT(env, dtab != NULL);
  @@ -96,6 +108,7 @@
   	switch (redo) {
   	case DB_TXN_ABORT:
   	case DB_TXN_APPLY:
  +	case DB_TXN_LOG_VERIFY:
   	case DB_TXN_PRINT:
   		make_call = 1;
   		break;
  @@ -263,6 +276,12 @@
   			}
   		}
   		if (rectype >= DB_user_BEGIN) {
  +			/*
  +			 * Increment user log count, we can't pass any extra
  +			 * args into app_dispatch, so this has to be done here.
  +			 */
  +			if (redo == DB_TXN_LOG_VERIFY)
  +				lvh->external_logrec_cnt++;
   			if (dbenv->app_dispatch != NULL)
   				return (dbenv->app_dispatch(dbenv,
   				    db, lsnp, redo));
  @@ -276,6 +295,7 @@
   				    (u_long)rectype);
   				return (EINVAL);
   			}
  +
   			return ((dtab->ext_dispatch[urectype])(dbenv,
   			    db, lsnp, redo));
   		} else {
  @@ -284,10 +304,14 @@
   				__db_errx(env,
   				    "Illegal record type %lu in log",
   				    (u_long)rectype);
  +				if (redo == DB_TXN_LOG_VERIFY)
  +					lvh->unknown_logrec_cnt++;
  +
   				return (EINVAL);
   			}
  +
   			return ((dtab->int_dispatch[rectype])(env,
  -			    db, lsnp, redo, info));
  +			    db, lsnp, redo, params));
   		}
   	}
   
  @@ -674,13 +698,13 @@
    */
   static int
   __db_txnlist_find_internal(env,
  -    hp, type, txnid, txnlistp, delete, statusp)
  +    hp, type, txnid, txnlistp, del, statusp)
   	ENV *env;
   	DB_TXNHEAD *hp;
   	db_txnlist_type type;
   	u_int32_t  txnid;
   	DB_TXNLIST **txnlistp;
  -	int delete;
  +	int del;
   	u_int32_t *statusp;
   {
   	struct __db_headlink *head;
  @@ -721,7 +745,7 @@
   		default:
   			return (__env_panic(env, EINVAL));
   		}
  -		if (delete == 1) {
  +		if (del == 1) {
   			LIST_REMOVE(p, links);
   			__os_free(env, p);
   			*txnlistp = NULL;
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_dup.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 db_dup.c
  --- db/db/db_dup.c	16 Sep 2009 19:34:50 -0000	1.9
  +++ db/db/db_dup.c	23 Aug 2010 13:36:42 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -11,6 +11,7 @@
   #include "db_int.h"
   #include "dbinc/db_page.h"
   #include "dbinc/mp.h"
  +#include "dbinc/log.h"
   #include "dbinc/db_am.h"
   
   /*
  @@ -89,8 +90,8 @@
   	if (DBC_LOGGING(dbc)) {
   		ldbt.data = P_ENTRY(dbp, pagep, indx);
   		ldbt.size = nbytes;
  -		if ((ret = __db_addrem_log(dbp, dbc->txn,
  -		    &LSN(pagep), 0, DB_REM_DUP, PGNO(pagep),
  +		if ((ret = __db_addrem_log(dbp, dbc->txn, &LSN(pagep), 0,
  +		    OP_SET(DB_REM_DUP, pagep), PGNO(pagep),
   		    (u_int32_t)indx, nbytes, &ldbt, NULL, &LSN(pagep))) != 0)
   			return (ret);
   	} else
  @@ -192,8 +193,8 @@
   	 * placeholder for the trailing variable-length data field.
   	 */
   	if (DBC_LOGGING(dbc)) {
  -		if ((ret = __db_addrem_log(dbp, dbc->txn,
  -		    &LSN(pagep), 0, DB_ADD_DUP, PGNO(pagep),
  +		if ((ret = __db_addrem_log(dbp, dbc->txn, &LSN(pagep), 0,
  +		    OP_SET(DB_ADD_DUP, pagep), PGNO(pagep),
   		    (u_int32_t)indx, nbytes, hdr, data, &LSN(pagep))) != 0)
   			return (ret);
   	} else
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_iface.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_iface.c
  --- db/db/db_iface.c	7 Jan 2010 22:02:22 -0000	1.11
  +++ db/db/db_iface.c	23 Aug 2010 13:36:42 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -16,7 +16,6 @@
   #include "dbinc/qam.h"			/* For __db_no_queue_am(). */
   #endif
   #include "dbinc/lock.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   #include "dbinc/partition.h"
   #include "dbinc/txn.h"
  @@ -36,6 +35,8 @@
   static int __db_pget_arg __P((DB *, DBT *, u_int32_t));
   static int __db_put_arg __P((DB *, DBT *, DBT *, u_int32_t));
   static int __dbt_ferr __P((const DB *, const char *, const DBT *, int));
  +static int __db_compact_func
  +    __P((DBC *, DBC *, u_int32_t *, db_pgno_t, u_int32_t, void *));
   static int __db_associate_foreign_arg __P((DB *, DB *,
   		int (*)(DB *, const DBT *, DBT *, const DBT *, int *),
   		u_int32_t));
  @@ -288,7 +289,7 @@
   	/* Check for replication block. */
   	rep_blocked = 0;
   	if (txn == NULL && IS_ENV_REPLICATED(env)) {
  -		if ((ret = __op_rep_enter(env)) != 0)
  +		if ((ret = __op_rep_enter(env, 0)) != 0)
   			goto err;
   		rep_blocked = 1;
   		renv = env->reginfo->primary;
  @@ -315,6 +316,15 @@
   
   	ret = __db_cursor(dbp, ip, txn, dbcp, flags);
   
  +	/*
  +	 * Register externally created cursors into the valid transaction.
  +	 * If a family transaction was passed in, the transaction handle in
  +	 * the cursor may not match.
  +	 */
  +	txn = (*dbcp)->txn;
  +	if (txn != NULL && ret == 0)
  +		TAILQ_INSERT_HEAD(&(txn->my_cursors), *dbcp, txn_cursors);
  +
   err:	/* Release replication block on error. */
   	if (ret != 0 && rep_blocked)
   		(void)__op_rep_exit(env);
  @@ -562,7 +572,8 @@
   	 * specific incompatibilities here.  This saves making __get_arg
   	 * aware of the exist method's API constraints.
   	 */
  -	STRIP_AUTO_COMMIT(flags);	
  +	STRIP_AUTO_COMMIT(flags);
  +
   	if ((ret = __db_fchk(dbp->env, "DB->exists", flags,
   	    DB_READ_COMMITTED | DB_READ_UNCOMMITTED | DB_RMW)) != 0)
   		return (ret);
  @@ -1124,6 +1135,17 @@
   	}
   
   	/*
  +	 * A replication client can't create a database, but it's convenient to
  +	 * allow a repmgr application to specify DB_CREATE anyway.  Thus for
  +	 * such an application the meaning of DB_CREATE becomes "create it if
  +	 * I'm a master, and otherwise ignore the flag".  A repmgr application
  +	 * running as master can't be sure that it won't spontaneously become a
  +	 * client, so there's a race condition.
  +	 */
  +	if (IS_REP_CLIENT(env) && !F_ISSET(dbp, DB_AM_NOT_DURABLE))
  +		LF_CLR(DB_CREATE);
  +
  +	/*
   	 * Create local transaction as necessary, check for consistent
   	 * transaction usage.
   	 */
  @@ -1132,7 +1154,7 @@
   			goto err;
   		txn_local = 1;
   	} else if (txn != NULL && !TXN_ON(env) &&
  -	    (!CDB_LOCKING(env) || !F_ISSET(txn, TXN_CDSGROUP))) {
  +	    (!CDB_LOCKING(env) || !F_ISSET(txn, TXN_FAMILY))) {
   		ret = __db_not_txn_env(env);
   		goto err;
   	}
  @@ -1707,6 +1729,31 @@
   }
   
   /*
  + * __db_compact_func
  + *	Callback routine to report if the txn has open cursors.
  + */
  +static int
  +__db_compact_func(dbc, my_dbc, countp, pgno, indx, args)
  +	DBC *dbc, *my_dbc;
  +	u_int32_t *countp;
  +	db_pgno_t pgno;
  +	u_int32_t indx;
  +	void *args;
  +{
  +	DB_TXN *txn;
  +
  +	COMPQUIET(my_dbc, NULL);
  +	COMPQUIET(countp, NULL);
  +	COMPQUIET(pgno, 0);
  +	COMPQUIET(indx, 0);
  +
  +	txn = (DB_TXN *)args;
  +
  +	if (txn == dbc->txn)
  +		return (EEXIST);
  +	return (0);
  +}
  +/*
    * __db_compact_pp --
    *	DB->compact pre/post processing.
    *
  @@ -1726,6 +1773,7 @@
   	DB_THREAD_INFO *ip;
   	ENV *env;
   	int handle_check, ret, t_ret;
  +	u_int32_t count;
   
   	env = dbp->env;
   
  @@ -1759,6 +1807,19 @@
   		goto err;
   	}
   
  +	if (txn != NULL) {
  +		if ((ret = __db_walk_cursors(dbp,
  +		    NULL, __db_compact_func, &count, 0, 0, &txn)) != 0) {
  +			if (ret == EEXIST) {
  +				__db_errx(env,
  +	"DB->compact may not be called with active cursors in the transaction."
  +				);
  +				ret = EINVAL;
  +			}
  +			goto err;
  +		}
  +	}
  +
   	if (c_data == NULL) {
   		dp = &l_data;
   		memset(dp, 0, sizeof(*dp));
  @@ -1771,12 +1832,9 @@
   #endif
   	switch (dbp->type) {
   	case DB_HASH:
  -		if (!LF_ISSET(DB_FREELIST_ONLY))
  -			goto err;
  -		/* FALLTHROUGH */
   	case DB_BTREE:
   	case DB_RECNO:
  -		ret = __bam_compact(dbp, ip, txn, start, stop, dp, flags, end);
  +		ret = __db_compact_int(dbp, ip, txn, start, stop, dp, flags, end);
   		break;
   
   	default:
  @@ -1947,10 +2005,12 @@
   	DB *dbp;
   	DB_THREAD_INFO *ip;
   	ENV *env;
  +	DB_TXN *txn;
   	int handle_check, ret, t_ret;
   
   	dbp = dbc->dbp;
   	env = dbp->env;
  +	txn = dbc->txn;
   
   	/*
   	 * If the cursor is already closed we have a serious problem, and we
  @@ -1966,6 +2026,17 @@
   
   	/* Check for replication block. */
   	handle_check = dbc->txn == NULL && IS_ENV_REPLICATED(env);
  +
  +	/* Unregister the cursor from its transaction, regardless of ret. */
  +	if (txn != NULL) {
  +		TAILQ_REMOVE(&(txn->my_cursors), dbc, txn_cursors);
  +		dbc->txn_cursors.tqe_next = NULL;
  +		dbc->txn_cursors.tqe_prev = NULL;
  +	} else {
  +		DB_ASSERT(env, dbc->txn_cursors.tqe_next == NULL &&
  +		    dbc->txn_cursors.tqe_prev == NULL);
  +	}
  +
   	ret = __dbc_close(dbc);
   
   	/* Release replication block. */
  @@ -2007,7 +2078,7 @@
   	}
   
   	if (dbp != odbp) {
  -		__db_errx(env, 
  +		__db_errx(env,
   "DBcursor->cmp both cursors must refer to the same database.");
   		return (EINVAL);
   	}
  @@ -2150,7 +2221,7 @@
   	DB *dbp;
   	DB_THREAD_INFO *ip;
   	ENV *env;
  -	int ret;
  +	int rep_blocked, ret;
   
   	dbp = dbc->dbp;
   	env = dbp->env;
  @@ -2164,8 +2235,25 @@
   		return (__db_ferr(env, "DBcursor->dup", 0));
   
   	ENV_ENTER(env, ip);
  +	rep_blocked = 0;
  +	if (dbc->txn == NULL && IS_ENV_REPLICATED(env)) {
  +		if ((ret = __op_rep_enter(env, 1)) != 0)
  +			goto err;
  +		rep_blocked = 1;
  +	}
   	ret = __dbc_dup(dbc, dbcp, flags);
  +
  +	/* Register externally created cursors into the valid transaction. */
  +	DB_ASSERT(env, (*dbcp)->txn == dbc->txn);
  +	if ((*dbcp)->txn != NULL && ret == 0)
  +		TAILQ_INSERT_HEAD(&((*dbcp)->txn->my_cursors), *dbcp,
  +		    txn_cursors);
  +err:
  +	if (ret != 0 && rep_blocked)
  +		(void)__op_rep_exit(env);
  +
   	ENV_LEAVE(env, ip);
  +
   	return (ret);
   }
   
  @@ -2770,7 +2858,7 @@
   	 * specified if a transaction cookie is also specified, nor can the
   	 * flag be specified in a non-transactional environment.
   	 */
  -	if (*txnidp != NULL) {
  +	if (*txnidp != NULL && !F_ISSET(*txnidp, TXN_FAMILY)) {
   		__db_errx(env,
       "DB_AUTO_COMMIT may not be specified along with a transaction handle");
   		return (EINVAL);
  @@ -2786,7 +2874,7 @@
   	 * Our caller checked to see if replication is making a state change.
   	 * Don't call the user-level API (which would repeat that check).
   	 */
  -	return (__txn_begin(env, ip, NULL, txnidp, 0));
  +	return (__txn_begin(env, ip, *txnidp, txnidp, 0));
   }
   
   /*
  @@ -2803,10 +2891,6 @@
   {
   	int t_ret;
   
  -	/*
  -	 * We're resolving a transaction for the user, and must decrement the
  -	 * replication handle count.  Call the user-level API.
  -	 */
   	if (ret == 0)
   		return (__txn_commit(txn, nosync ? DB_TXN_NOSYNC : 0));
   
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_join.c
  ============================================================================
  $ cvs diff -u -r1.9 -r1.9.2.1 db_join.c
  --- db/db/db_join.c	16 Sep 2009 19:34:50 -0000	1.9
  +++ db/db/db_join.c	23 Aug 2010 13:36:42 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /*
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1998-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1998, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_meta.c
  ============================================================================
  $ cvs diff -u -r1.11 -r1.11.2.1 db_meta.c
  --- db/db/db_meta.c	7 Jan 2010 22:02:22 -0000	1.11
  +++ db/db/db_meta.c	23 Aug 2010 13:36:42 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    */
   /*
    * Copyright (c) 1990, 1993, 1994, 1995, 1996
  @@ -319,6 +319,10 @@
   	hash = 0;
   
   	pgno = PGNO_BASE_MD;
  +	if ((ret = __db_lget(dbc,
  +	    LCK_ALWAYS, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0)
  +		goto err;
  +
   #ifdef HAVE_HASH
   	if (dbp->type == DB_HASH) {
   		if ((ret = __ham_return_meta(dbc,
  @@ -334,10 +338,6 @@
   	}
   #endif
   	if (meta == NULL) {
  -		if ((ret = __db_lget(dbc,
  -		    LCK_ALWAYS, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0)
  -			goto err;
  -
   		/* If we support truncate, we might not dirty the meta page. */
   		if ((ret = __memp_fget(mpf, &pgno, dbc->thread_info, dbc->txn,
   #ifdef HAVE_FTRUNCATE
  @@ -366,6 +366,7 @@
   	 * the list.  If it goes in the middle of the list, we will drop the
   	 * meta page and get the previous page.
   	 */
  +	COMPQUIET(position, 0);
   	if ((ret = __memp_get_freelist(mpf, &nelem, &list)) != 0)
   		goto err1;
   	if (list == NULL)
  @@ -373,9 +374,10 @@
   
   	if (h->pgno != last_pgno) {
   		/*
  -		 * Put the page number in the sorted list.
  -		 * Finds its position and the previous page,
  -		 * extend the list, make room and insert.
  +		 * Put the page number in the sorted list.  Find its
  +		 * position and the previous page.  After logging we
  +		 * will extend the list, make room and insert the page in
  +		 * the list.
   		 */
   		position = 0;
   		if (nelem != 0) {
  @@ -388,17 +390,6 @@
   				prev_pgno = list[position];
   		}
   
  -		/* Put the page number into the list. */
  -		if ((ret = __memp_extend_freelist(mpf, nelem + 1, &list)) != 0)
  -			return (ret);
  -		if (prev_pgno != PGNO_INVALID)
  -			lp = &list[position + 1];
  -		else
  -			lp = list;
  -		if (nelem != 0 && position != nelem)
  -			memmove(lp + 1, lp,
  -			    (size_t)((u_int8_t*)&list[nelem] - (u_int8_t*)lp));
  -		*lp = h->pgno;
   	} else if (nelem != 0) {
   		/* Find the truncation point. */
   		for (lp = &list[nelem - 1]; lp >= list; lp--)
  @@ -507,6 +498,14 @@
   	} else
   #endif
   	if (h->pgno == last_pgno) {
  +		/*
  +		 * We are going to throw this page away, but if we are
  +		 * using MVCC then this version may stick around and we
  +		 * might have to make a copy.
  +		 */
  +		if (mpf->mfp->multiversion && (ret = __memp_dirty(mpf,
  +		    &h, dbc->thread_info, dbc->txn, dbc->priority, 0)) != 0)
  +			goto err1;
   		LSN(h) = *lsnp;
   		P_INIT(h, dbp->pgsize,
   		    h->pgno, PGNO_INVALID, next_pgno, 0, P_INVALID);
  @@ -522,6 +521,22 @@
   		meta->last_pgno--;
   		h = NULL;
   	} else {
  +#ifdef HAVE_FTRUNCATE
  +		if (list != NULL) {
  +			/* Put the page number into the list. */
  +			if ((ret =
  +			    __memp_extend_freelist(mpf, nelem + 1, &list)) != 0)
  +				goto err1;
  +			if (prev_pgno != PGNO_INVALID)
  +				lp = &list[position + 1];
  +			else
  +				lp = list;
  +			if (nelem != 0 && position != nelem)
  +				memmove(lp + 1, lp, (size_t)
  +				    ((u_int8_t*)&list[nelem] - (u_int8_t*)lp));
  +			*lp = h->pgno;
  +		}
  +#endif
   		/*
   		 * If we are not truncating the page then we
   		 * reinitialize it and put it at the head of
  @@ -627,11 +642,11 @@
   }
   
   /*
  - * __db_pg_truncate -- sort the freelist and find the truncation point.
  + * __db_pg_truncate -- find the truncation point in a sorted freelist.
    *
    * PUBLIC: #ifdef HAVE_FTRUNCATE
    * PUBLIC: int __db_pg_truncate __P((DBC *, DB_TXN *,
  - * PUBLIC:    db_pglist_t *, DB_COMPACT *, u_int32_t *, 
  + * PUBLIC:    db_pglist_t *, DB_COMPACT *, u_int32_t *,
    * PUBLIC:    db_pgno_t , db_pgno_t *, DB_LSN *, int));
    * PUBLIC: #endif
    */
  @@ -658,6 +673,7 @@
   	int last, ret;
   
   	ret = 0;
  +	h = NULL;
   
   	dbp = dbc->dbp;
   	mpf = dbp->mpf;
  @@ -683,7 +699,8 @@
   	lp = list;
   	slp = &list[elems];
   	/*
  -	 * Log the sorted list.  Don't overflow the log file.  
  +	 * Log the sorted list. We log the whole list so it can be rebuilt.
  +	 * Don't overflow the log file.
   	 */
   again:	if (DBC_LOGGING(dbc)) {
   		last = 1;
  @@ -695,22 +712,41 @@
   		if (ddbt.size > log_size / 2) {
   			elems = (log_size / 2) / sizeof(*lp);
   			ddbt.size = elems * sizeof(*lp);
  -			ddbt.data  = lp;
   			last = 0;
   			/*
  -			 * If we stoped before the truncation point
  -			 * then we need to truncate to here.
  +			 * If we stopped after the truncation point
  +			 * then we need to truncate from here.
   			 */
  -			if (lp + elems < &list[tpoint])
  +			if (lp + elems >= &list[tpoint])
   				lpgno = lp[elems - 1].pgno;
   		}
  +		/*
  +		 * If this is not the begining of the list fetch the end
  +		 * of the previous segment.  This page becomes the last_free
  +		 * page and will link to this segment if it is not truncated.
  +		 */
  +		if (lp != list) {
  +			if ((ret = __memp_fget(mpf, &lp[-1].pgno,
  +			    dbc->thread_info, txn, 0, &h)) != 0)
  +				goto err;
  +		}
  +
   		slp = &lp[elems];
   
   		ZERO_LSN(null_lsn);
   		if ((ret = __db_pg_trunc_log(dbp, dbc->txn,
  -		     lsnp, last == 1 ? DB_FLUSH : 0, PGNO_BASE_MD, lsnp,
  -		     PGNO_INVALID, &null_lsn, free_pgno, lpgno, &ddbt)) != 0)
  +		     lsnp, last == 1 ? DB_FLUSH : 0, PGNO_BASE_MD,
  +		     lsnp, h != NULL ? PGNO(h) : PGNO_INVALID,
  +		     h != NULL ? &LSN(h) : &null_lsn,
  +		     free_pgno, lpgno, &ddbt)) != 0)
   			goto err;
  +		if (h != NULL) {
  +			LSN(h) = *lsnp;
  +			if ((ret = __memp_fput(mpf,
  +			    dbc->thread_info, h, dbc->priority)) != 0)
  +				goto err;
  +		}
  +		h = NULL;
   	} else if (!in_recovery)
   		LSN_NOT_LOGGED(*lsnp);
   
  @@ -733,7 +769,7 @@
   					    dbc->thread_info, h, dbp->priority);
   					goto err;
   				}
  -			} else 
  +			} else
   				goto skip;
   		}
   
  @@ -747,10 +783,11 @@
   skip:		if ((ret = __memp_fput(mpf,
   		    dbc->thread_info, h, dbp->priority)) != 0)
   			goto err;
  +		h = NULL;
   	}
   
   	/*
  -	 * If we did not log everyting try again.  We start from slp and
  +	 * If we did not log everything try again.  We start from slp and
   	 * try to go to the end of the list.
   	 */
   	if (last == 0) {
  @@ -759,8 +796,13 @@
   		goto again;
   	}
   
  +	/*
  +	 * Truncate the file.  Its possible that the last page is the
  +	 * only one that got truncated and that's done in the caller.
  +	 */
   	if (pgno != *last_pgno) {
  -		if ((ret = __memp_ftruncate(mpf, dbc->txn, dbc->thread_info,
  +		if (tpoint != *nelemp &&
  +		    (ret = __memp_ftruncate(mpf, dbc->txn, dbc->thread_info,
   		    pgno + 1, in_recovery ? MP_TRUNC_RECOVER : 0)) != 0)
   			goto err;
   		if (c_data)
  @@ -769,12 +811,18 @@
   	}
   	*nelemp = tpoint;
   
  -err:	return (ret);
  +	if (0) {
  +err:		if (h != NULL)
  +			(void)__memp_fput(mpf,
  +			    dbc->thread_info, h, dbc->priority);
  +	}
  +	return (ret);
   }
   
   /*
    * __db_free_truncate --
  - *	Truncate free pages at the end of the file.
  + *	  Build a sorted free list and truncate free pages at the end
  + *	  of the file.
    *
    * PUBLIC: #ifdef HAVE_FTRUNCATE
    * PUBLIC: int __db_free_truncate __P((DB *, DB_THREAD_INFO *, DB_TXN *,
  @@ -885,9 +933,15 @@
   	 * The truncate point is the number of pages in the free
   	 * list back from the last page.  The number of pages
   	 * in the free list are the number that we can swap in.
  +	 * Adjust it down slightly so if we find higher numbered
  +	 * pages early and then free other pages later we can
  +	 * truncate them.
   	 */
  -	if (c_data)
  +	if (c_data) {
   		c_data->compact_truncate = (u_int32_t)meta->last_pgno - nelems;
  +		if (c_data->compact_truncate > nelems >> 2)
  +			c_data->compact_truncate -= nelems >> 2;
  +	}
   
   	if (nelems != 0 && listp != NULL) {
   		*listp = list;
  @@ -921,7 +975,7 @@
   	DB_MPOOLFILE *mpf;
   	PAGE *last_free, *pg;
   	db_pgno_t *lp, free_pgno, lpgno;
  -	db_pglist_t *plist, *pp;
  +	db_pglist_t *plist, *pp, *spp;
   	u_int32_t elem, log_size;
   	int last, ret;
   
  @@ -929,6 +983,7 @@
   	mpf = dbp->mpf;
   	plist = NULL;
   	last_free = NULL;
  +	pg = NULL;
   
   	if (start != 0 &&
   	    (ret = __memp_fget(mpf, &list[start - 1],
  @@ -951,6 +1006,7 @@
   			if ((ret = __memp_fput(mpf,
   			    dbc->thread_info, pg, DB_PRIORITY_VERY_LOW)) != 0)
   				goto err;
  +			pg = NULL;
   			pp++;
   		}
   		ZERO_LSN(null_lsn);
  @@ -958,7 +1014,7 @@
   		elem = nelem - start;
   		log_size = ((LOG *)dbc->env->
   		    lg_handle->reginfo.primary)->log_size;
  -again:		ddbt.data = pp;
  +again:		ddbt.data = spp = pp;
   		free_pgno = pp->pgno;
   		lpgno = meta->last_pgno;
   		ddbt.size = elem * sizeof(*pp);
  @@ -971,22 +1027,34 @@
   			last = 0;
   		} else
   			last = 1;
  -		if (last_free != NULL && last == 1) {
  -			if ((ret = __db_pg_trunc_log(dbp, dbc->txn, &LSN(meta),
  -			     DB_FLUSH, PGNO(meta), &LSN(meta), PGNO(last_free),
  -			     &LSN(last_free), free_pgno, lpgno, &ddbt)) != 0)
  -				goto err;
  -		} else if ((ret = __db_pg_trunc_log(dbp, dbc->txn,
  -		     &LSN(meta), last == 1 ? DB_FLUSH : 0,
  -		     PGNO(meta), &LSN(meta), PGNO_INVALID,
  -		     &null_lsn, free_pgno, lpgno, &ddbt)) != 0)
  +		/*
  +		 * Get the page which will link to this section if we abort.
  +		 * If this is the first segment then its last_free.
  +		 */
  +		if (spp == plist)
  +			pg = last_free;
  +		else if ((ret = __memp_fget(mpf, &spp[-1].pgno,
  +		     dbc->thread_info, dbc->txn, DB_MPOOL_DIRTY, &pg)) != 0)
   			goto err;
  +
  +		if ((ret = __db_pg_trunc_log(dbp, dbc->txn,
  +		     &LSN(meta), last == 1 ? DB_FLUSH : 0,
  +		     PGNO(meta), &LSN(meta),
  +		     pg != NULL ? PGNO(pg) : PGNO_INVALID,
  +		     pg != NULL ? &LSN(pg) : &null_lsn,
  +		     free_pgno, lpgno, &ddbt)) != 0)
  +			goto err;
  +		if (pg != NULL) {
  +			LSN(pg) = LSN(meta);
  +			if (pg != last_free && (ret = __memp_fput(mpf,
  +			    dbc->thread_info, pg, DB_PRIORITY_VERY_LOW)) != 0)
  +				goto err;
  +			pg = NULL;
  +		}
   		if (last == 0)
   			goto again;
   	} else
   		LSN_NOT_LOGGED(LSN(meta));
  -	if (last_free != NULL)
  -		LSN(last_free) = LSN(meta);
   
   	if ((ret = __memp_fput(mpf,
   	    dbc->thread_info, h, DB_PRIORITY_VERY_LOW)) != 0)
  @@ -1016,6 +1084,8 @@
   	/* We need to put the page on error. */
   	if (h != NULL)
   		(void)__memp_fput(mpf, dbc->thread_info, h, dbc->priority);
  +	if (pg != NULL && pg != last_free)
  +		(void)__memp_fput(mpf, dbc->thread_info, pg, dbc->priority);
   	if (last_free != NULL)
   		(void)__memp_fput(mpf,
   		    dbc->thread_info, last_free, dbc->priority);
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_method.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 db_method.c
  --- db/db/db_method.c	16 Sep 2009 19:34:50 -0000	1.10
  +++ db/db/db_method.c	23 Aug 2010 13:36:42 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1999-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1999, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -196,6 +196,7 @@
   	int ret;
   
   	dbp->locker = NULL;
  +	dbp->alt_close = NULL;
   	LOCK_INIT(dbp->handle_lock);
   
   	TAILQ_INIT(&dbp->free_queue);
  @@ .
  patch -p0 <<'@@ .'
  Index: db/db/db_open.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.10.2.1 db_open.c
  --- db/db/db_open.c	16 Sep 2009 19:34:50 -0000	1.10
  +++ db/db/db_open.c	23 Aug 2010 13:36:42 -0000	1.10.2.1
  @@ -1,7 +1,7 @@
   /*-
    * See the file LICENSE for redistribution information.
    *
  - * Copyright (c) 1996-2009 Oracle.  All rights reserved.
  + * Copyright (c) 1996, 2010 Oracle and/or its affiliates.  All rights reserved.
    *
    * $Id$
    */
  @@ -17,7 +17,6 @@
   #include "dbinc/fop.h"
   #include "dbinc/hash.h"
   #include "dbinc/lock.h"
  -#include "dbinc/log.h"
   #include "dbinc/mp.h"
   #include "dbinc/qam.h"
   #include "dbinc/txn.h"
  @@ -73,11 +72,12 @@
   		if ((ret = __db_create_internal(&tdbp, dbp->env, 0)) != 0)
   			goto err;
   		ret = __db_open(tdbp, ip, txn, fname, dname, DB_UNKNOWN,
  -		     flags &  ~(DB_TRUNCATE|DB_CREATE), mode, meta_pgno);
  +		     DB_NOERROR | (flags &  ~(DB_TRUNCATE|DB_CREATE)),
  +		     mode, meta_pgno);
   		if (ret == 0)
   			ret = __memp_ftruncate(tdbp->mpf, txn, ip, 0, 0);
   		(void)__db_close(tdbp, txn, DB_NOSYNC);
  -		if (ret != 0 && ret != ENOENT)
  +		if (ret != 0 && ret != ENOENT && ret != EINVAL)
   			goto err;
   		ret = 0;
   	}
  @@ -625,3 +625,107 @@
   		    name);
   	return (ret == 0 ? EINVAL : ret);
   }
  +
  +/*
  + * __db_reopen --
  + *	Reopen a subdatabase if its meta/root pages move.
  + * PUBLIC: int __db_reopen __P((DBC *));
  + */
  +int
  +__db_reopen(dbc)
  +	DBC *dbc;
  +{
  +	BTREE *bt;
  +	HASH *ht;
  +	DB *dbp, *mdbp;
  +	DB_LOCK meta_lock, new_lock, old_lock;
  +	PAGE *new_page, *old_page;
  +	db_pgno_t newpgno, oldpgno;
  +	int ret, t_ret;
  +
  +	dbp = dbc->dbp;
  +	old_page = new_page = NULL;
  +	LOCK_INIT(meta_lock);
  +	LOCK_INIT(new_lock);
  +	LOCK_INIT(old_lock);
  +	mdbp = NULL;
  +
  +	COMPQUIET(bt, NULL);
  +	COMPQUIET(ht, NULL);
  +
  +	/*
  +	 * Lock the master meta data page so we don't block holding
  +	 * the root pinned when opening the master database since
  +	 * readers will not lock the root.
  +	 */
  +	oldpgno = PGNO_BASE_MD;
  +	if (STD_LOCKING(dbc) && (ret = __db_lget(dbc,
  +	    0, oldpgno, DB_LOCK_WRITE, 0, &meta_lock)) != 0)
  +		return (ret);
  +
  +	if (dbp->type == DB_HASH) {
  +		ht = (HASH*)dbp->h_internal;
  +		oldpgno = ht->meta_pgno;
  +	} else {
  +		bt = (BTREE *)dbp->bt_internal;
  +		oldpgno = bt->bt_root;
  +	}
  +	if (STD_LOCKING(dbc) && (ret = __db_lget(dbc,
  +	    0, oldpgno, DB_LOCK_WRITE, 0, &old_lock)) != 0)
  +		goto err;
  +
  +	if ((ret = __memp_fget(dbp->mpf, &oldpgno,
  +	    dbc->thread_info, dbc->txn, DB_MPOOL_DIRTY, &old_page)) != 0)
  +		goto err;
  +
  +	if ((ret = __db_master_open(dbp,
  +	    dbc->thread_info, dbc->txn, dbp->fname, 0, 0, &mdbp)) != 0)
  +		goto err;
  +
  +	if ((ret = __db_master_update(mdbp, dbp, dbc->thread_info,
  +	    dbc->txn, dbp->dname, dbp->type, MU_OPEN, NULL, 0)) != 0)
  +		goto err;
  +
  +	if (dbp->type == DB_HASH)
  +		newpgno = ht->meta_pgno = dbp->meta_pgno;
  +	else {
  +		bt->bt_meta = dbp->meta_pgno;
  +		if ((ret = __bam_read_root(dbp,
  +		    dbc->thread_info, dbc->txn, bt->bt_meta, 0)) != 0)
  +			goto err;
  +		newpgno = bt->bt_root;
  +	}
  +
  +	if (oldpgno == newpgno)
  +		goto done;
  +
  +	if (STD_LOCKING(dbc) && (ret = __db_lget(dbc,
  +	    0, newpgno, DB_LOCK_WRITE, 0, &new_lock)) != 0)
  +		goto err;
  +
  +	if ((ret = __memp_fget(dbp->mpf, &newpgno,
  +	    dbc->thread_info, dbc->txn, DB_MPOOL_DIRTY, &new_page)) != 0)
  +		goto err;
  +
  +done:	if (dbp->type == DB_HASH)
  +		ht->