📄 btree.src
字号:
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996-2002 * Sleepycat Software. All rights reserved. * * $Id: btree.src,v 10.35 2002/04/17 19:02:56 krinsky Exp $ */PREFIX __bamDBPRIVATEINCLUDE #include "db_config.h"INCLUDEINCLUDE #ifndef NO_SYSTEM_INCLUDESINCLUDE #include <sys/types.h>INCLUDEINCLUDE #include <ctype.h>INCLUDE #include <string.h>INCLUDE #endifINCLUDEINCLUDE #include "db_int.h"INCLUDE #include "dbinc/crypto.h"INCLUDE #include "dbinc/db_page.h"INCLUDE #include "dbinc/db_dispatch.h"INCLUDE #include "dbinc/db_am.h"INCLUDE #include "dbinc/btree.h"INCLUDE #include "dbinc/log.h"INCLUDE #include "dbinc/rep.h"INCLUDE #include "dbinc/txn.h"INCLUDE/* * NOTE: pg_alloc and pg_free have been moved to db.src, where they belong. *//* * BTREE-split: used to log a page split. * * left: the page number for the low-order contents. * llsn: the left page's original LSN. * right: the page number for the high-order contents. * rlsn: the right page's original LSN. * indx: the number of entries that went to the left page. * npgno: the next page number * nlsn: the next page's original LSN (or 0 if no next page). * root_pgno: the root page number * pg: the split page's contents before the split. * opflags: SPL_NRECS: if splitting a tree that maintains a record count. */BEGIN split 62DB fileid int32_t ldWRLOCK left db_pgno_t luPOINTER llsn DB_LSN * luWRLOCK right db_pgno_t luPOINTER rlsn DB_LSN * luARG indx u_int32_t luARG npgno db_pgno_t luPOINTER nlsn DB_LSN * luWRLOCKNZ root_pgno db_pgno_t luPGDBT pg DBT sARG opflags u_int32_t luEND/* * BTREE-rsplit: used to log a reverse-split * * pgno: the page number of the page copied over the root. * pgdbt: the page being copied on the root page. * root_pgno: the root page number. * nrec: the tree's record count. * rootent: last entry on the root page. * rootlsn: the root page's original lsn. */BEGIN rsplit 63DB fileid int32_t ldWRLOCK pgno db_pgno_t luPGDBT pgdbt DBT sWRLOCK root_pgno db_pgno_t luARG nrec db_pgno_t luDBT rootent DBT sPOINTER rootlsn DB_LSN * luEND/* * BTREE-adj: used to log the adjustment of an index. * * pgno: the page modified. * lsn: the page's original lsn. * indx: the index adjusted. * indx_copy: the index to copy if inserting. * is_insert: 0 if a delete, 1 if an insert. */BEGIN adj 55DB fileid int32_t ldWRLOCK pgno db_pgno_t luPOINTER lsn DB_LSN * luARG indx u_int32_t luARG indx_copy u_int32_t luARG is_insert u_int32_t luEND/* * BTREE-cadjust: used to adjust the count change in an internal page. * * pgno: the page modified. * lsn: the page's original lsn. * indx: the index to be adjusted. * adjust: the signed adjustment. * opflags: CAD_UPDATEROOT: if root page count was adjusted. */BEGIN cadjust 56DB fileid int32_t ldWRLOCK pgno db_pgno_t luPOINTER lsn DB_LSN * luARG indx u_int32_t luARG adjust int32_t ldARG opflags u_int32_t luEND/* * BTREE-cdel: used to log the intent-to-delete of a cursor record. * * pgno: the page modified. * lsn: the page's original lsn. * indx: the index to be deleted. */BEGIN cdel 57DB fileid int32_t ldWRLOCK pgno db_pgno_t luPOINTER lsn DB_LSN * luARG indx u_int32_t luEND/* * BTREE-repl: used to log the replacement of an item. * * pgno: the page modified. * lsn: the page's original lsn. * orig: the original data. * new: the replacement data. * duplicate: the prefix of the replacement that matches the original. */BEGIN repl 58DB fileid int32_t ldWRLOCK pgno db_pgno_t luPOINTER lsn DB_LSN * luARG indx u_int32_t luARG isdeleted u_int32_t luDBT orig DBT sDBT repl DBT sARG prefix u_int32_t luARG suffix u_int32_t luEND/* * BTREE-root: log the assignment of a root btree page. */BEGIN root 59DB fileid int32_t ldWRLOCK meta_pgno db_pgno_t luWRLOCK root_pgno db_pgno_t luPOINTER meta_lsn DB_LSN * luEND/* * BTREE-curadj: undo cursor adjustments on txn abort. * Should only be processed during DB_TXN_ABORT. * NOTE: the first_indx field gets used to hold * signed index adjustment in one case. * care should be taken if its size is changed. */BEGIN curadj 64/* Fileid of db affected. */DB fileid int32_t ld/* Which adjustment. */ARG mode db_ca_mode ld/* Page entry is from. */ARG from_pgno db_pgno_t lu/* Page entry went to. */ARG to_pgno db_pgno_t lu/* Left page of root split. */ARG left_pgno db_pgno_t lu/* First index of dup set. Also used as adjustment. */ARG first_indx u_int32_t lu/* Index entry is from. */ARG from_indx u_int32_t lu/* Index where entry went. */ARG to_indx u_int32_t luEND/* * BTREE-rcuradj: undo cursor adjustments on txn abort in * renumbering recno trees. * Should only be processed during DB_TXN_ABORT. */BEGIN rcuradj 65/* Fileid of db affected. */DB fileid int32_t ld/* Which adjustment. */ARG mode ca_recno_arg ld/* Root page number. */ARG root db_pgno_t ld/* Recno of the adjustment. */ARG recno db_recno_t ld/* Order number of the adjustment. */ARG order u_int32_t ldEND
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -