| 1 |
/*------------------------------------------------------------------------- |
| 2 |
* |
| 3 |
* method_sync.c |
| 4 |
* AIO - perform "AIO" by executing it synchronously |
| 5 |
* |
| 6 |
* This method is mainly to check if AIO use causes regressions. Other IO |
| 7 |
* methods might also fall back to the synchronous method for functionality |
| 8 |
* they cannot provide. |
| 9 |
* |
| 10 |
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group |
| 11 |
* Portions Copyright (c) 1994, Regents of the University of California |
| 12 |
* |
| 13 |
* IDENTIFICATION |
| 14 |
* src/backend/storage/aio/method_sync.c |
| 15 |
* |
| 16 |
*------------------------------------------------------------------------- |
| 17 |
*/ |
| 18 |
|
| 19 |
#include "postgres.h" |
| 20 |
|
| 21 |
#include "storage/aio.h" |
| 22 |
#include "storage/aio_internal.h" |
| 23 |
|
| 24 |
static bool pgaio_sync_needs_synchronous_execution(PgAioHandle *ioh); |
| 25 |
static int pgaio_sync_submit(uint16 num_staged_ios, PgAioHandle **staged_ios); |
| 26 |
|
| 27 |
|
| 28 |
const IoMethodOps pgaio_sync_ops = { |
| 29 |
.needs_synchronous_execution = pgaio_sync_needs_synchronous_execution, |
| 30 |
.submit = pgaio_sync_submit, |
| 31 |
}; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
static bool |
| 36 |
pgaio_sync_needs_synchronous_execution(PgAioHandle *ioh) |
| 37 |
{ |
| 38 |
return true; |
| 39 |
} |
| 40 |
|
| 41 |
static int |
| 42 |
pgaio_sync_submit(uint16 num_staged_ios, PgAioHandle **staged_ios) |
| 43 |
{ |
| 44 |
elog(ERROR, "IO should have been executed synchronously"); |
| 45 |
|
| 46 |
return 0; |
| 47 |
} |