summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-08-18 23:38:03 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-08-20 15:58:47 +0200
commitcfb3f5064af2d2e29c976e292c9472dfe9d61e31 (patch)
tree9a1d5affa9b09f2ed658b03c4c2d90541cacf081 /block
parent27cbd828c617944c0f9603763fdf4fa87e7ad923 (diff)
downloadqemu-cfb3f5064af2d2e29c976e292c9472dfe9d61e31.zip
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>
Diffstat (limited to 'block')
-rw-r--r--block/iscsi.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/block/iscsi.c b/block/iscsi.c
index 600e334e13..7b09795720 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -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;
}