* To react to the completion of the IO as soon as it is known to have
* completed, callbacks can be registered with pgaio_io_register_callbacks().
*
- * To actually execute IO using the returned handle, the pgaio_io_prep_*()
- * family of functions is used. In many cases the pgaio_io_prep_*() call will
+ * To actually execute IO using the returned handle, the pgaio_io_start_*()
+ * family of functions is used. In many cases the pgaio_io_start_*() call will
* not be done directly by code that acquired the handle, but by lower level
* code that gets passed the handle. E.g. if code in bufmgr.c wants to perform
* AIO, it typically will pass the handle to smgr.c, which will pass it on to
- * md.c, on to fd.c, which then finally calls pgaio_io_prep_*(). This
+ * md.c, on to fd.c, which then finally calls pgaio_io_start_*(). This
* forwarding allows the various layers to react to the IO's completion by
* registering callbacks. These callbacks in turn can translate a lower
* layer's result into a result understandable by a higher layer.
*
- * During pgaio_io_prep_*() the IO is staged (i.e. prepared for execution but
+ * During pgaio_io_start_*() the IO is staged (i.e. prepared for execution but
* not submitted to the kernel). Unless in batchmode
* (c.f. pgaio_enter_batchmode()), the IO will also get submitted for
* execution. Note that, whether in batchmode or not, the IO might even
* complete before the functions return.
*
- * After pgaio_io_prep_*() the AioHandle is "consumed" and may not be
+ * After pgaio_io_start_*() the AioHandle is "consumed" and may not be
* referenced by the IO issuing code. To e.g. wait for IO, references to the
- * IO can be established with pgaio_io_get_wref() *before* pgaio_io_prep_*()
+ * IO can be established with pgaio_io_get_wref() *before* pgaio_io_start_*()
* is called. pgaio_wref_wait() can be used to wait for the IO to complete.
*
*
/*
* Stage IO for execution and, if appropriate, submit it immediately.
*
- * Should only be called from pgaio_io_prep_*().
+ * Should only be called from pgaio_io_start_*().
*/
void
pgaio_io_stage(PgAioHandle *ioh, PgAioOp op)
needs_synchronous = pgaio_io_needs_synchronous_execution(ioh);
pgaio_debug_io(DEBUG3, ioh,
- "prepared (synchronous: %d, in_batch: %d)",
+ "staged (synchronous: %d, in_batch: %d)",
needs_synchronous, pgaio_my_backend->in_batchmode);
if (!needs_synchronous)
* registered for each IO.
*
* Callbacks need to be registered before [indirectly] calling
- * pgaio_io_prep_*(), as the IO may be executed immediately.
+ * pgaio_io_start_*(), as the IO may be executed immediately.
*
* A callback can be passed a small bit of data, e.g. to indicate whether to
* zero a buffer if it is invalid.
#include "utils/wait_event.h"
-static void pgaio_io_before_prep(PgAioHandle *ioh);
+static void pgaio_io_before_start(PgAioHandle *ioh);
/* --------------------------------------------------------------------------------
- * "Preparation" routines for individual IO operations
+ * "Start" routines for individual IO operations
*
* These are called by the code actually initiating an IO, to associate the IO
* specific data with an AIO handle.
*
- * Each of the preparation routines first needs to call
- * pgaio_io_before_prep(), then fill IO specific fields in the handle and then
- * finally call pgaio_io_stage().
+ * Each of the "start" routines first needs to call pgaio_io_before_start(),
+ * then fill IO specific fields in the handle and then finally call
+ * pgaio_io_stage().
* --------------------------------------------------------------------------------
*/
void
-pgaio_io_prep_readv(PgAioHandle *ioh,
- int fd, int iovcnt, uint64 offset)
+pgaio_io_start_readv(PgAioHandle *ioh,
+ int fd, int iovcnt, uint64 offset)
{
- pgaio_io_before_prep(ioh);
+ pgaio_io_before_start(ioh);
ioh->op_data.read.fd = fd;
ioh->op_data.read.offset = offset;
}
void
-pgaio_io_prep_writev(PgAioHandle *ioh,
- int fd, int iovcnt, uint64 offset)
+pgaio_io_start_writev(PgAioHandle *ioh,
+ int fd, int iovcnt, uint64 offset)
{
- pgaio_io_before_prep(ioh);
+ pgaio_io_before_start(ioh);
ioh->op_data.write.fd = fd;
ioh->op_data.write.offset = offset;
* any data in the handle is set. Mostly to centralize assertions.
*/
static void
-pgaio_io_before_prep(PgAioHandle *ioh)
+pgaio_io_before_start(PgAioHandle *ioh)
{
Assert(ioh->state == PGAIO_HS_HANDED_OUT);
Assert(pgaio_my_backend->handed_out_io == ioh);
/*
* Assign a target to the IO.
*
- * This has to be called exactly once before pgaio_io_prep_*() is called.
+ * This has to be called exactly once before pgaio_io_start_*() is called.
*/
void
pgaio_io_set_target(PgAioHandle *ioh, PgAioTargetID targetid)
/*
* Internal: Before executing an IO outside of the context of the process the
- * IO has been prepared in, the file descriptor has to be reopened - any FD
+ * IO has been staged in, the file descriptor has to be reopened - any FD
* referenced in the IO itself, won't be valid in the separate process.
*/
void
extern PgAioOp pgaio_io_get_op(PgAioHandle *ioh);
extern PgAioOpData *pgaio_io_get_op_data(PgAioHandle *ioh);
-extern void pgaio_io_prep_readv(PgAioHandle *ioh,
- int fd, int iovcnt, uint64 offset);
-extern void pgaio_io_prep_writev(PgAioHandle *ioh,
+extern void pgaio_io_start_readv(PgAioHandle *ioh,
int fd, int iovcnt, uint64 offset);
+extern void pgaio_io_start_writev(PgAioHandle *ioh,
+ int fd, int iovcnt, uint64 offset);
/* functions in aio_target.c */
extern void pgaio_io_set_target(PgAioHandle *ioh, PgAioTargetID targetid);
/*
* Returned by pgaio_io_acquire(). The next state is either DEFINED (if
- * pgaio_io_prep_*() is called), or IDLE (if pgaio_io_release() is
+ * pgaio_io_start_*() is called), or IDLE (if pgaio_io_release() is
* called).
*/
PGAIO_HS_HANDED_OUT,
/*
- * pgaio_io_prep_*() has been called, but IO is not yet staged. At this
+ * pgaio_io_start_*() has been called, but IO is not yet staged. At this
* point the handle has all the information for the IO to be executed.
*/
PGAIO_HS_DEFINED,