mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
aio: Add test_aio module
To make the tests possible, a few functions from bufmgr.c/localbuf.c had to be exported, via buf_internals.h. Reviewed-by: Noah Misch <noah@leadboat.com> Co-authored-by: Andres Freund <andres@anarazel.de> Co-authored-by: Nazir Bilal Yavuz <byavuz81@gmail.com> Discussion: https://postgr.es/m/uvrtrknj4kdytuboidbhwclo4gxhswwcpgadptsjvjqcluzmah%40brqs62irg4dt
This commit is contained in:
@@ -518,10 +518,6 @@ static uint32 WaitBufHdrUnlocked(BufferDesc *buf);
|
||||
static int SyncOneBuffer(int buf_id, bool skip_recently_used,
|
||||
WritebackContext *wb_context);
|
||||
static void WaitIO(BufferDesc *buf);
|
||||
static bool StartBufferIO(BufferDesc *buf, bool forInput, bool nowait);
|
||||
static void TerminateBufferIO(BufferDesc *buf, bool clear_dirty,
|
||||
uint32 set_flag_bits, bool forget_owner,
|
||||
bool release_aio);
|
||||
static void AbortBufferIO(Buffer buffer);
|
||||
static void shared_buffer_write_error_callback(void *arg);
|
||||
static void local_buffer_write_error_callback(void *arg);
|
||||
@@ -5962,7 +5958,7 @@ WaitIO(BufferDesc *buf)
|
||||
* find out if they can perform the I/O as part of a larger operation, without
|
||||
* waiting for the answer or distinguishing the reasons why not.
|
||||
*/
|
||||
static bool
|
||||
bool
|
||||
StartBufferIO(BufferDesc *buf, bool forInput, bool nowait)
|
||||
{
|
||||
uint32 buf_state;
|
||||
@@ -6019,7 +6015,7 @@ StartBufferIO(BufferDesc *buf, bool forInput, bool nowait)
|
||||
* resource owner. (forget_owner=false is used when the resource owner itself
|
||||
* is being released)
|
||||
*/
|
||||
static void
|
||||
void
|
||||
TerminateBufferIO(BufferDesc *buf, bool clear_dirty, uint32 set_flag_bits,
|
||||
bool forget_owner, bool release_aio)
|
||||
{
|
||||
|
||||
@@ -57,7 +57,6 @@ static int NLocalPinnedBuffers = 0;
|
||||
static void InitLocalBuffers(void);
|
||||
static Block GetLocalBufferStorage(void);
|
||||
static Buffer GetLocalVictimBuffer(void);
|
||||
static void InvalidateLocalBuffer(BufferDesc *bufHdr, bool check_unreferenced);
|
||||
|
||||
|
||||
/*
|
||||
@@ -597,7 +596,7 @@ TerminateLocalBufferIO(BufferDesc *bufHdr, bool clear_dirty, uint32 set_flag_bit
|
||||
*
|
||||
* See also InvalidateBuffer().
|
||||
*/
|
||||
static void
|
||||
void
|
||||
InvalidateLocalBuffer(BufferDesc *bufHdr, bool check_unreferenced)
|
||||
{
|
||||
Buffer buffer = BufferDescriptorGetBuffer(bufHdr);
|
||||
|
||||
Reference in New Issue
Block a user