source: trunk/third/rpm/db/btree/btree.src @ 19079

Revision 19079, 5.0 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r19078, which included commits to RCS files with non-trunk default branches.
Line 
1/*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 1996-2002
5 *      Sleepycat Software.  All rights reserved.
6 *
7 * Id: btree.src,v 10.35 2002/04/17 19:02:56 krinsky Exp
8 */
9
10PREFIX  __bam
11DBPRIVATE
12
13INCLUDE #include "db_config.h"
14INCLUDE
15INCLUDE #ifndef NO_SYSTEM_INCLUDES
16INCLUDE #include <sys/types.h>
17INCLUDE
18INCLUDE #include <ctype.h>
19INCLUDE #include <string.h>
20INCLUDE #endif
21INCLUDE
22INCLUDE #include "db_int.h"
23INCLUDE #include "dbinc/crypto.h"
24INCLUDE #include "dbinc/db_page.h"
25INCLUDE #include "dbinc/db_dispatch.h"
26INCLUDE #include "dbinc/db_am.h"
27INCLUDE #include "dbinc/btree.h"
28INCLUDE #include "dbinc/log.h"
29INCLUDE #include "dbinc/rep.h"
30INCLUDE #include "dbinc/txn.h"
31INCLUDE
32
33/*
34 * NOTE: pg_alloc and pg_free have been moved to db.src, where they belong.
35 */
36
37/*
38 * BTREE-split: used to log a page split.
39 *
40 * left:        the page number for the low-order contents.
41 * llsn:        the left page's original LSN.
42 * right:       the page number for the high-order contents.
43 * rlsn:        the right page's original LSN.
44 * indx:        the number of entries that went to the left page.
45 * npgno:       the next page number
46 * nlsn:        the next page's original LSN (or 0 if no next page).
47 * root_pgno:   the root page number
48 * pg:          the split page's contents before the split.
49 * opflags:     SPL_NRECS: if splitting a tree that maintains a record count.
50 */
51BEGIN split             62
52DB      fileid          int32_t         ld
53WRLOCK  left            db_pgno_t       lu
54POINTER llsn            DB_LSN *        lu
55WRLOCK  right           db_pgno_t       lu
56POINTER rlsn            DB_LSN *        lu
57ARG     indx            u_int32_t       lu
58ARG     npgno           db_pgno_t       lu
59POINTER nlsn            DB_LSN *        lu
60WRLOCKNZ root_pgno      db_pgno_t       lu
61PGDBT   pg              DBT             s
62ARG     opflags         u_int32_t       lu
63END
64
65/*
66 * BTREE-rsplit: used to log a reverse-split
67 *
68 * pgno:        the page number of the page copied over the root.
69 * pgdbt:       the page being copied on the root page.
70 * root_pgno:   the root page number.
71 * nrec:        the tree's record count.
72 * rootent:     last entry on the root page.
73 * rootlsn:     the root page's original lsn.
74 */
75BEGIN rsplit            63
76DB      fileid          int32_t         ld
77WRLOCK  pgno            db_pgno_t       lu
78PGDBT   pgdbt           DBT             s
79WRLOCK  root_pgno       db_pgno_t       lu
80ARG     nrec            db_pgno_t       lu
81DBT     rootent         DBT             s
82POINTER rootlsn         DB_LSN *        lu
83END
84
85/*
86 * BTREE-adj: used to log the adjustment of an index.
87 *
88 * pgno:        the page modified.
89 * lsn:         the page's original lsn.
90 * indx:        the index adjusted.
91 * indx_copy:   the index to copy if inserting.
92 * is_insert:   0 if a delete, 1 if an insert.
93 */
94BEGIN adj               55
95DB      fileid          int32_t         ld
96WRLOCK  pgno            db_pgno_t       lu
97POINTER lsn             DB_LSN *        lu
98ARG     indx            u_int32_t       lu
99ARG     indx_copy       u_int32_t       lu
100ARG     is_insert       u_int32_t       lu
101END
102
103/*
104 * BTREE-cadjust: used to adjust the count change in an internal page.
105 *
106 * pgno:        the page modified.
107 * lsn:         the page's original lsn.
108 * indx:        the index to be adjusted.
109 * adjust:      the signed adjustment.
110 * opflags:     CAD_UPDATEROOT: if root page count was adjusted.
111 */
112BEGIN cadjust           56
113DB      fileid          int32_t         ld
114WRLOCK  pgno            db_pgno_t       lu
115POINTER lsn             DB_LSN *        lu
116ARG     indx            u_int32_t       lu
117ARG     adjust          int32_t         ld
118ARG     opflags         u_int32_t       lu
119END
120
121/*
122 * BTREE-cdel: used to log the intent-to-delete of a cursor record.
123 *
124 * pgno:        the page modified.
125 * lsn:         the page's original lsn.
126 * indx:        the index to be deleted.
127 */
128BEGIN cdel              57
129DB      fileid          int32_t         ld
130WRLOCK  pgno            db_pgno_t       lu
131POINTER lsn             DB_LSN *        lu
132ARG     indx            u_int32_t       lu
133END
134
135/*
136 * BTREE-repl: used to log the replacement of an item.
137 *
138 * pgno:        the page modified.
139 * lsn:         the page's original lsn.
140 * orig:        the original data.
141 * new:         the replacement data.
142 * duplicate:   the prefix of the replacement that matches the original.
143 */
144BEGIN repl              58
145DB      fileid          int32_t         ld
146WRLOCK  pgno            db_pgno_t       lu
147POINTER lsn             DB_LSN *        lu
148ARG     indx            u_int32_t       lu
149ARG     isdeleted       u_int32_t       lu
150DBT     orig            DBT             s
151DBT     repl            DBT             s
152ARG     prefix          u_int32_t       lu
153ARG     suffix          u_int32_t       lu
154END
155
156/*
157 * BTREE-root: log the assignment of a root btree page.
158 */
159BEGIN root              59
160DB      fileid          int32_t         ld
161WRLOCK  meta_pgno       db_pgno_t       lu
162WRLOCK  root_pgno       db_pgno_t       lu
163POINTER meta_lsn        DB_LSN *        lu
164END
165
166/*
167 * BTREE-curadj: undo cursor adjustments on txn abort.
168 *     Should only be processed during DB_TXN_ABORT.
169 * NOTE: the first_indx field gets used to hold
170 *      signed index adjustment in one case.
171 *      care should be taken if its size is changed.
172 */
173BEGIN curadj            64
174/* Fileid of db affected. */
175DB      fileid          int32_t         ld
176/* Which adjustment. */
177ARG     mode            db_ca_mode      ld
178/* Page entry is from. */
179ARG     from_pgno       db_pgno_t       lu
180/* Page entry  went to. */
181ARG     to_pgno         db_pgno_t       lu
182/* Left page of root split. */
183ARG     left_pgno       db_pgno_t       lu
184/* First index of dup set. Also used as adjustment. */
185ARG     first_indx      u_int32_t       lu
186/* Index entry is from. */
187ARG     from_indx       u_int32_t       lu
188/* Index where entry went. */
189ARG     to_indx         u_int32_t       lu
190END
191
192/*
193 * BTREE-rcuradj: undo cursor adjustments on txn abort in
194 *     renumbering recno trees.
195 *     Should only be processed during DB_TXN_ABORT.
196 */
197BEGIN rcuradj   65
198/* Fileid of db affected. */
199DB      fileid          int32_t         ld
200/* Which adjustment. */
201ARG     mode            ca_recno_arg    ld
202/* Root page number. */
203ARG     root            db_pgno_t       ld
204/* Recno of the adjustment. */
205ARG     recno           db_recno_t      ld
206/* Order number of the adjustment. */
207ARG     order           u_int32_t       ld
208END
Note: See TracBrowser for help on using the repository browser.