PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
method_sync.c
Go to the documentation of this file.
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"
23
25static int pgaio_sync_submit(uint16 num_staged_ios, PgAioHandle **staged_ios);
26
27
30 .submit = pgaio_sync_submit,
31};
32
33
34
35static bool
37{
38 return true;
39}
40
41static int
42pgaio_sync_submit(uint16 num_staged_ios, PgAioHandle **staged_ios)
43{
44 elog(ERROR, "IO should have been executed synchronously");
45
46 return 0;
47}
uint16_t uint16
Definition: c.h:501
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:225
const IoMethodOps pgaio_sync_ops
Definition: method_sync.c:28
static int pgaio_sync_submit(uint16 num_staged_ios, PgAioHandle **staged_ios)
Definition: method_sync.c:42
static bool pgaio_sync_needs_synchronous_execution(PgAioHandle *ioh)
Definition: method_sync.c:36
bool(* needs_synchronous_execution)(PgAioHandle *ioh)
Definition: aio_internal.h:283