PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
storage_xlog.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * storage_xlog.h
4  * prototypes for XLog support for backend/catalog/storage.c
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/catalog/storage_xlog.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef STORAGE_XLOG_H
15 #define STORAGE_XLOG_H
16 
17 #include "access/xlogreader.h"
18 #include "lib/stringinfo.h"
19 #include "storage/block.h"
20 #include "storage/relfilenode.h"
21 
22 /*
23  * Declarations for smgr-related XLOG records
24  *
25  * Note: we log file creation and truncation here, but logging of deletion
26  * actions is handled by xact.c, because it is part of transaction commit.
27  */
28 
29 /* XLOG gives us high 4 bits */
30 #define XLOG_SMGR_CREATE 0x10
31 #define XLOG_SMGR_TRUNCATE 0x20
32 
33 typedef struct xl_smgr_create
34 {
38 
39 /* flags for xl_smgr_truncate */
40 #define SMGR_TRUNCATE_HEAP 0x0001
41 #define SMGR_TRUNCATE_VM 0x0002
42 #define SMGR_TRUNCATE_FSM 0x0004
43 #define SMGR_TRUNCATE_ALL \
44  (SMGR_TRUNCATE_HEAP|SMGR_TRUNCATE_VM|SMGR_TRUNCATE_FSM)
45 
46 typedef struct xl_smgr_truncate
47 {
50  int flags;
52 
53 extern void log_smgrcreate(RelFileNode *rnode, ForkNumber forkNum);
54 
55 extern void smgr_redo(XLogReaderState *record);
56 extern void smgr_desc(StringInfo buf, XLogReaderState *record);
57 extern const char *smgr_identify(uint8 info);
58 
59 #endif /* STORAGE_XLOG_H */
void smgr_redo(XLogReaderState *record)
Definition: storage.c:477
unsigned char uint8
Definition: c.h:256
uint32 BlockNumber
Definition: block.h:31
RelFileNode rnode
Definition: storage_xlog.h:49
void log_smgrcreate(RelFileNode *rnode, ForkNumber forkNum)
Definition: storage.c:125
const char * smgr_identify(uint8 info)
Definition: smgrdesc.c:47
struct xl_smgr_create xl_smgr_create
static char * buf
Definition: pg_test_fsync.c:67
ForkNumber
Definition: relpath.h:24
ForkNumber forkNum
Definition: storage_xlog.h:36
void smgr_desc(StringInfo buf, XLogReaderState *record)
Definition: smgrdesc.c:22
struct xl_smgr_truncate xl_smgr_truncate
BlockNumber blkno
Definition: storage_xlog.h:48
RelFileNode rnode
Definition: storage_xlog.h:35