aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-08-18 23:38:03 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2012-08-28 01:50:01 -0500
commitb90d717b6469ac15fa1837a884097bbc5499124c (patch)
tree909efc8db7ff0c07e50edb67193c44f8a4d52ffc /block
parentiscsi: move iscsi_schedule_bh and iscsi_readv_writev_bh_cb (diff)
downloadqemu-kvm-b90d717b6469ac15fa1837a884097bbc5499124c.tar.gz
qemu-kvm-b90d717b6469ac15fa1837a884097bbc5499124c.tar.bz2
qemu-kvm-b90d717b6469ac15fa1837a884097bbc5499124c.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> (cherry picked from commit cfb3f5064af2d2e29c976e292c9472dfe9d61e31) Conflicts: block/iscsi.c Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'block')
-rw-r--r--block/iscsi.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/block/iscsi.c b/block/iscsi.c
index 4d345c610..4584d54eb 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -66,7 +66,7 @@ struct IscsiTask {
};
static void
-iscsi_readv_writev_bh_cb(void *p)
+iscsi_bh_cb(void *p)
{
IscsiAIOCB *acb = p;
@@ -79,17 +79,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;
}
@@ -204,7 +198,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;
}
@@ -306,7 +300,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;
}
@@ -422,7 +416,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;
}
@@ -476,7 +470,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;
}