qed: Add coroutine_fn to I/O path functions

Now that we stay in coroutine context for the whole request when doing
reads or writes, we can add coroutine_fn annotations to many functions
that can do I/O or yield directly.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Kevin Wolf 2017-06-12 11:12:41 +02:00
parent c0e8f98927
commit 87f0d88261
3 changed files with 30 additions and 24 deletions

View file

@ -86,8 +86,9 @@ static unsigned int qed_count_contiguous_clusters(BDRVQEDState *s,
* On failure QED_CLUSTER_L2 or QED_CLUSTER_L1 is returned for missing L2 or L1
* table offset, respectively. len is number of contiguous unallocated bytes.
*/
int qed_find_cluster(BDRVQEDState *s, QEDRequest *request, uint64_t pos,
size_t *len, uint64_t *img_offset)
int coroutine_fn qed_find_cluster(BDRVQEDState *s, QEDRequest *request,
uint64_t pos, size_t *len,
uint64_t *img_offset)
{
uint64_t l2_offset;
uint64_t offset = 0;