41#define NUM_TEST_BUFFERS 16
55#define TestSlruCtl (&TestSlruDesc)
212 return errdetail(
"Could not access test_slru entry %u.", xid);
220 (
errmsg(
"cannot load \"%s\" after startup",
"test_slru"),
221 errdetail(
"\"%s\" must be loaded with \"shared_preload_libraries\".",
244 .long_segment_names =
true,
254 .buffer_tranche_id = 0,
255 .bank_tranche_id = 0,
#define Assert(condition)
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
int MakePGDirectory(const char *directoryName)
#define PG_GETARG_TEXT_PP(n)
#define PG_GETARG_INT64(n)
#define PG_FUNCTION_INFO_V1(funcname)
#define PG_GETARG_TRANSACTIONID(n)
#define PG_RETURN_TEXT_P(x)
#define PG_GETARG_BOOL(n)
#define PG_RETURN_BOOL(x)
bool LWLockHeldByMe(LWLock *lock)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
bool process_shared_preload_libraries_in_progress
#define SLRU_PAGES_PER_SEGMENT
void RegisterShmemCallbacks(const ShmemCallbacks *callbacks)
bool SlruScanDirectory(SlruDesc *ctl, SlruScanCallback callback, void *data)
int SimpleLruReadPage_ReadOnly(SlruDesc *ctl, int64 pageno, const void *opaque_data)
void SimpleLruTruncate(SlruDesc *ctl, int64 cutoffPage)
void SlruDeleteSegment(SlruDesc *ctl, int64 segno)
int SimpleLruZeroPage(SlruDesc *ctl, int64 pageno)
bool SimpleLruDoesPhysicalPageExist(SlruDesc *ctl, int64 pageno)
bool SlruScanDirCbDeleteAll(SlruDesc *ctl, char *filename, int64 segpage, void *data)
void SimpleLruWritePage(SlruDesc *ctl, int slotno)
void SimpleLruWriteAll(SlruDesc *ctl, bool allow_redirtied)
int SimpleLruReadPage(SlruDesc *ctl, int64 pageno, bool write_ok, const void *opaque_data)
int SlruSyncFileTag(SlruDesc *ctl, const FileTag *ftag, char *path)
#define SimpleLruRequest(...)
static LWLock * SimpleLruGetBankLock(SlruDesc *ctl, int64 pageno)
ShmemRequestCallback request_fn
static const char * TestSlruDir
Datum test_slru_page_delete(PG_FUNCTION_ARGS)
static bool test_slru_page_precedes_logically(int64 page1, int64 page2)
Datum test_slru_page_write(PG_FUNCTION_ARGS)
Datum test_slru_page_exists(PG_FUNCTION_ARGS)
Datum test_slru_page_writeall(PG_FUNCTION_ARGS)
static SlruDesc TestSlruDesc
Datum test_slru_page_readonly(PG_FUNCTION_ARGS)
static void test_slru_shmem_request(void *arg)
Datum test_slru_page_truncate(PG_FUNCTION_ARGS)
static bool test_slru_scan_cb(SlruDesc *ctl, char *filename, int64 segpage, void *data)
Datum test_slru_page_read(PG_FUNCTION_ARGS)
Datum test_slru_delete_all(PG_FUNCTION_ARGS)
static const ShmemCallbacks test_slru_shmem_callbacks
Datum test_slru_page_sync(PG_FUNCTION_ARGS)
static int test_slru_errdetail_for_io_error(const void *opaque_data)
text * cstring_to_text(const char *s)
char * text_to_cstring(const text *t)