Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9469d7f

Browse files
committed
aio: Rename pgaio_io_prep_* to pgaio_io_start_*
The old naming pattern (mirroring liburing's naming) was inconsistent withthe (not yet introduced) callers. It seems better to get rid of theinconsistency now than to grow more users of the odd naming.Reported-by: Noah Misch <noah@leadboat.com>Discussion:https://postgr.es/m/20250326001915.bc.nmisch@google.com
1 parentf321ec2 commit9469d7f

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

‎src/backend/storage/aio/aio.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,25 +127,25 @@ static PgAioHandle *pgaio_inj_cur_handle;
127127
* To react to the completion of the IO as soon as it is known to have
128128
* completed, callbacks can be registered with pgaio_io_register_callbacks().
129129
*
130-
* To actually execute IO using the returned handle, thepgaio_io_prep_*()
131-
* family of functions is used. In many cases thepgaio_io_prep_*() call will
130+
* To actually execute IO using the returned handle, thepgaio_io_start_*()
131+
* family of functions is used. In many cases thepgaio_io_start_*() call will
132132
* not be done directly by code that acquired the handle, but by lower level
133133
* code that gets passed the handle. E.g. if code in bufmgr.c wants to perform
134134
* AIO, it typically will pass the handle to smgr.c, which will pass it on to
135-
* md.c, on to fd.c, which then finally callspgaio_io_prep_*(). This
135+
* md.c, on to fd.c, which then finally callspgaio_io_start_*(). This
136136
* forwarding allows the various layers to react to the IO's completion by
137137
* registering callbacks. These callbacks in turn can translate a lower
138138
* layer's result into a result understandable by a higher layer.
139139
*
140-
* Duringpgaio_io_prep_*() the IO is staged (i.e. prepared for execution but
140+
* Duringpgaio_io_start_*() the IO is staged (i.e. prepared for execution but
141141
* not submitted to the kernel). Unless in batchmode
142142
* (c.f. pgaio_enter_batchmode()), the IO will also get submitted for
143143
* execution. Note that, whether in batchmode or not, the IO might even
144144
* complete before the functions return.
145145
*
146-
* Afterpgaio_io_prep_*() the AioHandle is "consumed" and may not be
146+
* Afterpgaio_io_start_*() the AioHandle is "consumed" and may not be
147147
* referenced by the IO issuing code. To e.g. wait for IO, references to the
148-
* IO can be established with pgaio_io_get_wref() *before*pgaio_io_prep_*()
148+
* IO can be established with pgaio_io_get_wref() *before*pgaio_io_start_*()
149149
* is called. pgaio_wref_wait() can be used to wait for the IO to complete.
150150
*
151151
*
@@ -391,7 +391,7 @@ pgaio_io_resowner_register(PgAioHandle *ioh)
391391
/*
392392
* Stage IO for execution and, if appropriate, submit it immediately.
393393
*
394-
* Should only be called frompgaio_io_prep_*().
394+
* Should only be called frompgaio_io_start_*().
395395
*/
396396
void
397397
pgaio_io_stage(PgAioHandle*ioh,PgAioOpop)
@@ -421,7 +421,7 @@ pgaio_io_stage(PgAioHandle *ioh, PgAioOp op)
421421
needs_synchronous=pgaio_io_needs_synchronous_execution(ioh);
422422

423423
pgaio_debug_io(DEBUG3,ioh,
424-
"prepared (synchronous: %d, in_batch: %d)",
424+
"staged (synchronous: %d, in_batch: %d)",
425425
needs_synchronous,pgaio_my_backend->in_batchmode);
426426

427427
if (!needs_synchronous)

‎src/backend/storage/aio/aio_callback.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static const PgAioHandleCallbacksEntry aio_handle_cbs[] = {
5454
* registered for each IO.
5555
*
5656
* Callbacks need to be registered before [indirectly] calling
57-
*pgaio_io_prep_*(), as the IO may be executed immediately.
57+
*pgaio_io_start_*(), as the IO may be executed immediately.
5858
*
5959
* A callback can be passed a small bit of data, e.g. to indicate whether to
6060
* zero a buffer if it is invalid.

‎src/backend/storage/aio/aio_io.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include"utils/wait_event.h"
2626

2727

28-
staticvoidpgaio_io_before_prep(PgAioHandle*ioh);
28+
staticvoidpgaio_io_before_start(PgAioHandle*ioh);
2929

3030

3131

@@ -63,22 +63,22 @@ pgaio_io_get_op_data(PgAioHandle *ioh)
6363

6464

6565
/* --------------------------------------------------------------------------------
66-
* "Preparation" routines for individual IO operations
66+
* "Start" routines for individual IO operations
6767
*
6868
* These are called by the code actually initiating an IO, to associate the IO
6969
* specific data with an AIO handle.
7070
*
71-
* Each of thepreparation routines first needs to call
72-
*pgaio_io_before_prep(),then fill IO specific fields in the handle and then
73-
*finally callpgaio_io_stage().
71+
* Each of the"start" routines first needs to call pgaio_io_before_start(),
72+
* then fill IO specific fields in the handle and then finally call
73+
* pgaio_io_stage().
7474
* --------------------------------------------------------------------------------
7575
*/
7676

7777
void
78-
pgaio_io_prep_readv(PgAioHandle*ioh,
79-
intfd,intiovcnt,uint64offset)
78+
pgaio_io_start_readv(PgAioHandle*ioh,
79+
intfd,intiovcnt,uint64offset)
8080
{
81-
pgaio_io_before_prep(ioh);
81+
pgaio_io_before_start(ioh);
8282

8383
ioh->op_data.read.fd=fd;
8484
ioh->op_data.read.offset=offset;
@@ -88,10 +88,10 @@ pgaio_io_prep_readv(PgAioHandle *ioh,
8888
}
8989

9090
void
91-
pgaio_io_prep_writev(PgAioHandle*ioh,
92-
intfd,intiovcnt,uint64offset)
91+
pgaio_io_start_writev(PgAioHandle*ioh,
92+
intfd,intiovcnt,uint64offset)
9393
{
94-
pgaio_io_before_prep(ioh);
94+
pgaio_io_before_start(ioh);
9595

9696
ioh->op_data.write.fd=fd;
9797
ioh->op_data.write.offset=offset;
@@ -153,7 +153,7 @@ pgaio_io_perform_synchronously(PgAioHandle *ioh)
153153
* any data in the handle is set. Mostly to centralize assertions.
154154
*/
155155
staticvoid
156-
pgaio_io_before_prep(PgAioHandle*ioh)
156+
pgaio_io_before_start(PgAioHandle*ioh)
157157
{
158158
Assert(ioh->state==PGAIO_HS_HANDED_OUT);
159159
Assert(pgaio_my_backend->handed_out_io==ioh);

‎src/backend/storage/aio/aio_target.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pgaio_io_get_target_name(PgAioHandle *ioh)
5555
/*
5656
* Assign a target to the IO.
5757
*
58-
* This has to be called exactly once beforepgaio_io_prep_*() is called.
58+
* This has to be called exactly once beforepgaio_io_start_*() is called.
5959
*/
6060
void
6161
pgaio_io_set_target(PgAioHandle*ioh,PgAioTargetIDtargetid)
@@ -101,7 +101,7 @@ pgaio_io_can_reopen(PgAioHandle *ioh)
101101

102102
/*
103103
* Internal: Before executing an IO outside of the context of the process the
104-
* IO has beenprepared in, the file descriptor has to be reopened - any FD
104+
* IO has beenstaged in, the file descriptor has to be reopened - any FD
105105
* referenced in the IO itself, won't be valid in the separate process.
106106
*/
107107
void

‎src/include/storage/aio.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ extern intpgaio_io_get_iovec(PgAioHandle *ioh, struct iovec **iov);
277277
externPgAioOppgaio_io_get_op(PgAioHandle*ioh);
278278
externPgAioOpData*pgaio_io_get_op_data(PgAioHandle*ioh);
279279

280-
externvoidpgaio_io_prep_readv(PgAioHandle*ioh,
281-
intfd,intiovcnt,uint64offset);
282-
externvoidpgaio_io_prep_writev(PgAioHandle*ioh,
280+
externvoidpgaio_io_start_readv(PgAioHandle*ioh,
283281
intfd,intiovcnt,uint64offset);
282+
externvoidpgaio_io_start_writev(PgAioHandle*ioh,
283+
intfd,intiovcnt,uint64offset);
284284

285285
/* functions in aio_target.c */
286286
externvoidpgaio_io_set_target(PgAioHandle*ioh,PgAioTargetIDtargetid);

‎src/include/storage/aio_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ typedef enum PgAioHandleState
4242

4343
/*
4444
* Returned by pgaio_io_acquire(). The next state is either DEFINED (if
45-
*pgaio_io_prep_*() is called), or IDLE (if pgaio_io_release() is
45+
*pgaio_io_start_*() is called), or IDLE (if pgaio_io_release() is
4646
* called).
4747
*/
4848
PGAIO_HS_HANDED_OUT,
4949

5050
/*
51-
*pgaio_io_prep_*() has been called, but IO is not yet staged. At this
51+
*pgaio_io_start_*() has been called, but IO is not yet staged. At this
5252
* point the handle has all the information for the IO to be executed.
5353
*/
5454
PGAIO_HS_DEFINED,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp