[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/31] block: Drop unused bdrv_round_sectors_to_
From: |
John Snow |
Subject: |
Re: [Qemu-devel] [PATCH 01/31] block: Drop unused bdrv_round_sectors_to_clusters() |
Date: |
Wed, 26 Apr 2017 17:41:22 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 |
On 04/17/2017 09:33 PM, Eric Blake wrote:
> Now that the last user [mirror_iteration()] has converted to using
> bytes, we no longer need a function to round sectors to clusters.
>
> Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
> ---
> include/block/block.h | 4 ----
> block/io.c | 21 ---------------------
> 2 files changed, 25 deletions(-)
>
> diff --git a/include/block/block.h b/include/block/block.h
> index 740cb86..86ad511 100644
> --- a/include/block/block.h
> +++ b/include/block/block.h
> @@ -467,10 +467,6 @@ const char *bdrv_get_device_or_node_name(const
> BlockDriverState *bs);
> int bdrv_get_flags(BlockDriverState *bs);
> int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
> ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs);
> -void bdrv_round_sectors_to_clusters(BlockDriverState *bs,
> - int64_t sector_num, int nb_sectors,
> - int64_t *cluster_sector_num,
> - int *cluster_nb_sectors);
> void bdrv_round_to_clusters(BlockDriverState *bs,
> int64_t offset, unsigned int bytes,
> int64_t *cluster_offset,
> diff --git a/block/io.c b/block/io.c
> index d22d35f..d61a906 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -419,27 +419,6 @@ static void mark_request_serialising(BdrvTrackedRequest
> *req, uint64_t align)
> }
>
> /**
> - * Round a region to cluster boundaries (sector-based)
> - */
> -void bdrv_round_sectors_to_clusters(BlockDriverState *bs,
> - int64_t sector_num, int nb_sectors,
> - int64_t *cluster_sector_num,
> - int *cluster_nb_sectors)
> -{
> - BlockDriverInfo bdi;
> -
> - if (bdrv_get_info(bs, &bdi) < 0 || bdi.cluster_size == 0) {
> - *cluster_sector_num = sector_num;
> - *cluster_nb_sectors = nb_sectors;
> - } else {
> - int64_t c = bdi.cluster_size / BDRV_SECTOR_SIZE;
> - *cluster_sector_num = QEMU_ALIGN_DOWN(sector_num, c);
> - *cluster_nb_sectors = QEMU_ALIGN_UP(sector_num - *cluster_sector_num
> +
> - nb_sectors, c);
> - }
> -}
> -
> -/**
> * Round a region to cluster boundaries
> */
> void bdrv_round_to_clusters(BlockDriverState *bs,
>
--
—js
- [Qemu-devel] [PATCH 00/31] make bdrv_get_block_status byte-based, Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 03/31] qcow2: Switch is_zero_sectors() to byte-based, Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 04/31] block: Switch bdrv_make_zero() to byte-based, Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 05/31] qemu-img: Switch get_block_status() to byte-based, Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 06/31] block: Convert bdrv_get_block_status() to bytes, Eric Blake, 2017/04/17
- [Qemu-devel] [PATCH 07/31] block: Switch bdrv_co_get_block_status() to byte-based, Eric Blake, 2017/04/17