block: Remove bdrv_ioctl()
It is unused now. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
0d4377b3ea
commit
61b2450414
37
block/io.c
37
block/io.c
@ -2518,43 +2518,6 @@ out:
|
|||||||
return co.ret;
|
return co.ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
BlockDriverState *bs;
|
|
||||||
int req;
|
|
||||||
void *buf;
|
|
||||||
int ret;
|
|
||||||
} BdrvIoctlCoData;
|
|
||||||
|
|
||||||
static void coroutine_fn bdrv_co_ioctl_entry(void *opaque)
|
|
||||||
{
|
|
||||||
BdrvIoctlCoData *data = opaque;
|
|
||||||
data->ret = bdrv_co_ioctl(data->bs, data->req, data->buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* needed for generic scsi interface */
|
|
||||||
int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
|
|
||||||
{
|
|
||||||
BdrvIoctlCoData data = {
|
|
||||||
.bs = bs,
|
|
||||||
.req = req,
|
|
||||||
.buf = buf,
|
|
||||||
.ret = -EINPROGRESS,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (qemu_in_coroutine()) {
|
|
||||||
/* Fast-path if already in coroutine context */
|
|
||||||
bdrv_co_ioctl_entry(&data);
|
|
||||||
} else {
|
|
||||||
Coroutine *co = qemu_coroutine_create(bdrv_co_ioctl_entry, &data);
|
|
||||||
|
|
||||||
qemu_coroutine_enter(co);
|
|
||||||
while (data.ret == -EINPROGRESS) {
|
|
||||||
aio_poll(bdrv_get_aio_context(bs), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return data.ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void coroutine_fn bdrv_co_aio_ioctl_entry(void *opaque)
|
static void coroutine_fn bdrv_co_aio_ioctl_entry(void *opaque)
|
||||||
{
|
{
|
||||||
BlockAIOCBCoroutine *acb = opaque;
|
BlockAIOCBCoroutine *acb = opaque;
|
||||||
|
@ -319,7 +319,6 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb);
|
|||||||
|
|
||||||
/* sg packet commands */
|
/* sg packet commands */
|
||||||
int bdrv_co_ioctl(BlockDriverState *bs, int req, void *buf);
|
int bdrv_co_ioctl(BlockDriverState *bs, int req, void *buf);
|
||||||
int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf);
|
|
||||||
BlockAIOCB *bdrv_aio_ioctl(BlockDriverState *bs,
|
BlockAIOCB *bdrv_aio_ioctl(BlockDriverState *bs,
|
||||||
unsigned long int req, void *buf,
|
unsigned long int req, void *buf,
|
||||||
BlockCompletionFunc *cb, void *opaque);
|
BlockCompletionFunc *cb, void *opaque);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user