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