PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
md.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * md.h
4  * magnetic disk storage manager public interface declarations.
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/storage/md.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef MD_H
15 #define MD_H
16 
17 #include "storage/block.h"
18 #include "storage/relfilelocator.h"
19 #include "storage/smgr.h"
20 #include "storage/sync.h"
21 
22 /* md storage manager functionality */
23 extern void mdinit(void);
24 extern void mdopen(SMgrRelation reln);
25 extern void mdclose(SMgrRelation reln, ForkNumber forknum);
26 extern void mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo);
27 extern bool mdexists(SMgrRelation reln, ForkNumber forknum);
28 extern void mdunlink(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo);
29 extern void mdextend(SMgrRelation reln, ForkNumber forknum,
30  BlockNumber blocknum, const void *buffer, bool skipFsync);
31 extern void mdzeroextend(SMgrRelation reln, ForkNumber forknum,
32  BlockNumber blocknum, int nblocks, bool skipFsync);
33 extern bool mdprefetch(SMgrRelation reln, ForkNumber forknum,
34  BlockNumber blocknum, int nblocks);
35 extern uint32 mdmaxcombine(SMgrRelation reln, ForkNumber forknum,
36  BlockNumber blocknum);
37 extern void mdreadv(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
38  void **buffers, BlockNumber nblocks);
39 extern void mdwritev(SMgrRelation reln, ForkNumber forknum,
40  BlockNumber blocknum,
41  const void **buffers, BlockNumber nblocks, bool skipFsync);
42 extern void mdwriteback(SMgrRelation reln, ForkNumber forknum,
43  BlockNumber blocknum, BlockNumber nblocks);
44 extern BlockNumber mdnblocks(SMgrRelation reln, ForkNumber forknum);
45 extern void mdtruncate(SMgrRelation reln, ForkNumber forknum,
46  BlockNumber nblocks);
47 extern void mdimmedsync(SMgrRelation reln, ForkNumber forknum);
48 extern void mdregistersync(SMgrRelation reln, ForkNumber forknum);
49 
50 extern void ForgetDatabaseSyncRequests(Oid dbid);
51 extern void DropRelationFiles(RelFileLocator *delrels, int ndelrels, bool isRedo);
52 
53 /* md sync callbacks */
54 extern int mdsyncfiletag(const FileTag *ftag, char *path);
55 extern int mdunlinkfiletag(const FileTag *ftag, char *path);
56 extern bool mdfiletagmatches(const FileTag *ftag, const FileTag *candidate);
57 
58 #endif /* MD_H */
uint32 BlockNumber
Definition: block.h:31
unsigned int uint32
Definition: c.h:492
void mdunlink(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
Definition: md.c:307
void mdwritev(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void **buffers, BlockNumber nblocks, bool skipFsync)
Definition: md.c:946
bool mdfiletagmatches(const FileTag *ftag, const FileTag *candidate)
Definition: md.c:1829
bool mdexists(SMgrRelation reln, ForkNumber forknum)
Definition: md.c:171
void mdreadv(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, void **buffers, BlockNumber nblocks)
Definition: md.c:825
BlockNumber mdnblocks(SMgrRelation reln, ForkNumber forknum)
Definition: md.c:1110
int mdunlinkfiletag(const FileTag *ftag, char *path)
Definition: md.c:1810
void mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
Definition: md.c:190
void mdextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void *buffer, bool skipFsync)
Definition: md.c:460
void mdinit(void)
Definition: md.c:158
void mdclose(SMgrRelation reln, ForkNumber forknum)
Definition: md.c:691
void mdzeroextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks, bool skipFsync)
Definition: md.c:525
int mdsyncfiletag(const FileTag *ftag, char *path)
Definition: md.c:1757
void mdwriteback(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, BlockNumber nblocks)
Definition: md.c:1051
uint32 mdmaxcombine(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum)
Definition: md.c:811
bool mdprefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks)
Definition: md.c:714
void mdregistersync(SMgrRelation reln, ForkNumber forknum)
Definition: md.c:1261
void mdopen(SMgrRelation reln)
Definition: md.c:680
void DropRelationFiles(RelFileLocator *delrels, int ndelrels, bool isRedo)
Definition: md.c:1467
void ForgetDatabaseSyncRequests(Oid dbid)
Definition: md.c:1449
void mdtruncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks)
Definition: md.c:1167
void mdimmedsync(SMgrRelation reln, ForkNumber forknum)
Definition: md.c:1312
unsigned int Oid
Definition: postgres_ext.h:31
ForkNumber
Definition: relpath.h:56
Definition: sync.h:51