PostgreSQL Source Code git master
|
#include "postgres.h"
#include "miscadmin.h"
#include "storage/aio.h"
#include "storage/aio_internal.h"
#include "storage/bufmgr.h"
#include "storage/md.h"
Go to the source code of this file.
Data Structures | |
struct | PgAioHandleCallbacksEntry |
Macros | |
#define | CALLBACK_ENTRY(id, callback) [id] = {.cb = &callback, .name = #callback} |
Typedefs | |
typedef struct PgAioHandleCallbacksEntry | PgAioHandleCallbacksEntry |
Functions | |
void | pgaio_io_register_callbacks (PgAioHandle *ioh, PgAioHandleCallbackID cb_id, uint8 cb_data) |
void | pgaio_io_set_handle_data_64 (PgAioHandle *ioh, uint64 *data, uint8 len) |
void | pgaio_io_set_handle_data_32 (PgAioHandle *ioh, uint32 *data, uint8 len) |
uint64 * | pgaio_io_get_handle_data (PgAioHandle *ioh, uint8 *len) |
void | pgaio_result_report (PgAioResult result, const PgAioTargetData *target_data, int elevel) |
void | pgaio_io_call_stage (PgAioHandle *ioh) |
void | pgaio_io_call_complete_shared (PgAioHandle *ioh) |
PgAioResult | pgaio_io_call_complete_local (PgAioHandle *ioh) |
Variables | |
static const PgAioHandleCallbacks | aio_invalid_cb = {0} |
static const PgAioHandleCallbacksEntry | aio_handle_cbs [] |
typedef struct PgAioHandleCallbacksEntry PgAioHandleCallbacksEntry |
PgAioResult pgaio_io_call_complete_local | ( | PgAioHandle * | ioh | ) |
Definition at line 280 of file aio_callback.c.
References aio_handle_cbs, Assert(), PgAioHandle::callbacks, PgAioHandle::callbacks_data, PgAioHandleCallbacksEntry::cb, PgAioHandleCallbacks::complete_local, DEBUG3, DEBUG4, PgAioHandle::distilled_result, END_CRIT_SECTION, PgAioResult::error_data, i, PgAioResult::id, PgAioHandleCallbacksEntry::name, PgAioHandle::num_callbacks, PgAioHandle::op, pgaio_debug_io, PGAIO_OP_COUNT, PGAIO_OP_INVALID, pgaio_result_status_string(), PGAIO_TID_COUNT, PGAIO_TID_INVALID, PgAioHandle::result, PgAioResult::result, START_CRIT_SECTION, PgAioResult::status, and PgAioHandle::target.
Referenced by pgaio_io_reclaim().
void pgaio_io_call_complete_shared | ( | PgAioHandle * | ioh | ) |
Definition at line 223 of file aio_callback.c.
References aio_handle_cbs, Assert(), PgAioHandle::callbacks, PgAioHandle::callbacks_data, PgAioHandleCallbacksEntry::cb, PgAioHandleCallbacks::complete_shared, DEBUG3, DEBUG4, PgAioHandle::distilled_result, END_CRIT_SECTION, PgAioResult::error_data, i, PgAioResult::id, PgAioHandleCallbacksEntry::name, PgAioHandle::num_callbacks, PgAioHandle::op, pgaio_debug_io, PGAIO_HCB_INVALID, PGAIO_OP_COUNT, PGAIO_OP_INVALID, pgaio_result_status_string(), PGAIO_RS_OK, PGAIO_TID_COUNT, PGAIO_TID_INVALID, PgAioHandle::result, PgAioResult::result, START_CRIT_SECTION, PgAioResult::status, and PgAioHandle::target.
Referenced by pgaio_io_process_completion().
void pgaio_io_call_stage | ( | PgAioHandle * | ioh | ) |
Definition at line 197 of file aio_callback.c.
References aio_handle_cbs, Assert(), PgAioHandle::callbacks, PgAioHandle::callbacks_data, PgAioHandleCallbacksEntry::cb, DEBUG3, i, PgAioHandleCallbacksEntry::name, PgAioHandle::num_callbacks, PgAioHandle::op, pgaio_debug_io, PGAIO_OP_COUNT, PGAIO_OP_INVALID, PGAIO_TID_COUNT, PGAIO_TID_INVALID, PgAioHandleCallbacks::stage, and PgAioHandle::target.
Referenced by pgaio_io_stage().
uint64 * pgaio_io_get_handle_data | ( | PgAioHandle * | ioh, |
uint8 * | len | ||
) |
Definition at line 154 of file aio_callback.c.
References Assert(), PgAioCtl::handle_data, PgAioHandle::handle_data_len, PgAioHandle::iovec_off, len, and pgaio_ctl.
Referenced by buffer_readv_complete(), and buffer_stage_common().
void pgaio_io_register_callbacks | ( | PgAioHandle * | ioh, |
PgAioHandleCallbackID | cb_id, | ||
uint8 | cb_data | ||
) |
Definition at line 86 of file aio_callback.c.
References aio_handle_cbs, Assert(), PgAioHandle::callbacks, PgAioHandle::callbacks_data, PgAioHandleCallbacksEntry::cb, PgAioHandleCallbacks::complete_local, DEBUG3, elog, ERROR, lengthof, PgAioHandleCallbacksEntry::name, PgAioHandle::num_callbacks, PANIC, pgaio_debug_io, PGAIO_HANDLE_MAX_CALLBACKS, and PGAIO_HCB_MAX.
Referenced by AsyncReadBuffers(), mdstartreadv(), and read_rel_block_ll().
void pgaio_io_set_handle_data_32 | ( | PgAioHandle * | ioh, |
uint32 * | data, | ||
uint8 | len | ||
) |
Definition at line 139 of file aio_callback.c.
References Assert(), data, PgAioCtl::handle_data, PgAioHandle::handle_data_len, i, PgAioHandle::iovec_off, len, PG_IOV_MAX, pgaio_ctl, PGAIO_HS_HANDED_OUT, and PgAioHandle::state.
Referenced by AsyncReadBuffers(), and read_rel_block_ll().
void pgaio_io_set_handle_data_64 | ( | PgAioHandle * | ioh, |
uint64 * | data, | ||
uint8 | len | ||
) |
Definition at line 122 of file aio_callback.c.
References Assert(), data, PgAioCtl::handle_data, PgAioHandle::handle_data_len, i, PgAioHandle::iovec_off, len, PG_IOV_MAX, pgaio_ctl, PGAIO_HS_HANDED_OUT, and PgAioHandle::state.
void pgaio_result_report | ( | PgAioResult | result, |
const PgAioTargetData * | target_data, | ||
int | elevel | ||
) |
Definition at line 171 of file aio_callback.c.
References aio_handle_cbs, Assert(), PgAioHandleCallbacksEntry::cb, elog, ERROR, PgAioResult::id, PgAioHandleCallbacksEntry::name, PGAIO_RS_OK, PGAIO_RS_UNKNOWN, PgAioHandleCallbacks::report, and PgAioResult::status.
Referenced by buffer_readv_complete(), buffer_readv_complete_one(), md_readv_complete(), ProcessReadBuffersResult(), and read_rel_block_ll().
|
static |
Definition at line 39 of file aio_callback.c.
Referenced by pgaio_io_call_complete_local(), pgaio_io_call_complete_shared(), pgaio_io_call_stage(), pgaio_io_register_callbacks(), and pgaio_result_report().
|
static |
Definition at line 26 of file aio_callback.c.