1 | /*------------------------------------------------------------------------- |
2 | * |
3 | * md.h |
4 | * magnetic disk storage manager public interface declarations. |
5 | * |
6 | * |
7 | * Portions Copyright (c) 1996-2019, 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/relfilenode.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 mdclose(SMgrRelation reln, ForkNumber forknum); |
25 | extern void mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo); |
26 | extern bool mdexists(SMgrRelation reln, ForkNumber forknum); |
27 | extern void mdunlink(RelFileNodeBackend rnode, ForkNumber forknum, bool isRedo); |
28 | extern void mdextend(SMgrRelation reln, ForkNumber forknum, |
29 | BlockNumber blocknum, char *buffer, bool skipFsync); |
30 | extern void mdprefetch(SMgrRelation reln, ForkNumber forknum, |
31 | BlockNumber blocknum); |
32 | extern void mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, |
33 | char *buffer); |
34 | extern void mdwrite(SMgrRelation reln, ForkNumber forknum, |
35 | BlockNumber blocknum, char *buffer, bool skipFsync); |
36 | extern void mdwriteback(SMgrRelation reln, ForkNumber forknum, |
37 | BlockNumber blocknum, BlockNumber nblocks); |
38 | extern BlockNumber mdnblocks(SMgrRelation reln, ForkNumber forknum); |
39 | extern void mdtruncate(SMgrRelation reln, ForkNumber forknum, |
40 | BlockNumber nblocks); |
41 | extern void mdimmedsync(SMgrRelation reln, ForkNumber forknum); |
42 | |
43 | extern void ForgetDatabaseSyncRequests(Oid dbid); |
44 | extern void DropRelationFiles(RelFileNode *delrels, int ndelrels, bool isRedo); |
45 | |
46 | /* md sync callbacks */ |
47 | extern int mdsyncfiletag(const FileTag *ftag, char *path); |
48 | extern int mdunlinkfiletag(const FileTag *ftag, char *path); |
49 | extern bool mdfiletagmatches(const FileTag *ftag, const FileTag *candidate); |
50 | |
51 | #endif /* MD_H */ |
52 | |