1 /*-------------------------------------------------------------------------
4 * magnetic disk storage manager public interface declarations.
7 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/storage/md.h
12 *-------------------------------------------------------------------------
17 #include "storage/block.h"
18 #include "storage/relfilelocator.h"
19 #include "storage/smgr.h"
20 #include "storage/sync.h"
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
);
35 extern void mdread(SMgrRelation reln
, ForkNumber forknum
, BlockNumber blocknum
,
37 extern void mdwrite(SMgrRelation reln
, ForkNumber forknum
,
38 BlockNumber blocknum
, const void *buffer
, bool skipFsync
);
39 extern void mdwriteback(SMgrRelation reln
, ForkNumber forknum
,
40 BlockNumber blocknum
, BlockNumber nblocks
);
41 extern BlockNumber
mdnblocks(SMgrRelation reln
, ForkNumber forknum
);
42 extern void mdtruncate(SMgrRelation reln
, ForkNumber forknum
,
44 extern void mdimmedsync(SMgrRelation reln
, ForkNumber forknum
);
46 extern void ForgetDatabaseSyncRequests(Oid dbid
);
47 extern void DropRelationFiles(RelFileLocator
*delrels
, int ndelrels
, bool isRedo
);
49 /* md sync callbacks */
50 extern int mdsyncfiletag(const FileTag
*ftag
, char *path
);
51 extern int mdunlinkfiletag(const FileTag
*ftag
, char *path
);
52 extern bool mdfiletagmatches(const FileTag
*ftag
, const FileTag
*candidate
);