Lines Matching refs:PAGE
54 static int bt_broot(BTREE *, PAGE *, PAGE *, PAGE *);
55 static PAGE *bt_page(BTREE *, PAGE *, PAGE **, PAGE **, indx_t *, size_t);
57 static PAGE *bt_psplit(BTREE *, PAGE *, PAGE *, PAGE *, indx_t *, size_t);
58 static PAGE *bt_root(BTREE *, PAGE *, PAGE **, PAGE **, indx_t *, size_t);
59 static int bt_rroot(BTREE *, PAGE *, PAGE *, PAGE *);
60 static recno_t rec_total(PAGE *);
71 * sp: page to split
82 __bt_split(BTREE *t, PAGE *sp, const DBT *key, const DBT *data, int flags,
89 PAGE *h, *l, *r, *lchild, *rchild;
97 * Split the page into two pages, l and r. The split routines return
98 * a pointer to the page into which the key should be inserted and with
110 * Insert the new key/data pair into the leaf page. (Key inserts
111 * always cause a leaf page to split first.)
122 /* If the root page was split, make it look right. */
129 * Now we walk the parent page stack -- a LIFO stack of the pages that
130 * were traversed when we searched for the page that split. Each stack
131 * entry is a page number and a page index offset. The offset is for
132 * the page traversed on the search. We've just split a page, so we
133 * have to insert a new key into the parent page.
135 * If the insert into the parent page causes it to split, may have to
137 * splits or the page inserted into didn't have to split to hold the
138 * new key. Some algorithms replace the key for the old page as well
139 * as the new page. We don't, as there's no reason to believe that the
140 * first key on the old page is any better than the key we have, and,
147 * and the root page or the overflow key page when calling bt_preserve.
149 * root page or overflow page which is unlocked elsewhere.
155 /* Get the parent page. */
166 * Calculate the space needed on the parent page.
170 * the new entry and the LAST entry on the page to its left.
174 * page of each level, or the search will fail. Applicable
217 /* Split the parent page if necessary or shift the indices. */
234 /* Insert the key into the parent page. */
257 * Update the left page count. If split
258 * added at index 0, fix the correct page.
267 /* Update the right page count. */
275 * Update the left page count. If split
276 * added at index 0, fix the correct page.
285 /* Update the right page count. */
301 /* If the root page was split, make it look right. */
333 * BT_PAGE -- Split a non-root page of a btree.
337 * h: root page
338 * lp: pointer to left page pointer
339 * rp: pointer to right page pointer
344 * Pointer to page in which to insert or NULL on error.
346 static PAGE *
347 bt_page(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, indx_t *skip, size_t ilen)
349 PAGE *l, *r, *tp;
355 /* Put the new right page for the split into place. */
366 * If we're splitting the last page on a level because we're appending
368 * sorted. Adding an empty page on the side of the level is less work
387 /* Put the new left page for the split into place. */
402 /* Fix up the previous pointer of the page after the split page. */
414 * Split right. The key/data pairs aren't sorted in the btree page so
415 * it's simpler to copy the data from the split page onto two new pages
416 * instead of copying half the data to the right page and compacting
417 * the left page in place. Since the left page can't change, we have
418 * to swap the original and the allocated left page after the split.
422 /* Move the new left page onto the old left page. */
434 * BT_ROOT -- Split the root page of a btree.
438 * h: root page
439 * lp: pointer to left page pointer
440 * rp: pointer to right page pointer
445 * Pointer to page in which to insert or NULL on error.
447 static PAGE *
448 bt_root(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, indx_t *skip, size_t ilen)
450 PAGE *l, *r, *tp;
470 /* Split the root page. */
479 * BT_RROOT -- Fix up the recno root page after it has been split.
483 * h: root page
484 * l: left page
485 * r: right page
491 bt_rroot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
515 /* Unpin the root page, set to recno internal page. */
524 * BT_BROOT -- Fix up the btree root page after it has been split.
528 * h: root page
529 * l: left page
530 * r: right page
536 bt_broot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
544 * If the root page was a leaf page, change it into an internal page.
546 * a leaf page) to the new root page.
566 * If the key is on an overflow page, mark the overflow chain
588 /* There are two keys on the page. */
591 /* Unpin the root page, set to btree internal page. */
600 * BT_PSPLIT -- Do the real work of splitting the page.
604 * h: page to be split
605 * l: page to put lower half of data
606 * r: page to put upper half of data
611 * Pointer to page in which to insert.
613 static PAGE *
614 bt_psplit(BTREE *t, PAGE *h, PAGE *l, PAGE *r, indx_t *pskip, size_t ilen)
620 PAGE *rval;
630 * key. This makes internal page processing faster and can save
673 * possible size for the page, it's possible to get situations
674 * where we decide to try and copy too much onto the left page.
703 * Off is the last offset that's valid for the left page.
704 * Nxt is the first offset to be placed on the right page.
711 * If splitting the page that the cursor was on, the cursor has to be
714 * one. If the cursor is on the right page, it is decremented by the
715 * number of records split to the left page.
721 if (c->pg.index < nxt) /* Left page. */
723 else { /* Right page. */
730 * If the skipped index was on the left page, just return that page.
732 * the right page.
775 /* If the key is being appended to the page, adjust the index. */
788 * internal page.
792 * pg: page number of first page in the chain.
800 PAGE *h;
810 * REC_TOTAL -- Return the number of recno entries below a page.
813 * h: page
816 * The number of recno entries below a page.
824 rec_total(PAGE *h)