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-2025, 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"
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
33typedef 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
46typedef struct xl_smgr_truncate
47{
50 int flags;
52
53extern void log_smgrcreate(const RelFileLocator *rlocator, ForkNumber forkNum);
54
55extern void smgr_redo(XLogReaderState *record);
56extern void smgr_desc(StringInfo buf, XLogReaderState *record);
57extern const char *smgr_identify(uint8 info);
58
59#endif /* STORAGE_XLOG_H */
uint32 BlockNumber
Definition: block.h:31
uint8_t uint8
Definition: c.h:486
static char * buf
Definition: pg_test_fsync.c:72
ForkNumber
Definition: relpath.h:56
const char * smgr_identify(uint8 info)
Definition: smgrdesc.c:46
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:965
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