aio: Change prefix of PgAioResultStatus values to PGAIO_RS_
authorAndres Freund <[email protected]>
Sat, 22 Mar 2025 21:30:44 +0000 (17:30 -0400)
committerAndres Freund <[email protected]>
Sat, 22 Mar 2025 21:30:44 +0000 (17:30 -0400)
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 <[email protected]>
Discussion: https://postgr.es/m/CAAKRu_Yb+JzQpNsgUxCB0gBi+sE-mi_HmcJF6ALnmO4W+UgwpA@mail.gmail.com

src/backend/storage/aio/aio.c
src/backend/storage/aio/aio_callback.c
src/backend/storage/aio/aio_init.c
src/include/storage/aio_types.h

index 3ed4b1dfdac794c04a2a485bc13b47ea0a59c952..29f57f9cd1c2d512dac8ffc5223e8e455893fff5 100644 (file)
@@ -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";
    }
 
index d5a2cca28f1e97435cc7146e187af1087149864f..09f03f296f58f7c7b3c3f3800a3d14a7527db742 100644 (file)
@@ -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;
index 2ede7e80b6560173711c7e69e60ad62859316091..885c3940c66263dcff292f9e1333a435f666e3e1 100644 (file)
@@ -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);
index a5cc658efbd839fbfd667bfe52cefdfb6bd86413..dddda3a3e2f57b815360a9fecfc3699749229aca 100644 (file)
@@ -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;