Skip to content

Commit

Permalink
iscsi: move iscsi_schedule_bh and iscsi_readv_writev_bh_cb
Browse files Browse the repository at this point in the history
Put these functions at the beginning, to avoid forward references
in the next patches.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Aug 20, 2012
1 parent b209091 commit 27cbd82
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions block/iscsi.c
Expand Up @@ -72,6 +72,34 @@ struct IscsiTask {
int complete;
};

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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 27cbd82

Please sign in to comment.