diff options
author | Kevin Wolf <kwolf@redhat.com> | 2016-11-14 16:26:14 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-06-26 14:51:14 +0200 |
commit | a8165d2d6619a29b99451fd0a310d64693d86c3f (patch) | |
tree | 5d827b8c21c3fb0b4d265cfb956fcf2226bbd271 /block/qed-table.c | |
parent | f6513529c67509264fc602c4a537ec24bcb7b26f (diff) |
qed: Remove callback from qed_read_l2_table()
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/qed-table.c')
-rw-r--r-- | block/qed-table.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/block/qed-table.c b/block/qed-table.c index 427000318d..ffecbeadb4 100644 --- a/block/qed-table.c +++ b/block/qed-table.c @@ -177,8 +177,7 @@ int qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index, return ret; } -void qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offset, - BlockCompletionFunc *cb, void *opaque) +int qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offset) { int ret; @@ -187,8 +186,7 @@ void qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offset, /* Check for cached L2 entry */ request->l2_table = qed_find_l2_cache_entry(&s->l2_cache, offset); if (request->l2_table) { - cb(opaque, 0); - return; + return 0; } request->l2_table = qed_alloc_l2_cache_entry(&s->l2_cache); @@ -215,17 +213,12 @@ void qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offset, } qed_release(s); - cb(opaque, ret); + return ret; } int qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, uint64_t offset) { - int ret = -EINPROGRESS; - - qed_read_l2_table(s, request, offset, qed_sync_cb, &ret); - BDRV_POLL_WHILE(s->bs, ret == -EINPROGRESS); - - return ret; + return qed_read_l2_table(s, request, offset); } void qed_write_l2_table(BDRVQEDState *s, QEDRequest *request, |