|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/slru.h"#include "access/transam.h"#include "miscadmin.h"#include "storage/fd.h"#include "storage/ipc.h"#include "storage/shmem.h"#include "utils/builtins.h"
Go to the source code of this file.
Macros | |
| #define | NUM_TEST_BUFFERS 16 |
| #define | TestSlruCtl (&TestSlruDesc) |
Variables | |
| PG_MODULE_MAGIC | |
| static const char * | TestSlruDir = "pg_test_slru" |
| static SlruDesc | TestSlruDesc |
| static const ShmemCallbacks | test_slru_shmem_callbacks |
| #define NUM_TEST_BUFFERS 16 |
Definition at line 41 of file test_slru.c.
| #define TestSlruCtl (&TestSlruDesc) |
Definition at line 55 of file test_slru.c.
Definition at line 216 of file test_slru.c.
References ereport, errdetail(), errmsg, ERROR, fb(), MakePGDirectory(), process_shared_preload_libraries_in_progress, RegisterShmemCallbacks(), test_slru_shmem_callbacks, and TestSlruDir.
| PG_FUNCTION_INFO_V1 | ( | test_slru_delete_all | ) |
| PG_FUNCTION_INFO_V1 | ( | test_slru_page_delete | ) |
| PG_FUNCTION_INFO_V1 | ( | test_slru_page_exists | ) |
| PG_FUNCTION_INFO_V1 | ( | test_slru_page_read | ) |
| PG_FUNCTION_INFO_V1 | ( | test_slru_page_readonly | ) |
| PG_FUNCTION_INFO_V1 | ( | test_slru_page_sync | ) |
| PG_FUNCTION_INFO_V1 | ( | test_slru_page_truncate | ) |
| PG_FUNCTION_INFO_V1 | ( | test_slru_page_write | ) |
| PG_FUNCTION_INFO_V1 | ( | test_slru_page_writeall | ) |
| Datum test_slru_delete_all | ( | PG_FUNCTION_ARGS | ) |
Definition at line 193 of file test_slru.c.
References fb(), PG_RETURN_VOID, SlruScanDirectory(), test_slru_scan_cb(), and TestSlruCtl.
Definition at line 208 of file test_slru.c.
References errdetail(), and fb().
Referenced by test_slru_shmem_request().
| Datum test_slru_page_delete | ( | PG_FUNCTION_ARGS | ) |
Definition at line 169 of file test_slru.c.
References elog, fb(), NOTICE, PG_GETARG_INT64, PG_RETURN_VOID, FileTag::segno, SLRU_PAGES_PER_SEGMENT, SlruDeleteSegment(), and TestSlruCtl.
| Datum test_slru_page_exists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 138 of file test_slru.c.
References LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), PG_GETARG_INT64, PG_RETURN_BOOL, SimpleLruDoesPhysicalPageExist(), SimpleLruGetBankLock(), and TestSlruCtl.
Definition at line 202 of file test_slru.c.
References fb().
Referenced by test_slru_shmem_request().
| Datum test_slru_page_read | ( | PG_FUNCTION_ARGS | ) |
Definition at line 100 of file test_slru.c.
References cstring_to_text(), data, fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), PG_GETARG_BOOL, PG_GETARG_INT64, PG_GETARG_TRANSACTIONID, PG_RETURN_TEXT_P, SimpleLruGetBankLock(), SimpleLruReadPage(), and TestSlruCtl.
| Datum test_slru_page_readonly | ( | PG_FUNCTION_ARGS | ) |
Definition at line 119 of file test_slru.c.
References Assert, cstring_to_text(), data, fb(), LWLockHeldByMe(), LWLockRelease(), PG_GETARG_INT64, PG_RETURN_TEXT_P, SimpleLruGetBankLock(), SimpleLruReadPage_ReadOnly(), and TestSlruCtl.
| Datum test_slru_page_sync | ( | PG_FUNCTION_ARGS | ) |
Definition at line 152 of file test_slru.c.
References elog, fb(), MAXPGPATH, NOTICE, PG_GETARG_INT64, PG_RETURN_VOID, FileTag::segno, SLRU_PAGES_PER_SEGMENT, SlruSyncFileTag(), and TestSlruCtl.
| Datum test_slru_page_truncate | ( | PG_FUNCTION_ARGS | ) |
Definition at line 184 of file test_slru.c.
References PG_GETARG_INT64, PG_RETURN_VOID, SimpleLruTruncate(), and TestSlruCtl.
| Datum test_slru_page_write | ( | PG_FUNCTION_ARGS | ) |
Definition at line 65 of file test_slru.c.
References Assert, data, fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), PG_GETARG_INT64, PG_GETARG_TEXT_PP, PG_RETURN_VOID, SimpleLruGetBankLock(), SimpleLruWritePage(), SimpleLruZeroPage(), SLRU_PAGE_VALID, TestSlruCtl, and text_to_cstring().
| Datum test_slru_page_writeall | ( | PG_FUNCTION_ARGS | ) |
Definition at line 93 of file test_slru.c.
References PG_RETURN_VOID, SimpleLruWriteAll(), and TestSlruCtl.
|
static |
Definition at line 58 of file test_slru.c.
References ctl, data, elog, fb(), filename, NOTICE, and SlruScanDirCbDeleteAll().
Referenced by test_slru_delete_all().
Definition at line 234 of file test_slru.c.
References name, NUM_TEST_BUFFERS, SimpleLruRequest, SYNC_HANDLER_NONE, test_slru_errdetail_for_io_error(), test_slru_page_precedes_logically(), TestSlruDesc, and TestSlruDir.
| PG_MODULE_MAGIC |
Definition at line 25 of file test_slru.c.
|
static |
Definition at line 51 of file test_slru.c.
Referenced by _PG_init().
|
static |
Definition at line 49 of file test_slru.c.
Referenced by test_slru_shmem_request().
Definition at line 47 of file test_slru.c.
Referenced by _PG_init(), and test_slru_shmem_request().