From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axcUI-0007ZP-MV for qemu-devel@nongnu.org; Tue, 03 May 2016 11:43:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axcU6-0006wt-MF for qemu-devel@nongnu.org; Tue, 03 May 2016 11:43:45 -0400 From: Eric Blake Date: Tue, 3 May 2016 09:42:46 -0600 Message-Id: <1462290166-32584-15-git-send-email-eblake@redhat.com> In-Reply-To: <1462290166-32584-1-git-send-email-eblake@redhat.com> References: <1462290166-32584-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v5 14/14] block: Kill blk_write(), blk_read() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, Max Reitz Now that there are no remaining clients, we can drop these functions, to ensure that all future users get the byte-based interfaces. Sadly, there are still remaining sector-based interfaces, such as blk_aio_writev; those will have to wait for another day. Signed-off-by: Eric Blake --- include/sysemu/block-backend.h | 4 ---- block/block-backend.c | 25 ------------------------- 2 files changed, 29 deletions(-) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 681431b..a63af97 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_pwrite_zeroes(BlockBackend *blk, int64_t offset, int count, BdrvRequestFlags flags); BlockAIOCB *blk_aio_write_zeroes(BlockBackend *blk, int64_t sector_num, diff --git a/block/block-backend.c b/block/block-backend.c index 71133b2..e6ded54 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_pwrite_zeroes(BlockBackend *blk, int64_t offset, int count, BdrvRequestFlags flags) { -- 2.5.5