fileops.src 2.94 KB
Newer Older
ram@mysql.r18.ru's avatar
ram@mysql.r18.ru committed
1 2 3
/*-
 * See the file LICENSE for redistribution information.
 *
jimw@mysql.com's avatar
jimw@mysql.com committed
4
 * Copyright (c) 2001-2005
ram@mysql.r18.ru's avatar
ram@mysql.r18.ru committed
5 6
 *	Sleepycat Software.  All rights reserved.
 *
jimw@mysql.com's avatar
jimw@mysql.com committed
7
 * $Id: fileops.src,v 12.2 2005/06/16 20:22:47 bostic Exp $
ram@mysql.r18.ru's avatar
ram@mysql.r18.ru committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
 */

PREFIX	__fop
DBPRIVATE

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"
INCLUDE #include "dbinc/crypto.h"
INCLUDE #include "dbinc/db_page.h"
INCLUDE #include "dbinc/db_am.h"
INCLUDE #include "dbinc/log.h"
INCLUDE #include "dbinc/txn.h"
INCLUDE #include "dbinc/fop.h"
INCLUDE

/*
 * create -- create a file system object.
 *
 * name: name in the file system
 * appname: indicates if the name needs to go through __db_appname
 * mode: file system mode
 */
BEGIN create		143
DBT	name		DBT		s
ARG	appname		u_int32_t	lu
ARG	mode		u_int32_t	o
END

/*
 * remove -- remove a file system object.
 *
 * name: name in the file system
 * appname: indicates if the name needs to go through __db_appname
 */
BEGIN remove		144
DBT	name		DBT		s
DBT	fid		DBT		s
ARG	appname		u_int32_t	lu
END

/*
 * write: log the writing of data into an object.
 *
 * name: file containing the page.
 * appname: indicates if the name needs to go through __db_appname
jimw@mysql.com's avatar
jimw@mysql.com committed
59 60 61
 * pgsize: page size.
 * pageno: page number in the file.
 * offset: offset on the page.
ram@mysql.r18.ru's avatar
ram@mysql.r18.ru committed
62 63 64 65 66 67 68
 * page: the actual meta-data page.
 * flag: non-0 indicates that this is a tempfile, so we needn't undo
 *	these modifications (we'll toss the file).
 */
BEGIN write	145
DBT	name		DBT		s
ARG	appname		u_int32_t	lu
jimw@mysql.com's avatar
jimw@mysql.com committed
69 70
ARG	pgsize		u_int32_t	lu
ARG	pageno		db_pgno_t	lu
ram@mysql.r18.ru's avatar
ram@mysql.r18.ru committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
ARG	offset		u_int32_t	lu
PGDBT	page		DBT		s
ARG	flag		u_int32_t	lu
END

/*
 * rename: move a file from one name to another.
 * The appname value indicates if this is a path name that should be used
 * directly (i.e., no interpretation) or if it is a pathname that should
 * be interpreted via calls to __db_appname.  The fileid is the 20-byte
 * DB fileid of the file being renamed.  We need to check it on recovery
 * so that we don't inadvertently overwrite good files.
 */
BEGIN rename	146
DBT	oldname		DBT		s
DBT	newname		DBT		s
DBT	fileid		DBT		s
ARG	appname		u_int32_t	lu
END

/*
 * File removal record.  This is a DB-level log record that indicates
 * we've just completed some form of file removal.  The purpose of this
 * log record is to logically identify the particular instance of the
 * named file so that during recovery, in deciding if we should roll-forward
 * a remove or a rename, we can make sure that we don't roll one forward and
 * delete or overwrite the wrong file.
 * real_fid:	The 20-byte unique file identifier of the original file being
 *		removed.
 * tmp_fid:	The unique fid of the tmp file that is removed.
 * name:	The pre- __db_appname name of the file
 * child:	The transaction that removed or renamed the file.
 */
 */
BEGIN file_remove	141
DBT	real_fid	DBT	s
DBT	tmp_fid		DBT	s
DBT	name		DBT	s
ARG	appname		u_int32_t	lu
ARG	child		u_int32_t	lx
END