mariadb/storage/bdb/db/db.src

260 lines
6.4 KiB
Text
Raw Normal View History

2001-03-04 19:42:05 -05:00
/*-
* See the file LICENSE for redistribution information.
*
2005-12-05 10:27:46 -08:00
* Copyright (c) 1996-2005
2001-03-04 19:42:05 -05:00
* Sleepycat Software. All rights reserved.
*
2005-12-05 10:27:46 -08:00
* $Id: db.src,v 12.2 2005/08/08 03:37:06 ubell Exp $
2001-03-04 19:42:05 -05:00
*/
2002-10-30 15:57:05 +04:00
PREFIX __db
DBPRIVATE
2001-03-04 19:42:05 -05:00
INCLUDE #ifndef NO_SYSTEM_INCLUDES
INCLUDE #include <sys/types.h>
INCLUDE
INCLUDE #include <ctype.h>
INCLUDE #include <string.h>
INCLUDE #endif
INCLUDE
INCLUDE #include "db_int.h"
2002-10-30 15:57:05 +04:00
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/log.h"
INCLUDE #include "dbinc/txn.h"
2001-03-04 19:42:05 -05:00
INCLUDE
/*
* addrem -- Add or remove an entry from a duplicate page.
*
* opcode: identifies if this is an add or delete.
* fileid: file identifier of the file being modified.
* pgno: duplicate page number.
* indx: location at which to insert or delete.
* nbytes: number of bytes added/removed to/from the page.
* hdr: header for the data item.
* dbt: data that is deleted or is to be added.
* pagelsn: former lsn of the page.
*
* If the hdr was NULL then, the dbt is a regular B_KEYDATA.
* If the dbt was NULL then the hdr is a complete item to be
* pasted on the page.
*/
BEGIN addrem 41
ARG opcode u_int32_t lu
2002-10-30 15:57:05 +04:00
DB fileid int32_t ld
2005-07-20 15:48:22 -07:00
ARG pgno db_pgno_t lu
2001-03-04 19:42:05 -05:00
ARG indx u_int32_t lu
2002-10-30 15:57:05 +04:00
ARG nbytes u_int32_t lu
PGDBT hdr DBT s
2001-03-04 19:42:05 -05:00
DBT dbt DBT s
POINTER pagelsn DB_LSN * lu
END
/*
* big -- Handles addition and deletion of big key/data items.
*
* opcode: identifies get/put.
* fileid: file identifier of the file being modified.
* pgno: page onto which data is being added/removed.
* prev_pgno: the page before the one we are logging.
* next_pgno: the page after the one we are logging.
* dbt: data being written onto the page.
* pagelsn: former lsn of the orig_page.
* prevlsn: former lsn of the prev_pgno.
* nextlsn: former lsn of the next_pgno. This is not currently used, but
* may be used later if we actually do overwrites of big key/
* data items in place.
*/
BEGIN big 43
ARG opcode u_int32_t lu
2002-10-30 15:57:05 +04:00
DB fileid int32_t ld
2005-07-20 15:48:22 -07:00
ARG pgno db_pgno_t lu
ARG prev_pgno db_pgno_t lu
ARG next_pgno db_pgno_t lu
2001-03-04 19:42:05 -05:00
DBT dbt DBT s
POINTER pagelsn DB_LSN * lu
POINTER prevlsn DB_LSN * lu
POINTER nextlsn DB_LSN * lu
END
/*
* ovref -- Handles increment/decrement of overflow page reference count.
*
* fileid: identifies the file being modified.
* pgno: page number whose ref count is being incremented/decremented.
* adjust: the adjustment being made.
* lsn: the page's original lsn.
*/
BEGIN ovref 44
2002-10-30 15:57:05 +04:00
DB fileid int32_t ld
2005-07-20 15:48:22 -07:00
ARG pgno db_pgno_t lu
2001-03-04 19:42:05 -05:00
ARG adjust int32_t ld
POINTER lsn DB_LSN * lu
END
/*
* Debug -- log an operation upon entering an access method.
* op: Operation (cursor, c_close, c_get, c_put, c_del,
* get, put, delete).
* fileid: identifies the file being acted upon.
* key: key paramater
* data: data parameter
* flags: flags parameter
*/
BEGIN debug 47
DBT op DBT s
ARG fileid int32_t ld
DBT key DBT s
DBT data DBT s
ARG arg_flags u_int32_t lu
END
/*
* noop -- do nothing, but get an LSN.
*/
BEGIN noop 48
2002-10-30 15:57:05 +04:00
DB fileid int32_t ld
2005-07-20 15:48:22 -07:00
ARG pgno db_pgno_t lu
2001-03-04 19:42:05 -05:00
POINTER prevlsn DB_LSN * lu
END
2002-10-30 15:57:05 +04:00
/*
* pg_alloc: used to record allocating a new page.
*
* meta_lsn: the meta-data page's original lsn.
* meta_pgno the meta-data page number.
* page_lsn: the allocated page's original lsn.
* pgno: the page allocated.
* ptype: the type of the page allocated.
* next: the next page on the free list.
2005-07-20 15:48:22 -07:00
* last_pgno: the last page in the file after this op.
2002-10-30 15:57:05 +04:00
*/
BEGIN pg_alloc 49
DB fileid int32_t ld
POINTER meta_lsn DB_LSN * lu
2005-07-20 15:48:22 -07:00
ARG meta_pgno db_pgno_t lu
2002-10-30 15:57:05 +04:00
POINTER page_lsn DB_LSN * lu
2005-07-20 15:48:22 -07:00
ARG pgno db_pgno_t lu
2002-10-30 15:57:05 +04:00
ARG ptype u_int32_t lu
ARG next db_pgno_t lu
2005-07-20 15:48:22 -07:00
ARG last_pgno db_pgno_t lu
2002-10-30 15:57:05 +04:00
END
/*
* pg_free: used to record freeing a page.
*
* pgno: the page being freed.
* meta_lsn: the meta-data page's original lsn.
* meta_pgno: the meta-data page number.
* header: the header from the free'd page.
* next: the previous next pointer on the metadata page.
2005-07-20 15:48:22 -07:00
* last_pgno: the last page in the file before this op.
2002-10-30 15:57:05 +04:00
*/
BEGIN pg_free 50
DB fileid int32_t ld
2005-07-20 15:48:22 -07:00
ARG pgno db_pgno_t lu
2002-10-30 15:57:05 +04:00
POINTER meta_lsn DB_LSN * lu
2005-07-20 15:48:22 -07:00
ARG meta_pgno db_pgno_t lu
2002-10-30 15:57:05 +04:00
PGDBT header DBT s
ARG next db_pgno_t lu
2005-07-20 15:48:22 -07:00
ARG last_pgno db_pgno_t lu
2002-10-30 15:57:05 +04:00
END
/*
* cksum --
* This log record is written when we're unable to checksum a page,
* before returning DB_RUNRECOVERY. This log record causes normal
* recovery to itself return DB_RUNRECOVERY, as only catastrophic
* recovery can fix things.
*/
BEGIN cksum 51
END
2005-07-20 15:48:22 -07:00
/*
* pg_freedata: used to record freeing a page with data on it.
*
* pgno: the page being freed.
* meta_lsn: the meta-data page's original lsn.
* meta_pgno: the meta-data page number.
* header: the header and index entries from the free'd page.
* data: the data from the free'd page.
* next: the previous next pointer on the metadata page.
* last_pgno: the last page in the file before this op.
*/
BEGIN pg_freedata 52
DB fileid int32_t ld
ARG pgno db_pgno_t lu
POINTER meta_lsn DB_LSN * lu
ARG meta_pgno db_pgno_t lu
PGDBT header DBT s
ARG next db_pgno_t lu
ARG last_pgno db_pgno_t lu
PGDBT data DBT s
END
/*
* pg_prepare: used to record an aborted page in a prepared transaction.
*
* pgno: the page being freed.
*/
BEGIN pg_prepare 53
DB fileid int32_t ld
ARG pgno db_pgno_t lu
END
/*
* pg_new: used to record a new page put on the free list.
*
* pgno: the page being freed.
* meta_lsn: the meta-data page's original lsn.
* meta_pgno: the meta-data page number.
* header: the header from the free'd page.
* next: the previous next pointer on the metadata page.
*/
BEGIN pg_new 54
DB fileid int32_t ld
ARG pgno db_pgno_t lu
POINTER meta_lsn DB_LSN * lu
ARG meta_pgno db_pgno_t lu
PGDBT header DBT s
ARG next db_pgno_t lu
END
/*
* pg_init: used to reinitialize a page during truncate.
*
* pgno: the page being initialized.
* header: the header from the page.
* data: data that used to be on the page.
*/
BEGIN pg_init 60
DB fileid int32_t ld
ARG pgno db_pgno_t lu
PGDBT header DBT s
PGDBT data DBT s
END
2005-12-05 10:27:46 -08:00
/*
* pg_sort: sort the free list
*
* meta: meta page number
* meta_lsn: lsn on meta page.
* last_free: page number of new last free page.
* last_lsn; lsn of last free page.
* last_pgno: current last page number.
* list: list of pages and lsns to sort.
*/
BEGIN pg_sort 61
DB fileid int32_t ld
ARG meta db_pgno_t lu
POINTER meta_lsn DB_LSN * lu
ARG last_free db_pgno_t lu
POINTER last_lsn DB_LSN * lu
ARG last_pgno db_pgno_t lu
DBT list DBT s
END