PostgreSQL Source Code  git master
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-2024, 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/relfilelocator.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(const RelFileLocator *rlocator, 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 */
uint32 BlockNumber
Definition: block.h:31
unsigned char uint8
Definition: c.h:504
static char * buf
Definition: pg_test_fsync.c:73
ForkNumber
Definition: relpath.h:48
struct xl_smgr_create xl_smgr_create
void smgr_desc(StringInfo buf, XLogReaderState *record)
Definition: smgrdesc.c:21
void smgr_redo(XLogReaderState *record)
Definition: storage.c:940
const char * smgr_identify(uint8 info)
Definition: smgrdesc.c:46
struct xl_smgr_truncate xl_smgr_truncate
void log_smgrcreate(const RelFileLocator *rlocator, ForkNumber forkNum)
Definition: storage.c:186
ForkNumber forkNum
Definition: storage_xlog.h:36
RelFileLocator rlocator
Definition: storage_xlog.h:35
RelFileLocator rlocator
Definition: storage_xlog.h:49
BlockNumber blkno
Definition: storage_xlog.h:48