Skip to content

Commit ca3067c

Browse files
committed
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 <melanieplageman@gmail.com> Discussion: https://postgr.es/m/CAAKRu_Yb+JzQpNsgUxCB0gBi+sE-mi_HmcJF6ALnmO4W+UgwpA@mail.gmail.com
1 parent 58fdca2 commit ca3067c

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/backend/storage/aio/aio.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ pgaio_io_acquire_nb(struct ResourceOwnerData *resowner, PgAioReturn *ret)
216216
if (ret)
217217
{
218218
ioh->report_return = ret;
219-
ret->result.status = ARS_UNKNOWN;
219+
ret->result.status = PGAIO_RS_UNKNOWN;
220220
}
221221

222222
return ioh;
@@ -669,7 +669,7 @@ pgaio_io_reclaim(PgAioHandle *ioh)
669669
ioh->handle_data_len = 0;
670670
ioh->report_return = NULL;
671671
ioh->result = 0;
672-
ioh->distilled_result.status = ARS_UNKNOWN;
672+
ioh->distilled_result.status = PGAIO_RS_UNKNOWN;
673673

674674
/* XXX: the barrier is probably superfluous */
675675
pg_write_barrier();
@@ -829,13 +829,13 @@ pgaio_result_status_string(PgAioResultStatus rs)
829829
{
830830
switch (rs)
831831
{
832-
case ARS_UNKNOWN:
832+
case PGAIO_RS_UNKNOWN:
833833
return "UNKNOWN";
834-
case ARS_OK:
834+
case PGAIO_RS_OK:
835835
return "OK";
836-
case ARS_PARTIAL:
836+
case PGAIO_RS_PARTIAL:
837837
return "PARTIAL";
838-
case ARS_ERROR:
838+
case PGAIO_RS_ERROR:
839839
return "ERROR";
840840
}
841841

src/backend/storage/aio/aio_callback.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ pgaio_result_report(PgAioResult result, const PgAioTargetData *target_data, int
164164
PgAioHandleCallbackID cb_id = result.id;
165165
const PgAioHandleCallbacksEntry *ce = &aio_handle_cbs[cb_id];
166166

167-
Assert(result.status != ARS_UNKNOWN);
168-
Assert(result.status != ARS_OK);
167+
Assert(result.status != PGAIO_RS_UNKNOWN);
168+
Assert(result.status != PGAIO_RS_OK);
169169

170170
if (ce->cb->report == NULL)
171171
elog(ERROR, "callback %d/%s does not have report callback",
@@ -220,7 +220,7 @@ pgaio_io_call_complete_shared(PgAioHandle *ioh)
220220
Assert(ioh->target > PGAIO_TID_INVALID && ioh->target < PGAIO_TID_COUNT);
221221
Assert(ioh->op > PGAIO_OP_INVALID && ioh->op < PGAIO_OP_COUNT);
222222

223-
result.status = ARS_OK; /* low level IO is always considered OK */
223+
result.status = PGAIO_RS_OK; /* low level IO is always considered OK */
224224
result.result = ioh->result;
225225
result.id = PGAIO_HCB_INVALID;
226226
result.error_data = 0;

src/backend/storage/aio/aio_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ AioShmemInit(void)
202202
ioh->report_return = NULL;
203203
ioh->resowner = NULL;
204204
ioh->num_callbacks = 0;
205-
ioh->distilled_result.status = ARS_UNKNOWN;
205+
ioh->distilled_result.status = PGAIO_RS_UNKNOWN;
206206
ioh->flags = 0;
207207

208208
ConditionVariableInit(&ioh->cv);

src/include/storage/aio_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ typedef union PgAioTargetData
7373
*/
7474
typedef enum PgAioResultStatus
7575
{
76-
ARS_UNKNOWN, /* not yet completed / uninitialized */
77-
ARS_OK,
78-
ARS_PARTIAL, /* did not fully succeed, but no error */
79-
ARS_ERROR,
76+
PGAIO_RS_UNKNOWN, /* not yet completed / uninitialized */
77+
PGAIO_RS_OK,
78+
PGAIO_RS_PARTIAL, /* did not fully succeed, but no error */
79+
PGAIO_RS_ERROR,
8080
} PgAioResultStatus;
8181

8282

0 commit comments

Comments
 (0)