iscsi: simplify iscsi_schedule_bh

It is always used with the same callback, remove the argument.  And
its return value is never used, assume allocation succeeds.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2012-08-18 23:38:03 +02:00
parent 27cbd828c6
commit cfb3f5064a

View File

@ -73,7 +73,7 @@ struct IscsiTask {
};
static void
iscsi_readv_writev_bh_cb(void *p)
iscsi_bh_cb(void *p)
{
IscsiAIOCB *acb = p;
@ -86,17 +86,11 @@ iscsi_readv_writev_bh_cb(void *p)
qemu_aio_release(acb);
}
static int
iscsi_schedule_bh(QEMUBHFunc *cb, IscsiAIOCB *acb)
static void
iscsi_schedule_bh(IscsiAIOCB *acb)
{
acb->bh = qemu_bh_new(cb, acb);
if (!acb->bh) {
error_report("oom: could not create iscsi bh");
return -EIO;
}
acb->bh = qemu_bh_new(iscsi_bh_cb, acb);
qemu_bh_schedule(acb->bh);
return 0;
}
@ -211,7 +205,7 @@ iscsi_aio_write16_cb(struct iscsi_context *iscsi, int status,
acb->status = -EIO;
}
iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb);
iscsi_schedule_bh(acb);
scsi_free_scsi_task(acb->task);
acb->task = NULL;
}
@ -312,7 +306,7 @@ iscsi_aio_read16_cb(struct iscsi_context *iscsi, int status,
acb->status = -EIO;
}
iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb);
iscsi_schedule_bh(acb);
scsi_free_scsi_task(acb->task);
acb->task = NULL;
}
@ -428,7 +422,7 @@ iscsi_synccache10_cb(struct iscsi_context *iscsi, int status,
acb->status = -EIO;
}
iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb);
iscsi_schedule_bh(acb);
scsi_free_scsi_task(acb->task);
acb->task = NULL;
}
@ -482,7 +476,7 @@ iscsi_unmap_cb(struct iscsi_context *iscsi, int status,
acb->status = -EIO;
}
iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb);
iscsi_schedule_bh(acb);
scsi_free_scsi_task(acb->task);
acb->task = NULL;
}
@ -559,7 +553,7 @@ iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status,
memcpy(acb->ioh->sbp, &acb->task->datain.data[2], ss);
}
iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb);
iscsi_schedule_bh(acb);
scsi_free_scsi_task(acb->task);
acb->task = NULL;
}