提交 cfb3f506 编写于 作者: P Paolo Bonzini

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: NPaolo Bonzini <pbonzini@redhat.com>
上级 27cbd828
...@@ -73,7 +73,7 @@ struct IscsiTask { ...@@ -73,7 +73,7 @@ struct IscsiTask {
}; };
static void static void
iscsi_readv_writev_bh_cb(void *p) iscsi_bh_cb(void *p)
{ {
IscsiAIOCB *acb = p; IscsiAIOCB *acb = p;
...@@ -86,17 +86,11 @@ iscsi_readv_writev_bh_cb(void *p) ...@@ -86,17 +86,11 @@ iscsi_readv_writev_bh_cb(void *p)
qemu_aio_release(acb); qemu_aio_release(acb);
} }
static int static void
iscsi_schedule_bh(QEMUBHFunc *cb, IscsiAIOCB *acb) iscsi_schedule_bh(IscsiAIOCB *acb)
{ {
acb->bh = qemu_bh_new(cb, acb); acb->bh = qemu_bh_new(iscsi_bh_cb, acb);
if (!acb->bh) {
error_report("oom: could not create iscsi bh");
return -EIO;
}
qemu_bh_schedule(acb->bh); qemu_bh_schedule(acb->bh);
return 0;
} }
...@@ -211,7 +205,7 @@ iscsi_aio_write16_cb(struct iscsi_context *iscsi, int status, ...@@ -211,7 +205,7 @@ iscsi_aio_write16_cb(struct iscsi_context *iscsi, int status,
acb->status = -EIO; acb->status = -EIO;
} }
iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); iscsi_schedule_bh(acb);
scsi_free_scsi_task(acb->task); scsi_free_scsi_task(acb->task);
acb->task = NULL; acb->task = NULL;
} }
...@@ -312,7 +306,7 @@ iscsi_aio_read16_cb(struct iscsi_context *iscsi, int status, ...@@ -312,7 +306,7 @@ iscsi_aio_read16_cb(struct iscsi_context *iscsi, int status,
acb->status = -EIO; acb->status = -EIO;
} }
iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); iscsi_schedule_bh(acb);
scsi_free_scsi_task(acb->task); scsi_free_scsi_task(acb->task);
acb->task = NULL; acb->task = NULL;
} }
...@@ -428,7 +422,7 @@ iscsi_synccache10_cb(struct iscsi_context *iscsi, int status, ...@@ -428,7 +422,7 @@ iscsi_synccache10_cb(struct iscsi_context *iscsi, int status,
acb->status = -EIO; acb->status = -EIO;
} }
iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); iscsi_schedule_bh(acb);
scsi_free_scsi_task(acb->task); scsi_free_scsi_task(acb->task);
acb->task = NULL; acb->task = NULL;
} }
...@@ -482,7 +476,7 @@ iscsi_unmap_cb(struct iscsi_context *iscsi, int status, ...@@ -482,7 +476,7 @@ iscsi_unmap_cb(struct iscsi_context *iscsi, int status,
acb->status = -EIO; acb->status = -EIO;
} }
iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); iscsi_schedule_bh(acb);
scsi_free_scsi_task(acb->task); scsi_free_scsi_task(acb->task);
acb->task = NULL; acb->task = NULL;
} }
...@@ -559,7 +553,7 @@ iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status, ...@@ -559,7 +553,7 @@ iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status,
memcpy(acb->ioh->sbp, &acb->task->datain.data[2], ss); 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); scsi_free_scsi_task(acb->task);
acb->task = NULL; acb->task = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册