From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2qtR-0001Fx-R0 for qemu-devel@nongnu.org; Sat, 18 Aug 2012 17:49:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2qtQ-0006n1-Cp for qemu-devel@nongnu.org; Sat, 18 Aug 2012 17:49:17 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:56787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2qtQ-0006mp-6J for qemu-devel@nongnu.org; Sat, 18 Aug 2012 17:49:16 -0400 Received: by wgbfm10 with SMTP id fm10so3512240wgb.10 for ; Sat, 18 Aug 2012 14:49:15 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Sat, 18 Aug 2012 23:49:01 +0200 Message-Id: <1345326543-10677-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1345326543-10677-1-git-send-email-pbonzini@redhat.com> References: <1345326543-10677-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 1/3] iscsi: move iscsi_schedule_bh and iscsi_readv_writev_bh_cb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, s.priebe@profihost.ag Cc: ronniesahlberg@gmail.com Put these functions at the beginning, to avoid forward references in the next patches. Signed-off-by: Paolo Bonzini --- 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