~vlad-lesin/percona-server/mysql-5.0.33-original

« back to all changes in this revision

Viewing changes to bdb/fileops/fileops.src

  • Committer: Vlad Lesin
  • Date: 2012-07-31 09:21:34 UTC
  • Revision ID: vladislav.lesin@percona.com-20120731092134-zfodx022b7992wsi
VirginĀ 5.0.33

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-
 
2
 * See the file LICENSE for redistribution information.
 
3
 *
 
4
 * Copyright (c) 2001-2002
 
5
 *      Sleepycat Software.  All rights reserved.
 
6
 *
 
7
 * $Id: fileops.src,v 1.8 2002/04/06 18:25:55 bostic Exp $
 
8
 */
 
9
 
 
10
PREFIX  __fop
 
11
DBPRIVATE
 
12
 
 
13
INCLUDE #include "db_config.h"
 
14
INCLUDE
 
15
INCLUDE #ifndef NO_SYSTEM_INCLUDES
 
16
INCLUDE #include <sys/types.h>
 
17
INCLUDE
 
18
INCLUDE #include <ctype.h>
 
19
INCLUDE #include <string.h>
 
20
INCLUDE #endif
 
21
INCLUDE
 
22
INCLUDE #include "db_int.h"
 
23
INCLUDE #include "dbinc/crypto.h"
 
24
INCLUDE #include "dbinc/db_page.h"
 
25
INCLUDE #include "dbinc/db_dispatch.h"
 
26
INCLUDE #include "dbinc/db_am.h"
 
27
INCLUDE #include "dbinc/log.h"
 
28
INCLUDE #include "dbinc/rep.h"
 
29
INCLUDE #include "dbinc/txn.h"
 
30
INCLUDE #include "dbinc/fop.h"
 
31
INCLUDE
 
32
 
 
33
/*
 
34
 * create -- create a file system object.
 
35
 *
 
36
 * name: name in the file system
 
37
 * appname: indicates if the name needs to go through __db_appname
 
38
 * mode: file system mode
 
39
 */
 
40
BEGIN create            143
 
41
DBT     name            DBT             s
 
42
ARG     appname         u_int32_t       lu
 
43
ARG     mode            u_int32_t       o
 
44
END
 
45
 
 
46
/*
 
47
 * remove -- remove a file system object.
 
48
 *
 
49
 * name: name in the file system
 
50
 * appname: indicates if the name needs to go through __db_appname
 
51
 */
 
52
BEGIN remove            144
 
53
DBT     name            DBT             s
 
54
DBT     fid             DBT             s
 
55
ARG     appname         u_int32_t       lu
 
56
END
 
57
 
 
58
/*
 
59
 * write: log the writing of data into an object.
 
60
 *
 
61
 * name: file containing the page.
 
62
 * appname: indicates if the name needs to go through __db_appname
 
63
 * offset: offset in the file.
 
64
 * page: the actual meta-data page.
 
65
 * flag: non-0 indicates that this is a tempfile, so we needn't undo
 
66
 *      these modifications (we'll toss the file).
 
67
 */
 
68
BEGIN write     145
 
69
DBT     name            DBT             s
 
70
ARG     appname         u_int32_t       lu
 
71
ARG     offset          u_int32_t       lu
 
72
PGDBT   page            DBT             s
 
73
ARG     flag            u_int32_t       lu
 
74
END
 
75
 
 
76
/*
 
77
 * rename: move a file from one name to another.
 
78
 * The appname value indicates if this is a path name that should be used
 
79
 * directly (i.e., no interpretation) or if it is a pathname that should
 
80
 * be interpreted via calls to __db_appname.  The fileid is the 20-byte
 
81
 * DB fileid of the file being renamed.  We need to check it on recovery
 
82
 * so that we don't inadvertently overwrite good files.
 
83
 */
 
84
BEGIN rename    146
 
85
DBT     oldname         DBT             s
 
86
DBT     newname         DBT             s
 
87
DBT     fileid          DBT             s
 
88
ARG     appname         u_int32_t       lu
 
89
END
 
90
 
 
91
/*
 
92
 * File removal record.  This is a DB-level log record that indicates
 
93
 * we've just completed some form of file removal.  The purpose of this
 
94
 * log record is to logically identify the particular instance of the
 
95
 * named file so that during recovery, in deciding if we should roll-forward
 
96
 * a remove or a rename, we can make sure that we don't roll one forward and
 
97
 * delete or overwrite the wrong file.
 
98
 * real_fid:    The 20-byte unique file identifier of the original file being
 
99
 *              removed.
 
100
 * tmp_fid:     The unique fid of the tmp file that is removed.
 
101
 * name:        The pre- __db_appname name of the file
 
102
 * child:       The transaction that removed or renamed the file.
 
103
 */
 
104
 */
 
105
BEGIN file_remove       141
 
106
DBT     real_fid        DBT     s
 
107
DBT     tmp_fid         DBT     s
 
108
DBT     name            DBT     s
 
109
ARG     appname         u_int32_t       lu
 
110
ARG     child           u_int32_t       lx
 
111
END