[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/3] iscsi: move iscsi_schedule_bh and iscsi_readv_w
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 1/3] iscsi: move iscsi_schedule_bh and iscsi_readv_writev_bh_cb |
Date: |
Sat, 18 Aug 2012 23:49:01 +0200 |
Put these functions at the beginning, to avoid forward references
in the next patches.
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/iscsi.c | 56 ++++++++++++++++++++++++++++----------------------------
1 file modificato, 28 inserzioni(+), 28 rimozioni(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index 993a86d..7cfd752 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -73,6 +73,34 @@ struct IscsiTask {
};
static void
+iscsi_readv_writev_bh_cb(void *p)
+{
+ IscsiAIOCB *acb = p;
+
+ qemu_bh_delete(acb->bh);
+
+ if (acb->canceled == 0) {
+ acb->common.cb(acb->common.opaque, acb->status);
+ }
+
+ qemu_aio_release(acb);
+}
+
+static int
+iscsi_schedule_bh(QEMUBHFunc *cb, IscsiAIOCB *acb)
+{
+ acb->bh = qemu_bh_new(cb, acb);
+ if (!acb->bh) {
+ error_report("oom: could not create iscsi bh");
+ return -EIO;
+ }
+
+ qemu_bh_schedule(acb->bh);
+ return 0;
+}
+
+
+static void
iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void
*command_data,
void *private_data)
{
@@ -159,34 +187,6 @@ iscsi_process_write(void *arg)
}
-static int
-iscsi_schedule_bh(QEMUBHFunc *cb, IscsiAIOCB *acb)
-{
- acb->bh = qemu_bh_new(cb, acb);
- if (!acb->bh) {
- error_report("oom: could not create iscsi bh");
- return -EIO;
- }
-
- qemu_bh_schedule(acb->bh);
- return 0;
-}
-
-static void
-iscsi_readv_writev_bh_cb(void *p)
-{
- IscsiAIOCB *acb = p;
-
- qemu_bh_delete(acb->bh);
-
- if (acb->canceled == 0) {
- acb->common.cb(acb->common.opaque, acb->status);
- }
-
- qemu_aio_release(acb);
-}
-
-
static void
iscsi_aio_write16_cb(struct iscsi_context *iscsi, int status,
void *command_data, void *opaque)
--
1.7.11.2
- [Qemu-devel] [PATCH RFT 0/3] iscsi: fix NULL dereferences / races between task completion and abort, Paolo Bonzini, 2012/08/18
- [Qemu-devel] [PATCH 1/3] iscsi: move iscsi_schedule_bh and iscsi_readv_writev_bh_cb,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 2/3] iscsi: simplify iscsi_schedule_bh, Paolo Bonzini, 2012/08/18
- [Qemu-devel] [PATCH 3/3] iscsi: fix races between task completion and abort, Paolo Bonzini, 2012/08/18
- Re: [Qemu-devel] [PATCH RFT 0/3] iscsi: fix NULL dereferences / races between task completion and abort, Stefan Priebe, 2012/08/19
- Re: [Qemu-devel] [PATCH RFT 0/3] iscsi: fix NULL dereferences / races between task completion and abort, Paolo Bonzini, 2012/08/19
- Re: [Qemu-devel] [PATCH RFT 0/3] iscsi: fix NULL dereferences / races between task completion and abort, Stefan Priebe - Profihost AG, 2012/08/19
- Re: [Qemu-devel] [PATCH RFT 0/3] iscsi: fix NULL dereferences / races between task completion and abort, Paolo Bonzini, 2012/08/20
- Re: [Qemu-devel] [PATCH RFT 0/3] iscsi: fix NULL dereferences / races between task completion and abort, Stefan Priebe - Profihost AG, 2012/08/20
- Re: [Qemu-devel] [PATCH RFT 0/3] iscsi: fix NULL dereferences / races between task completion and abort, Paolo Bonzini, 2012/08/20
- Re: [Qemu-devel] [PATCH RFT 0/3] iscsi: fix NULL dereferences / races between task completion and abort, Stefan Priebe - Profihost AG, 2012/08/20
- Re: [Qemu-devel] [PATCH RFT 0/3] iscsi: fix NULL dereferences / races between task completion and abort, ronnie sahlberg, 2012/08/20