asyncio: remove unused field asyncio_op_t.flying_w

This commit is contained in:
Lephe 2023-02-16 16:09:53 +01:00
parent af5c16a3d3
commit 6910714c2c
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
2 changed files with 17 additions and 12 deletions

View File

@ -53,15 +53,18 @@
The invariants and meaning for each state are as follow:
State Characterization Description
State(s) Characterization Description
============================================================================
IDLE type == ASYNCIO_NONE No I/O operation
PENDING data_w && !flying_w \ Ready to write pending data
&& round_size == 0
WRITING round_size > 0 CPU/DMA write to HW in progress
FLYING-WRITE flying_w && type == WRITE HW transmission in progress
----------------------------------------------------------------------------
PENDING data_w && round_size == 0 Ready to write pending data
----------------------------------------------------------------------------
WRITING, round_size > 0 CPU/DMA write to HW in progress
FLYING-WRITE HW transmission in progress
----------------------------------------------------------------------------
IN-PROGRESS !data_w && type == WRITE Waiting for write(2) or fsync(2)
FLYING-SYNC flying_w && type == SYNC HW commit in progress
----------------------------------------------------------------------------
FLYING-SYNC type == ASYNCIO_SYNC HW commit in progress
============================================================================
For a read:
@ -87,8 +90,11 @@
State Characterization Description
============================================================================
IDLE-EMPTY type == ASYNCIO_NONE No I/O operation
----------------------------------------------------------------------------
IDLE-READY !data_r && buffer_size > 0 Hardware waiting for us to read
----------------------------------------------------------------------------
WAITING data_r && !buffer_size Waiting for further HW data
----------------------------------------------------------------------------
READING round_size > 0 DMA/CPU read from HW in progress
============================================================================
@ -127,9 +133,6 @@ typedef volatile struct
Usually, this is assigned for the duration of hardware transaction.
This value is user-managed and not modified by asyncio_op functions. */
uint8_t controller;
/* Whether a hardware operation is in progress ("flying" write states) */
// TODO: Do we actually set and maintain this member?!
bool flying_w;
/** Internal information **/

View File

@ -11,9 +11,12 @@ bool asyncio_op_busy(asyncio_op_t const *op)
/* WAITING and READING states are busy */
if(op->type == ASYNCIO_READ)
return op->round_size || op->data_r != NULL;
/* WRITING, FLYING-WRITE, FLYING-COMMIT and PENDING states are busy */
/* WRITING, FLYING-WRITE and PENDING states are busy */
if(op->type == ASYNCIO_WRITE)
return op->round_size || op->flying_w || op->data_w != NULL;
return op->data_w != NULL;
/* FLYING-COMMIT state is busy */
if(op->type == ASYNCIO_SYNC)
return true;
return false;
}
@ -62,7 +65,6 @@ void asyncio_op_finish_call(asyncio_op_t *op)
op->size = 0;
op->callback = GINT_CALL_NULL;
op->round_size = 0;
op->flying_w = false;
}
else {
asyncio_op_clear(op);