[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 16/31] qed: Inline qed_commit_l2_update()
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH v2 16/31] qed: Inline qed_commit_l2_update() |
Date: |
Fri, 16 Jun 2017 19:37:01 +0200 |
qed_commit_l2_update() is unconditionally called at the end of
qed_aio_write_l1_update(). Inline it.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block/qed.c | 36 ++++++++++++++----------------------
1 file changed, 14 insertions(+), 22 deletions(-)
diff --git a/block/qed.c b/block/qed.c
index d164b0e..5462faa 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -956,15 +956,27 @@ static void qed_aio_complete(QEDAIOCB *acb, int ret)
}
/**
- * Commit the current L2 table to the cache
+ * Update L1 table with new L2 table offset and write it out
*/
-static void qed_commit_l2_update(void *opaque, int ret)
+static void qed_aio_write_l1_update(void *opaque, int ret)
{
QEDAIOCB *acb = opaque;
BDRVQEDState *s = acb_to_s(acb);
CachedL2Table *l2_table = acb->request.l2_table;
uint64_t l2_offset = l2_table->offset;
+ int index;
+
+ if (ret) {
+ qed_aio_complete(acb, ret);
+ return;
+ }
+ index = qed_l1_index(s, acb->cur_pos);
+ s->l1_table->offsets[index] = l2_table->offset;
+
+ ret = qed_write_l1_table(s, index, 1);
+
+ /* Commit the current L2 table to the cache */
qed_commit_l2_cache_entry(&s->l2_cache, l2_table);
/* This is guaranteed to succeed because we just committed the entry to the
@@ -976,26 +988,6 @@ static void qed_commit_l2_update(void *opaque, int ret)
qed_aio_next_io(acb, ret);
}
-/**
- * Update L1 table with new L2 table offset and write it out
- */
-static void qed_aio_write_l1_update(void *opaque, int ret)
-{
- QEDAIOCB *acb = opaque;
- BDRVQEDState *s = acb_to_s(acb);
- int index;
-
- if (ret) {
- qed_aio_complete(acb, ret);
- return;
- }
-
- index = qed_l1_index(s, acb->cur_pos);
- s->l1_table->offsets[index] = acb->request.l2_table->offset;
-
- ret = qed_write_l1_table(s, index, 1);
- qed_commit_l2_update(acb, ret);
-}
/**
* Update L2 table with new cluster offsets and write them out
--
1.8.3.1
- [Qemu-block] [PATCH v2 06/31] qed: Make qed_read_backing_file() synchronous, (continued)
- [Qemu-block] [PATCH v2 06/31] qed: Make qed_read_backing_file() synchronous, Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 05/31] qed: Remove callback from qed_find_cluster(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 04/31] qed: Remove callback from qed_read_l2_table(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 07/31] qed: Make qed_copy_from_backing_file() synchronous, Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 08/31] qed: Remove callback from qed_copy_from_backing_file(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 09/31] qed: Make qed_write_header() synchronous, Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 10/31] qed: Remove callback from qed_write_header(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 11/31] qed: Make qed_write_table() synchronous, Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 12/31] qed: Remove GenericCB, Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 13/31] qed: Remove callback from qed_write_table(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 16/31] qed: Inline qed_commit_l2_update(),
Kevin Wolf <=
- [Qemu-block] [PATCH v2 14/31] qed: Make qed_aio_read_data() synchronous, Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 17/31] qed: Add return value to qed_aio_write_l1_update(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 15/31] qed: Make qed_aio_write_main() synchronous, Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 18/31] qed: Add return value to qed_aio_write_l2_update(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 19/31] qed: Add return value to qed_aio_write_main(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 20/31] qed: Add return value to qed_aio_write_cow(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 21/31] qed: Add return value to qed_aio_write_inplace/alloc(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 22/31] qed: Add return value to qed_aio_read/write_data(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 23/31] qed: Remove ret argument from qed_aio_next_io(), Kevin Wolf, 2017/06/16
- [Qemu-block] [PATCH v2 24/31] qed: Remove recursion in qed_aio_next_io(), Kevin Wolf, 2017/06/16