From: Andres Freund Date: Sat, 22 Mar 2025 21:30:44 +0000 (-0400) Subject: aio: Change prefix of PgAioResultStatus values to PGAIO_RS_ X-Git-Tag: REL_18_BETA1~481 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=ca3067cc573d7c1ed617cfb959ae8507be17f1aa;p=postgresql.git aio: Change prefix of PgAioResultStatus values to PGAIO_RS_ The previous prefix wasn't consistent with the naming of other AIO related enum values. It seems best to rename it before the users are introduced. Reported-by: Melanie Plageman Discussion: https://postgr.es/m/CAAKRu_Yb+JzQpNsgUxCB0gBi+sE-mi_HmcJF6ALnmO4W+UgwpA@mail.gmail.com --- diff --git a/src/backend/storage/aio/aio.c b/src/backend/storage/aio/aio.c index 3ed4b1dfdac..29f57f9cd1c 100644 --- a/src/backend/storage/aio/aio.c +++ b/src/backend/storage/aio/aio.c @@ -216,7 +216,7 @@ pgaio_io_acquire_nb(struct ResourceOwnerData *resowner, PgAioReturn *ret) if (ret) { ioh->report_return = ret; - ret->result.status = ARS_UNKNOWN; + ret->result.status = PGAIO_RS_UNKNOWN; } return ioh; @@ -669,7 +669,7 @@ pgaio_io_reclaim(PgAioHandle *ioh) ioh->handle_data_len = 0; ioh->report_return = NULL; ioh->result = 0; - ioh->distilled_result.status = ARS_UNKNOWN; + ioh->distilled_result.status = PGAIO_RS_UNKNOWN; /* XXX: the barrier is probably superfluous */ pg_write_barrier(); @@ -829,13 +829,13 @@ pgaio_result_status_string(PgAioResultStatus rs) { switch (rs) { - case ARS_UNKNOWN: + case PGAIO_RS_UNKNOWN: return "UNKNOWN"; - case ARS_OK: + case PGAIO_RS_OK: return "OK"; - case ARS_PARTIAL: + case PGAIO_RS_PARTIAL: return "PARTIAL"; - case ARS_ERROR: + case PGAIO_RS_ERROR: return "ERROR"; } diff --git a/src/backend/storage/aio/aio_callback.c b/src/backend/storage/aio/aio_callback.c index d5a2cca28f1..09f03f296f5 100644 --- a/src/backend/storage/aio/aio_callback.c +++ b/src/backend/storage/aio/aio_callback.c @@ -164,8 +164,8 @@ pgaio_result_report(PgAioResult result, const PgAioTargetData *target_data, int PgAioHandleCallbackID cb_id = result.id; const PgAioHandleCallbacksEntry *ce = &aio_handle_cbs[cb_id]; - Assert(result.status != ARS_UNKNOWN); - Assert(result.status != ARS_OK); + Assert(result.status != PGAIO_RS_UNKNOWN); + Assert(result.status != PGAIO_RS_OK); if (ce->cb->report == NULL) elog(ERROR, "callback %d/%s does not have report callback", @@ -220,7 +220,7 @@ pgaio_io_call_complete_shared(PgAioHandle *ioh) Assert(ioh->target > PGAIO_TID_INVALID && ioh->target < PGAIO_TID_COUNT); Assert(ioh->op > PGAIO_OP_INVALID && ioh->op < PGAIO_OP_COUNT); - result.status = ARS_OK; /* low level IO is always considered OK */ + result.status = PGAIO_RS_OK; /* low level IO is always considered OK */ result.result = ioh->result; result.id = PGAIO_HCB_INVALID; result.error_data = 0; diff --git a/src/backend/storage/aio/aio_init.c b/src/backend/storage/aio/aio_init.c index 2ede7e80b65..885c3940c66 100644 --- a/src/backend/storage/aio/aio_init.c +++ b/src/backend/storage/aio/aio_init.c @@ -202,7 +202,7 @@ AioShmemInit(void) ioh->report_return = NULL; ioh->resowner = NULL; ioh->num_callbacks = 0; - ioh->distilled_result.status = ARS_UNKNOWN; + ioh->distilled_result.status = PGAIO_RS_UNKNOWN; ioh->flags = 0; ConditionVariableInit(&ioh->cv); diff --git a/src/include/storage/aio_types.h b/src/include/storage/aio_types.h index a5cc658efbd..dddda3a3e2f 100644 --- a/src/include/storage/aio_types.h +++ b/src/include/storage/aio_types.h @@ -73,10 +73,10 @@ typedef union PgAioTargetData */ typedef enum PgAioResultStatus { - ARS_UNKNOWN, /* not yet completed / uninitialized */ - ARS_OK, - ARS_PARTIAL, /* did not fully succeed, but no error */ - ARS_ERROR, + PGAIO_RS_UNKNOWN, /* not yet completed / uninitialized */ + PGAIO_RS_OK, + PGAIO_RS_PARTIAL, /* did not fully succeed, but no error */ + PGAIO_RS_ERROR, } PgAioResultStatus;