[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v7 19/19] block: Kill unused sector-based blk_* func
From: |
Eric Blake |
Subject: |
[Qemu-block] [PATCH v7 19/19] block: Kill unused sector-based blk_* functions |
Date: |
Fri, 6 May 2016 10:26:45 -0600 |
Now that there are no remaining clients, we can drop the
sector-based blk_read(), blk_write(), blk_aio_readv(), and
blk_aio_writev(). Sadly, there are still remaining
sector-based interfaces, such as blk_*discard(), or
blk_write_compressed(); those will have to wait for another
day.
Signed-off-by: Eric Blake <address@hidden>
---
include/sysemu/block-backend.h | 10 ---------
block/block-backend.c | 51 ------------------------------------------
2 files changed, 61 deletions(-)
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 73df1a6..26736ed 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -90,12 +90,8 @@ void blk_attach_dev_nofail(BlockBackend *blk, void *dev);
void blk_detach_dev(BlockBackend *blk, void *dev);
void *blk_get_attached_dev(BlockBackend *blk);
void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *opaque);
-int blk_read(BlockBackend *blk, int64_t sector_num, uint8_t *buf,
- int nb_sectors);
int blk_pread_unthrottled(BlockBackend *blk, int64_t offset, uint8_t *buf,
int count);
-int blk_write(BlockBackend *blk, int64_t sector_num, const uint8_t *buf,
- int nb_sectors);
int blk_write_zeroes(BlockBackend *blk, int64_t offset,
int count, BdrvRequestFlags flags);
BlockAIOCB *blk_aio_write_zeroes(BlockBackend *blk, int64_t offset,
@@ -107,15 +103,9 @@ int blk_pwrite(BlockBackend *blk, int64_t offset, const
void *buf, int count,
int64_t blk_getlength(BlockBackend *blk);
void blk_get_geometry(BlockBackend *blk, uint64_t *nb_sectors_ptr);
int64_t blk_nb_sectors(BlockBackend *blk);
-BlockAIOCB *blk_aio_readv(BlockBackend *blk, int64_t sector_num,
- QEMUIOVector *iov, int nb_sectors,
- BlockCompletionFunc *cb, void *opaque);
BlockAIOCB *blk_aio_preadv(BlockBackend *blk, int64_t offset,
QEMUIOVector *qiov, BdrvRequestFlags flags,
BlockCompletionFunc *cb, void *opaque);
-BlockAIOCB *blk_aio_writev(BlockBackend *blk, int64_t sector_num,
- QEMUIOVector *iov, int nb_sectors,
- BlockCompletionFunc *cb, void *opaque);
BlockAIOCB *blk_aio_pwritev(BlockBackend *blk, int64_t offset,
QEMUIOVector *qiov, BdrvRequestFlags flags,
BlockCompletionFunc *cb, void *opaque);
diff --git a/block/block-backend.c b/block/block-backend.c
index 6ac76d0..a1e2c7f 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -772,24 +772,6 @@ static int blk_prw(BlockBackend *blk, int64_t offset,
uint8_t *buf,
return rwco.ret;
}
-static int blk_rw(BlockBackend *blk, int64_t sector_num, uint8_t *buf,
- int nb_sectors, CoroutineEntry co_entry,
- BdrvRequestFlags flags)
-{
- if (nb_sectors < 0 || nb_sectors > BDRV_REQUEST_MAX_SECTORS) {
- return -EINVAL;
- }
-
- return blk_prw(blk, sector_num << BDRV_SECTOR_BITS, buf,
- nb_sectors << BDRV_SECTOR_BITS, co_entry, flags);
-}
-
-int blk_read(BlockBackend *blk, int64_t sector_num, uint8_t *buf,
- int nb_sectors)
-{
- return blk_rw(blk, sector_num, buf, nb_sectors, blk_read_entry, 0);
-}
-
int blk_pread_unthrottled(BlockBackend *blk, int64_t offset, uint8_t *buf,
int count)
{
@@ -807,13 +789,6 @@ int blk_pread_unthrottled(BlockBackend *blk, int64_t
offset, uint8_t *buf,
return ret;
}
-int blk_write(BlockBackend *blk, int64_t sector_num, const uint8_t *buf,
- int nb_sectors)
-{
- return blk_rw(blk, sector_num, (uint8_t*) buf, nb_sectors,
- blk_write_entry, 0);
-}
-
int blk_write_zeroes(BlockBackend *blk, int64_t offset,
int count, BdrvRequestFlags flags)
{
@@ -985,19 +960,6 @@ int64_t blk_nb_sectors(BlockBackend *blk)
return bdrv_nb_sectors(blk_bs(blk));
}
-BlockAIOCB *blk_aio_readv(BlockBackend *blk, int64_t sector_num,
- QEMUIOVector *iov, int nb_sectors,
- BlockCompletionFunc *cb, void *opaque)
-{
- if (nb_sectors < 0 || nb_sectors > BDRV_REQUEST_MAX_SECTORS) {
- return blk_abort_aio_request(blk, cb, opaque, -EINVAL);
- }
-
- assert(nb_sectors << BDRV_SECTOR_BITS == iov->size);
- return blk_aio_prwv(blk, sector_num << BDRV_SECTOR_BITS, iov->size, iov,
- blk_aio_read_entry, 0, cb, opaque);
-}
-
BlockAIOCB *blk_aio_preadv(BlockBackend *blk, int64_t offset,
QEMUIOVector *qiov, BdrvRequestFlags flags,
BlockCompletionFunc *cb, void *opaque)
@@ -1006,19 +968,6 @@ BlockAIOCB *blk_aio_preadv(BlockBackend *blk, int64_t
offset,
blk_aio_read_entry, flags, cb, opaque);
}
-BlockAIOCB *blk_aio_writev(BlockBackend *blk, int64_t sector_num,
- QEMUIOVector *iov, int nb_sectors,
- BlockCompletionFunc *cb, void *opaque)
-{
- if (nb_sectors < 0 || nb_sectors > BDRV_REQUEST_MAX_SECTORS) {
- return blk_abort_aio_request(blk, cb, opaque, -EINVAL);
- }
-
- assert(nb_sectors << BDRV_SECTOR_BITS == iov->size);
- return blk_aio_prwv(blk, sector_num << BDRV_SECTOR_BITS, iov->size, iov,
- blk_aio_write_entry, 0, cb, opaque);
-}
-
BlockAIOCB *blk_aio_pwritev(BlockBackend *blk, int64_t offset,
QEMUIOVector *qiov, BdrvRequestFlags flags,
BlockCompletionFunc *cb, void *opaque)
--
2.5.5
- Re: [Qemu-block] [PATCH v7 06/19] scsi-disk: Switch to byte-based aio block access, (continued)
- [Qemu-block] [PATCH v7 07/19] virtio: Switch to byte-based aio block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 09/19] fdc: Switch to byte-based block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 11/19] onenand: Switch to byte-based block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 15/19] atapi: Switch to byte-based block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 16/19] nbd: Switch to byte-based block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 17/19] qemu-img: Switch to byte-based block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 18/19] qemu-io: Switch to byte-based block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 19/19] block: Kill unused sector-based blk_* functions,
Eric Blake <=
- [Qemu-block] [PATCH v7 02/19] block: Switch blk_read_unthrottled() to byte interface, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 05/19] ide: Switch to byte-based aio block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 08/19] xen_disk: Switch to byte-based aio block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 13/19] sd: Switch to byte-based block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 12/19] pflash: Switch to byte-based block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 14/19] m25p80: Switch to byte-based block access, Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 01/19] block: Allow BDRV_REQ_FUA through blk_pwrite(), Eric Blake, 2016/05/06
- [Qemu-block] [PATCH v7 10/19] nand: Switch to byte-based block access, Eric Blake, 2016/05/06
- Re: [Qemu-block] [PATCH v7 00/19] block: kill sector-based blk_write/read, Kevin Wolf, 2016/05/10
- Re: [Qemu-block] [PATCH v7 00/19] block: kill sector-based blk_write/read, Kevin Wolf, 2016/05/10