From d4f510eb3f56d30dd1312fe902138c430db2b361 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 6 May 2016 10:26:31 -0600 Subject: ide: Switch to byte-based aio block access Sector-based blk_aio_readv() and blk_aio_writev() should die; switch to byte-based blk_aio_preadv() and blk_aio_pwritev() instead. The patch had to touch multiple files at once, because dma_blk_io() takes pointers to the functions, and ide_issue_trim() piggybacks on the same interface (while ignoring offset under the hood). Signed-off-by: Eric Blake Signed-off-by: Kevin Wolf --- hw/ide/macio.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'hw/ide/macio.c') diff --git a/hw/ide/macio.c b/hw/ide/macio.c index ae29b6f..d7d9c0f 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -120,8 +120,7 @@ static void pmac_dma_read(BlockBackend *blk, MACIO_DPRINTF("--- Block read transfer - sector_num: %" PRIx64 " " "nsector: %x\n", (offset >> 9), (bytes >> 9)); - s->bus->dma->aiocb = blk_aio_readv(blk, (offset >> 9), &io->iov, - (bytes >> 9), cb, io); + s->bus->dma->aiocb = blk_aio_preadv(blk, offset, &io->iov, 0, cb, io); } static void pmac_dma_write(BlockBackend *blk, @@ -205,8 +204,7 @@ static void pmac_dma_write(BlockBackend *blk, MACIO_DPRINTF("--- Block write transfer - sector_num: %" PRIx64 " " "nsector: %x\n", (offset >> 9), (bytes >> 9)); - s->bus->dma->aiocb = blk_aio_writev(blk, (offset >> 9), &io->iov, - (bytes >> 9), cb, io); + s->bus->dma->aiocb = blk_aio_pwritev(blk, offset, &io->iov, 0, cb, io); } static void pmac_dma_trim(BlockBackend *blk, @@ -232,8 +230,7 @@ static void pmac_dma_trim(BlockBackend *blk, s->io_buffer_index += io->len; io->len = 0; - s->bus->dma->aiocb = ide_issue_trim(blk, (offset >> 9), &io->iov, - (bytes >> 9), cb, io); + s->bus->dma->aiocb = ide_issue_trim(blk, offset, &io->iov, 0, cb, io); } static void pmac_ide_atapi_transfer_cb(void *opaque, int ret) -- cgit v1.1