Received: from eggs.gnu.org ([208.118.235.92]:34232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3SjS-0007a9-QZ for qemu-devel@nongnu.org; Mon, 20 Aug 2012 10:13:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3SjJ-0007CV-Of for qemu-devel@nongnu.org; Mon, 20 Aug 2012 10:13:30 -0400 Received: from mail-ey0-f173.google.com ([209.85.215.173]:40154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3SjJ-0007CM-Hy for qemu-devel@nongnu.org; Mon, 20 Aug 2012 10:13:21 -0400 Received: by eaac13 with SMTP id c13so1910518eaa.4 for ; Mon, 20 Aug 2012 07:13:21 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 20 Aug 2012 16:13:10 +0200 Message-Id: <1345471993-31629-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1345471993-31629-1-git-send-email-pbonzini@redhat.com> References: <1345471993-31629-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 2/5] 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 Cc: anthony@codemonkey.ws 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 219f927..600e334 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