PostgreSQL Source Code git master
Loading...
Searching...
No Matches
bufmgr.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * bufmgr.h
4 * POSTGRES buffer manager definitions.
5 *
6 *
7 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/storage/bufmgr.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#ifndef BUFMGR_H
15#define BUFMGR_H
16
17#include "port/pg_iovec.h"
18#include "storage/aio_types.h"
19#include "storage/block.h"
20#include "storage/buf.h"
21#include "storage/bufpage.h"
23#include "utils/relcache.h"
24#include "utils/snapmgr.h"
25
26typedef void *Block;
27
28/*
29 * Possible arguments for GetAccessStrategy().
30 *
31 * If adding a new BufferAccessStrategyType, also add a new IOContext so
32 * IO statistics using this strategy are tracked.
33 */
35{
36 BAS_NORMAL, /* Normal random access */
37 BAS_BULKREAD, /* Large read-only scan (hint bit updates are
38 * ok) */
39 BAS_BULKWRITE, /* Large multi-block write (e.g. COPY IN) */
40 BAS_VACUUM, /* VACUUM */
42
43/* Possible modes for ReadBufferExtended() */
44typedef enum
45{
46 RBM_NORMAL, /* Normal read */
47 RBM_ZERO_AND_LOCK, /* Don't read from disk, caller will
48 * initialize. Also locks the page. */
49 RBM_ZERO_AND_CLEANUP_LOCK, /* Like RBM_ZERO_AND_LOCK, but locks the page
50 * in "cleanup" mode */
51 RBM_ZERO_ON_ERROR, /* Read, but return an all-zeros page on error */
52 RBM_NORMAL_NO_LOG, /* Don't log page as invalid during WAL
53 * replay; otherwise same as RBM_NORMAL */
55
56/*
57 * Type returned by PrefetchBuffer().
58 */
60{
61 Buffer recent_buffer; /* If valid, a hit (recheck needed!) */
62 bool initiated_io; /* If true, a miss resulting in async I/O */
64
65/*
66 * Flags influencing the behaviour of ExtendBufferedRel*
67 */
69{
70 /*
71 * Don't acquire extension lock. This is safe only if the relation isn't
72 * shared, an access exclusive lock is held or if this is the startup
73 * process.
74 */
76
77 /* Is this extension part of recovery? */
79
80 /*
81 * Should the fork be created if it does not currently exist? This likely
82 * only ever makes sense for relation forks.
83 */
85
86 /* Should the first (possibly only) return buffer be returned locked? */
87 EB_LOCK_FIRST = (1 << 3),
88
89 /* Should the smgr size cache be cleared? */
91
92 /* internal flags follow */
93 EB_LOCK_TARGET = (1 << 5),
95
96/* forward declared, to avoid including smgr.h here */
98
99/*
100 * Some functions identify relations either by relation or smgr +
101 * relpersistence, initialized via the BMR_REL()/BMR_SMGR() macros below.
102 * This allows us to use the same function for both recovery and normal
103 * operation. When BMR_REL is used, it's not valid to cache its rd_smgr here,
104 * because our pointer would be obsolete in case of relcache invalidation.
105 * For simplicity, use BMR_GET_SMGR to read the smgr.
106 */
113
114#define BMR_REL(p_rel) \
115 ((BufferManagerRelation){.rel = p_rel})
116#define BMR_SMGR(p_smgr, p_relpersistence) \
117 ((BufferManagerRelation){.smgr = p_smgr, .relpersistence = p_relpersistence})
118#define BMR_GET_SMGR(bmr) \
119 (RelationIsValid((bmr).rel) ? RelationGetSmgr((bmr).rel) : (bmr).smgr)
120
121/* Zero out page if reading fails. */
122#define READ_BUFFERS_ZERO_ON_ERROR (1 << 0)
123/* Call smgrprefetch() if I/O necessary. */
124#define READ_BUFFERS_ISSUE_ADVICE (1 << 1)
125/* Don't treat page as invalid due to checksum failures. */
126#define READ_BUFFERS_IGNORE_CHECKSUM_FAILURES (1 << 2)
127/* IO will immediately be waited for */
128#define READ_BUFFERS_SYNCHRONOUSLY (1 << 3)
129
130
132{
133 /* The following members should be set by the caller. */
134 Relation rel; /* optional */
139
140 /*
141 * The following private members are private state for communication
142 * between StartReadBuffers() and WaitReadBuffers(), initialized only if
143 * an actual read is required, and should not be modified.
144 */
150 /* true if waiting on another backend's IO */
154};
155
157
158/* to avoid having to expose buf_internals.h here */
160
161/* in globals.c ... this duplicates miscadmin.h */
162extern PGDLLIMPORT int NBuffers;
163
164/* in bufmgr.c */
168extern PGDLLIMPORT bool track_io_timing;
169
170#define DEFAULT_EFFECTIVE_IO_CONCURRENCY 16
171#define DEFAULT_MAINTENANCE_IO_CONCURRENCY 16
174
175#define MAX_IO_COMBINE_LIMIT PG_IOV_MAX
176#define DEFAULT_IO_COMBINE_LIMIT Min(MAX_IO_COMBINE_LIMIT, (128 * 1024) / BLCKSZ)
177extern PGDLLIMPORT int io_combine_limit; /* min of the two GUCs below */
180
184
187
188/* in buf_init.c */
189extern PGDLLIMPORT char *BufferBlocks;
190
191/* in localbuf.c */
192extern PGDLLIMPORT int NLocBuffer;
195
196/* upper limit for effective_io_concurrency */
197#define MAX_IO_CONCURRENCY 1000
198
199/* special block number for ReadBuffer() */
200#define P_NEW InvalidBlockNumber /* grow the file to get a new page */
201
202/*
203 * Buffer content lock modes (mode argument for LockBuffer())
204 */
205typedef enum BufferLockMode
206{
208
209 /*
210 * A share lock conflicts with exclusive locks.
211 */
213
214 /*
215 * A share-exclusive lock conflicts with itself and exclusive locks.
216 */
218
219 /*
220 * An exclusive lock conflicts with every other lock type.
221 */
224
225
226/*
227 * prototypes for functions in bufmgr.c
228 */
230 ForkNumber forkNum,
231 BlockNumber blockNum);
233 BlockNumber blockNum);
234extern bool ReadRecentBuffer(RelFileLocator rlocator, ForkNumber forkNum,
235 BlockNumber blockNum, Buffer recent_buffer);
236extern Buffer ReadBuffer(Relation reln, BlockNumber blockNum);
239 BufferAccessStrategy strategy);
241 ForkNumber forkNum, BlockNumber blockNum,
243 bool permanent);
244
246 Buffer *buffer,
247 BlockNumber blocknum,
248 int flags);
250 Buffer *buffers,
251 BlockNumber blockNum,
252 int *nblocks,
253 int flags);
255
256extern void ReleaseBuffer(Buffer buffer);
257extern void UnlockReleaseBuffer(Buffer buffer);
258extern bool BufferIsLockedByMe(Buffer buffer);
260extern bool BufferIsDirty(Buffer buffer);
261extern void MarkBufferDirty(Buffer buffer);
262extern void IncrBufferRefCount(Buffer buffer);
263extern void CheckBufferIsPinnedOnce(Buffer buffer);
264extern Buffer ReleaseAndReadBuffer(Buffer buffer, Relation relation,
265 BlockNumber blockNum);
266
268 ForkNumber forkNum,
269 BufferAccessStrategy strategy,
270 uint32 flags);
273 BufferAccessStrategy strategy,
274 uint32 flags,
276 Buffer *buffers,
280 BufferAccessStrategy strategy,
281 uint32 flags,
284
285extern void InitBufferManagerAccess(void);
286extern void AtEOXact_Buffers(bool isCommit);
287#ifdef USE_ASSERT_CHECKING
288extern void AssertBufferLocksPermitCatalogRead(void);
289#endif
290extern char *DebugPrintBufferRefcount(Buffer buffer);
291extern void CheckPointBuffers(int flags);
294 ForkNumber forkNum);
295extern void FlushOneBuffer(Buffer buffer);
296extern void FlushRelationBuffers(Relation rel);
297extern void FlushRelationsAllBuffers(SMgrRelation *smgrs, int nrels);
300 bool permanent);
301extern void FlushDatabaseBuffers(Oid dbid);
303 ForkNumber *forkNum,
306 int nlocators);
307extern void DropDatabaseBuffers(Oid dbid);
308
309#define RelationGetNumberOfBlocks(reln) \
310 RelationGetNumberOfBlocksInFork(reln, MAIN_FORKNUM)
311
312extern bool BufferIsPermanent(Buffer buffer);
314extern void BufferGetTag(Buffer buffer, RelFileLocator *rlocator,
315 ForkNumber *forknum, BlockNumber *blknum);
316
317extern void MarkBufferDirtyHint(Buffer buffer, bool buffer_std);
318
319extern bool BufferSetHintBits16(uint16 *ptr, uint16 val, Buffer buffer);
320extern bool BufferBeginSetHintBits(Buffer buffer);
321extern void BufferFinishSetHintBits(Buffer buffer, bool mark_dirty, bool buffer_std);
322
323extern void UnlockBuffers(void);
324extern void UnlockBuffer(Buffer buffer);
325extern void LockBufferInternal(Buffer buffer, BufferLockMode mode);
326
327/*
328 * Handling BUFFER_LOCK_UNLOCK in bufmgr.c leads to sufficiently worse branch
329 * prediction to impact performance. Therefore handle that switch here, where
330 * most of the time `mode` will be a constant and thus can be optimized out by
331 * the compiler.
332 */
333static inline void
335{
337 UnlockBuffer(buffer);
338 else
339 LockBufferInternal(buffer, mode);
340}
341
342extern bool ConditionalLockBuffer(Buffer buffer);
343extern void LockBufferForCleanup(Buffer buffer);
344extern bool ConditionalLockBufferForCleanup(Buffer buffer);
345extern bool IsBufferCleanupOK(Buffer buffer);
346extern bool HoldingBufferPinThatDelaysRecovery(void);
347
349
350extern uint32 GetPinLimit(void);
351extern uint32 GetLocalPinLimit(void);
352extern uint32 GetAdditionalPinLimit(void);
356
357extern bool EvictUnpinnedBuffer(Buffer buf, bool *buffer_flushed);
361extern void EvictRelUnpinnedBuffers(Relation rel,
373
374/* in localbuf.c */
375extern void AtProcExit_LocalBuffers(void);
376
377/* in freelist.c */
378
381 int ring_size_kb);
384
385extern void FreeAccessStrategy(BufferAccessStrategy strategy);
386
387
388/* inline functions */
389
390/*
391 * Although this header file is nominally backend-only, certain frontend
392 * programs like pg_waldump include it. For compilers that emit static
393 * inline functions even when they're unused, that leads to unsatisfied
394 * external references; hence hide these with #ifndef FRONTEND.
395 */
396
397#ifndef FRONTEND
398
399/*
400 * BufferIsValid
401 * True iff the given buffer number is valid (either as a shared
402 * or local buffer).
403 *
404 * Note: For a long time this was defined the same as BufferIsPinned,
405 * that is it would say False if you didn't hold a pin on the buffer.
406 * I believe this was bogus and served only to mask logic errors.
407 * Code should always know whether it has a buffer reference,
408 * independently of the pin state.
409 *
410 * Note: For a further long time this was not quite the inverse of the
411 * BufferIsInvalid() macro, in that it also did sanity checks to verify
412 * that the buffer number was in range. Most likely, this macro was
413 * originally intended only to be used in assertions, but its use has
414 * since expanded quite a bit, and the overhead of making those checks
415 * even in non-assert-enabled builds can be significant. Thus, we've
416 * now demoted the range checks to assertions within the macro itself.
417 */
418static inline bool
420{
423
424 return bufnum != InvalidBuffer;
425}
426
427/*
428 * BufferGetBlock
429 * Returns a reference to a disk page image associated with a buffer.
430 *
431 * Note:
432 * Assumes buffer is valid.
433 */
434static inline Block
436{
437 Assert(BufferIsValid(buffer));
438
439 if (BufferIsLocal(buffer))
440 return LocalBufferBlockPointers[-buffer - 1];
441 else
442 return (Block) (BufferBlocks + ((Size) (buffer - 1)) * BLCKSZ);
443}
444
445/*
446 * BufferGetPageSize
447 * Returns the page size within a buffer.
448 *
449 * Notes:
450 * Assumes buffer is valid.
451 *
452 * The buffer can be a raw disk block and need not contain a valid
453 * (formatted) disk page.
454 */
455/* XXX should dig out of buffer descriptor */
456static inline Size
458{
459 Assert(BufferIsValid(buffer));
460 return (Size) BLCKSZ;
461}
462
463/*
464 * BufferGetPage
465 * Returns the page associated with a buffer.
466 */
467static inline Page
469{
470 return (Page) BufferGetBlock(buffer);
471}
472
473#endif /* FRONTEND */
474
475#endif /* BUFMGR_H */
uint32 BlockNumber
Definition block.h:31
int Buffer
Definition buf.h:23
#define InvalidBuffer
Definition buf.h:25
#define BufferIsLocal(buffer)
Definition buf.h:37
BufferAccessStrategyType
Definition bufmgr.h:35
@ BAS_BULKREAD
Definition bufmgr.h:37
@ BAS_NORMAL
Definition bufmgr.h:36
@ BAS_VACUUM
Definition bufmgr.h:40
@ BAS_BULKWRITE
Definition bufmgr.h:39
void CheckBufferIsPinnedOnce(Buffer buffer)
Definition bufmgr.c:6637
void FlushRelationsAllBuffers(SMgrRelation *smgrs, int nrels)
Definition bufmgr.c:5250
void IncrBufferRefCount(Buffer buffer)
Definition bufmgr.c:5670
void DropDatabaseBuffers(Oid dbid)
Definition bufmgr.c:5115
bool BufferSetHintBits16(uint16 *ptr, uint16 val, Buffer buffer)
Definition bufmgr.c:7093
PGDLLIMPORT int effective_io_concurrency
Definition bufmgr.c:200
BlockNumber BufferGetBlockNumber(Buffer buffer)
Definition bufmgr.c:4446
PGDLLIMPORT const PgAioHandleCallbacks aio_shared_buffer_readv_cb
Definition bufmgr.c:8938
struct SMgrRelationData * SMgrRelation
Definition bufmgr.h:97
void BufferFinishSetHintBits(Buffer buffer, bool mark_dirty, bool buffer_std)
Definition bufmgr.c:7070
void DropRelationBuffers(SMgrRelation smgr_reln, ForkNumber *forkNum, int nforks, BlockNumber *firstDelBlock)
Definition bufmgr.c:4765
Buffer ReleaseAndReadBuffer(Buffer buffer, Relation relation, BlockNumber blockNum)
Definition bufmgr.c:3212
PrefetchBufferResult PrefetchBuffer(Relation reln, ForkNumber forkNum, BlockNumber blockNum)
Definition bufmgr.c:787
int GetAccessStrategyPinLimit(BufferAccessStrategy strategy)
Definition freelist.c:574
bool StartReadBuffers(ReadBuffersOperation *operation, Buffer *buffers, BlockNumber blockNum, int *nblocks, int flags)
Definition bufmgr.c:1609
void EvictAllUnpinnedBuffers(int32 *buffers_evicted, int32 *buffers_flushed, int32 *buffers_skipped)
Definition bufmgr.c:7982
PGDLLIMPORT int bgwriter_flush_after
Definition bufmgr.c:224
PGDLLIMPORT const PgAioHandleCallbacks aio_local_buffer_readv_cb
Definition bufmgr.c:8947
void EvictRelUnpinnedBuffers(Relation rel, int32 *buffers_evicted, int32 *buffers_flushed, int32 *buffers_skipped)
Definition bufmgr.c:8032
PGDLLIMPORT bool zero_damaged_pages
Definition bufmgr.c:189
PGDLLIMPORT Block * LocalBufferBlockPointers
Definition localbuf.c:48
bool IsBufferCleanupOK(Buffer buffer)
Definition bufmgr.c:6901
bool BufferIsLockedByMeInMode(Buffer buffer, BufferLockMode mode)
Definition bufmgr.c:3087
PGDLLIMPORT int bgwriter_lru_maxpages
Definition bufmgr.c:190
Buffer ExtendBufferedRel(BufferManagerRelation bmr, ForkNumber forkNum, BufferAccessStrategy strategy, uint32 flags)
Definition bufmgr.c:979
uint32 GetAdditionalLocalPinLimit(void)
Definition localbuf.c:316
static Page BufferGetPage(Buffer buffer)
Definition bufmgr.h:468
void AtEOXact_Buffers(bool isCommit)
Definition bufmgr.c:4199
BufferAccessStrategy GetAccessStrategy(BufferAccessStrategyType btype)
Definition freelist.c:426
BlockNumber ExtendBufferedRelBy(BufferManagerRelation bmr, ForkNumber fork, BufferAccessStrategy strategy, uint32 flags, uint32 extend_by, Buffer *buffers, uint32 *extended_by)
Definition bufmgr.c:1011
static Block BufferGetBlock(Buffer buffer)
Definition bufmgr.h:435
void CreateAndCopyRelationData(RelFileLocator src_rlocator, RelFileLocator dst_rlocator, bool permanent)
Definition bufmgr.c:5462
PGDLLIMPORT int maintenance_io_concurrency
Definition bufmgr.c:207
BufferLockMode
Definition bufmgr.h:206
@ BUFFER_LOCK_SHARE_EXCLUSIVE
Definition bufmgr.h:217
@ BUFFER_LOCK_SHARE
Definition bufmgr.h:212
@ BUFFER_LOCK_EXCLUSIVE
Definition bufmgr.h:222
@ BUFFER_LOCK_UNLOCK
Definition bufmgr.h:207
void DropRelationsAllBuffers(SMgrRelation *smgr_reln, int nlocators)
Definition bufmgr.c:4885
Buffer ExtendBufferedRelTo(BufferManagerRelation bmr, ForkNumber fork, BufferAccessStrategy strategy, uint32 flags, BlockNumber extend_to, ReadBufferMode mode)
Definition bufmgr.c:1040
void AtProcExit_LocalBuffers(void)
Definition localbuf.c:1030
PGDLLIMPORT bool track_io_timing
Definition bufmgr.c:192
void BufferGetTag(Buffer buffer, RelFileLocator *rlocator, ForkNumber *forknum, BlockNumber *blknum)
Definition bufmgr.c:4467
PGDLLIMPORT int NBuffers
Definition globals.c:144
void UnlockBuffer(Buffer buffer)
Definition bufmgr.c:6558
void LimitAdditionalLocalPins(uint32 *additional_pins)
Definition localbuf.c:324
uint32 GetLocalPinLimit(void)
Definition localbuf.c:308
BufferAccessStrategy GetAccessStrategyWithSize(BufferAccessStrategyType btype, int ring_size_kb)
Definition freelist.c:511
char * DebugPrintBufferRefcount(Buffer buffer)
Definition bufmgr.c:4389
void CheckPointBuffers(int flags)
Definition bufmgr.c:4432
bool BufferIsDirty(Buffer buffer)
Definition bufmgr.c:3114
bool BgBufferSync(WritebackContext *wb_context)
Definition bufmgr.c:3831
bool BufferIsPermanent(Buffer buffer)
Definition bufmgr.c:4677
void MarkDirtyAllUnpinnedBuffers(int32 *buffers_dirtied, int32 *buffers_already_dirty, int32 *buffers_skipped)
Definition bufmgr.c:8232
void UnlockBuffers(void)
Definition bufmgr.c:5852
void * Block
Definition bufmgr.h:26
PGDLLIMPORT int io_combine_limit_guc
Definition bufmgr.c:216
int GetAccessStrategyBufferCount(BufferAccessStrategy strategy)
Definition freelist.c:551
PrefetchBufferResult PrefetchSharedBuffer(SMgrRelation smgr_reln, ForkNumber forkNum, BlockNumber blockNum)
Definition bufmgr.c:697
static Size BufferGetPageSize(Buffer buffer)
Definition bufmgr.h:457
bool ConditionalLockBuffer(Buffer buffer)
Definition bufmgr.c:6617
BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum)
Definition bufmgr.c:4645
void ReleaseBuffer(Buffer buffer)
Definition bufmgr.c:5586
void FreeAccessStrategy(BufferAccessStrategy strategy)
Definition freelist.c:608
bool BufferIsLockedByMe(Buffer buffer)
Definition bufmgr.c:3061
PGDLLIMPORT int32 * LocalRefCount
Definition localbuf.c:49
XLogRecPtr BufferGetLSNAtomic(Buffer buffer)
Definition bufmgr.c:4713
void LockBufferInternal(Buffer buffer, BufferLockMode mode)
Definition bufmgr.c:6574
bool HoldingBufferPinThatDelaysRecovery(void)
Definition bufmgr.c:6817
bool MarkDirtyUnpinnedBuffer(Buffer buf, bool *buffer_already_dirty)
Definition bufmgr.c:8139
void UnlockReleaseBuffer(Buffer buffer)
Definition bufmgr.c:5603
static void LockBuffer(Buffer buffer, BufferLockMode mode)
Definition bufmgr.h:334
void MarkBufferDirty(Buffer buffer)
Definition bufmgr.c:3147
PGDLLIMPORT int io_combine_limit
Definition bufmgr.c:215
bool BufferBeginSetHintBits(Buffer buffer)
Definition bufmgr.c:7042
void LimitAdditionalPins(uint32 *additional_pins)
Definition bufmgr.c:2724
PGDLLIMPORT int NLocBuffer
Definition localbuf.c:45
bool WaitReadBuffers(ReadBuffersOperation *operation)
Definition bufmgr.c:1750
void LockBufferForCleanup(Buffer buffer)
Definition bufmgr.c:6670
void MarkBufferDirtyHint(Buffer buffer, bool buffer_std)
Definition bufmgr.c:5821
void FlushRelationBuffers(Relation rel)
Definition bufmgr.c:5162
ExtendBufferedFlags
Definition bufmgr.h:69
@ EB_LOCK_TARGET
Definition bufmgr.h:93
@ EB_CLEAR_SIZE_CACHE
Definition bufmgr.h:90
@ EB_PERFORMING_RECOVERY
Definition bufmgr.h:78
@ EB_CREATE_FORK_IF_NEEDED
Definition bufmgr.h:84
@ EB_SKIP_EXTENSION_LOCK
Definition bufmgr.h:75
@ EB_LOCK_FIRST
Definition bufmgr.h:87
bool EvictUnpinnedBuffer(Buffer buf, bool *buffer_flushed)
Definition bufmgr.c:7953
Buffer ReadBufferWithoutRelcache(RelFileLocator rlocator, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy, bool permanent)
Definition bufmgr.c:963
PGDLLIMPORT int backend_flush_after
Definition bufmgr.c:225
PGDLLIMPORT double bgwriter_lru_multiplier
Definition bufmgr.c:191
bool ReadRecentBuffer(RelFileLocator rlocator, ForkNumber forkNum, BlockNumber blockNum, Buffer recent_buffer)
Definition bufmgr.c:818
void FlushDatabaseBuffers(Oid dbid)
Definition bufmgr.c:5526
void MarkDirtyRelUnpinnedBuffers(Relation rel, int32 *buffers_dirtied, int32 *buffers_already_dirty, int32 *buffers_skipped)
Definition bufmgr.c:8175
PGDLLIMPORT int checkpoint_flush_after
Definition bufmgr.c:223
bool StartReadBuffer(ReadBuffersOperation *operation, Buffer *buffer, BlockNumber blocknum, int flags)
Definition bufmgr.c:1628
Buffer ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy)
Definition bufmgr.c:926
void InitBufferManagerAccess(void)
Definition bufmgr.c:4216
PGDLLIMPORT char * BufferBlocks
Definition buf_init.c:25
uint32 GetAdditionalPinLimit(void)
Definition bufmgr.c:2698
PGDLLIMPORT int io_max_combine_limit
Definition bufmgr.c:217
Buffer ReadBuffer(Relation reln, BlockNumber blockNum)
Definition bufmgr.c:879
ReadBufferMode
Definition bufmgr.h:45
@ RBM_ZERO_ON_ERROR
Definition bufmgr.h:51
@ RBM_ZERO_AND_CLEANUP_LOCK
Definition bufmgr.h:49
@ RBM_ZERO_AND_LOCK
Definition bufmgr.h:47
@ RBM_NORMAL
Definition bufmgr.h:46
@ RBM_NORMAL_NO_LOG
Definition bufmgr.h:52
bool ConditionalLockBufferForCleanup(Buffer buffer)
Definition bufmgr.c:6843
uint32 GetPinLimit(void)
Definition bufmgr.c:2686
void FlushOneBuffer(Buffer buffer)
Definition bufmgr.c:5566
static bool BufferIsValid(Buffer bufnum)
Definition bufmgr.h:419
PageData * Page
Definition bufpage.h:81
#define PGDLLIMPORT
Definition c.h:1421
#define Assert(condition)
Definition c.h:943
int16_t int16
Definition c.h:619
int32_t int32
Definition c.h:620
uint16_t uint16
Definition c.h:623
uint32_t uint32
Definition c.h:624
size_t Size
Definition c.h:689
static DataChecksumsWorkerOperation operation
long val
Definition informix.c:689
static PgChecksumMode mode
static char buf[DEFAULT_XLOG_SEG_SIZE]
unsigned int Oid
static int fb(int x)
ForkNumber
Definition relpath.h:56
SMgrRelation smgr
Definition bufmgr.h:110
Buffer recent_buffer
Definition bufmgr.h:61
ForkNumber forknum
Definition bufmgr.h:137
PgAioWaitRef io_wref
Definition bufmgr.h:152
SMgrRelation smgr
Definition bufmgr.h:135
BufferAccessStrategy strategy
Definition bufmgr.h:138
BlockNumber blocknum
Definition bufmgr.h:146
PgAioReturn io_return
Definition bufmgr.h:153
uint64 XLogRecPtr
Definition xlogdefs.h:21