PostgreSQL Source Code
git master
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
g
h
i
k
l
m
p
r
s
t
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
c
d
f
h
i
n
o
p
r
s
t
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
▼
PostgreSQL Source Code
PostgreSQL Database Management System
►
Namespaces
►
Data Structures
▼
Files
►
File List
►
Globals
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
aio_types.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* aio_types.h
4
* AIO related types that are useful to include separately, to reduce the
5
* "include burden".
6
*
7
*
8
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
9
* Portions Copyright (c) 1994, Regents of the University of California
10
*
11
* src/include/storage/aio_types.h
12
*
13
*-------------------------------------------------------------------------
14
*/
15
#ifndef AIO_TYPES_H
16
#define AIO_TYPES_H
17
18
#include "
storage/block.h
"
19
#include "
storage/relfilelocator.h
"
20
21
22
typedef
struct
PgAioHandle
PgAioHandle
;
23
typedef
struct
PgAioHandleCallbacks
PgAioHandleCallbacks
;
24
typedef
struct
PgAioTargetInfo
PgAioTargetInfo
;
25
26
/*
27
* A reference to an IO that can be used to wait for the IO (using
28
* pgaio_wref_wait()) to complete.
29
*
30
* These can be passed across process boundaries.
31
*/
32
typedef
struct
PgAioWaitRef
33
{
34
/* internal ID identifying the specific PgAioHandle */
35
uint32
aio_index
;
36
37
/*
38
* IO handles are reused. To detect if a handle was reused, and thereby
39
* avoid unnecessarily waiting for a newer IO, each time the handle is
40
* reused a generation number is increased.
41
*
42
* To avoid requiring alignment sufficient for an int64, split the
43
* generation into two.
44
*/
45
uint32
generation_upper
;
46
uint32
generation_lower
;
47
}
PgAioWaitRef
;
48
49
50
/*
51
* Information identifying what the IO is being performed on.
52
*
53
* This needs sufficient information to
54
*
55
* a) Reopen the file for the IO if the IO is executed in a context that
56
* cannot use the FD provided initially (e.g. because the IO is executed in
57
* a worker process).
58
*
59
* b) Describe the object the IO is performed on in log / error messages.
60
*/
61
typedef
union
PgAioTargetData
62
{
63
/* just as an example placeholder for later */
64
struct
65
{
66
uint32
queue_id
;
67
}
wal
;
68
}
PgAioTargetData
;
69
70
71
/*
72
* The status of an AIO operation.
73
*/
74
typedef
enum
PgAioResultStatus
75
{
76
PGAIO_RS_UNKNOWN
,
/* not yet completed / uninitialized */
77
PGAIO_RS_OK
,
78
PGAIO_RS_PARTIAL
,
/* did not fully succeed, but no error */
79
PGAIO_RS_ERROR
,
80
}
PgAioResultStatus
;
81
82
83
/*
84
* Result of IO operation, visible only to the initiator of IO.
85
*/
86
typedef
struct
PgAioResult
87
{
88
/*
89
* This is of type PgAioHandleCallbackID, but can't use a bitfield of an
90
* enum, because some compilers treat enums as signed.
91
*/
92
uint32
id
:8;
93
94
/* of type PgAioResultStatus, see above */
95
uint32
status
:2;
96
97
/* meaning defined by callback->error */
98
uint32
error_data
:22;
99
100
int32
result
;
101
}
PgAioResult
;
102
103
104
/*
105
* Combination of PgAioResult with minimal metadata about the IO.
106
*
107
* Contains sufficient information to be able, in case the IO [partially]
108
* fails, to log/raise an error under control of the IO issuing code.
109
*/
110
typedef
struct
PgAioReturn
111
{
112
PgAioResult
result
;
113
PgAioTargetData
target_data
;
114
}
PgAioReturn
;
115
116
117
#endif
/* AIO_TYPES_H */
PgAioTargetData
union PgAioTargetData PgAioTargetData
PgAioResult
struct PgAioResult PgAioResult
PgAioResultStatus
PgAioResultStatus
Definition:
aio_types.h:75
PGAIO_RS_OK
@ PGAIO_RS_OK
Definition:
aio_types.h:77
PGAIO_RS_UNKNOWN
@ PGAIO_RS_UNKNOWN
Definition:
aio_types.h:76
PGAIO_RS_PARTIAL
@ PGAIO_RS_PARTIAL
Definition:
aio_types.h:78
PGAIO_RS_ERROR
@ PGAIO_RS_ERROR
Definition:
aio_types.h:79
PgAioWaitRef
struct PgAioWaitRef PgAioWaitRef
PgAioReturn
struct PgAioReturn PgAioReturn
block.h
int32
int32_t int32
Definition:
c.h:498
uint32
uint32_t uint32
Definition:
c.h:502
relfilelocator.h
PgAioHandleCallbacks
Definition:
aio.h:203
PgAioHandle
Definition:
aio_internal.h:92
PgAioResult
Definition:
aio_types.h:87
PgAioResult::status
uint32 status
Definition:
aio_types.h:95
PgAioResult::error_data
uint32 error_data
Definition:
aio_types.h:98
PgAioResult::result
int32 result
Definition:
aio_types.h:100
PgAioResult::id
uint32 id
Definition:
aio_types.h:92
PgAioReturn
Definition:
aio_types.h:111
PgAioReturn::result
PgAioResult result
Definition:
aio_types.h:112
PgAioReturn::target_data
PgAioTargetData target_data
Definition:
aio_types.h:113
PgAioTargetInfo
Definition:
aio.h:158
PgAioWaitRef
Definition:
aio_types.h:33
PgAioWaitRef::generation_upper
uint32 generation_upper
Definition:
aio_types.h:45
PgAioWaitRef::aio_index
uint32 aio_index
Definition:
aio_types.h:35
PgAioWaitRef::generation_lower
uint32 generation_lower
Definition:
aio_types.h:46
PgAioTargetData
Definition:
aio_types.h:62
PgAioTargetData::queue_id
uint32 queue_id
Definition:
aio_types.h:66
PgAioTargetData::wal
struct PgAioTargetData::@124 wal
src
include
storage
aio_types.h
Generated on Thu Mar 27 2025 06:13:26 for PostgreSQL Source Code by
1.9.4