[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 033/100] block: Drop unused bdrv_round_sectors_to_clu
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 033/100] block: Drop unused bdrv_round_sectors_to_clusters() |
Date: |
Fri, 7 Jul 2017 19:07:48 +0200 |
From: Eric Blake <address@hidden>
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>
Reviewed-by: Jeff Cody <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/io.c | 21 ---------------------
include/block/block.h | 4 ----
2 files changed, 25 deletions(-)
diff --git a/block/io.c b/block/io.c
index 5c146b5..a0a36df 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,
diff --git a/include/block/block.h b/include/block/block.h
index afe1b61..121f42b 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -475,10 +475,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,
--
1.8.3.1
- [Qemu-block] [PULL 023/100] stream: Drop reached_end for stream_complete(), (continued)
- [Qemu-block] [PULL 023/100] stream: Drop reached_end for stream_complete(), Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 024/100] stream: Switch stream_run() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 025/100] commit: Switch commit_populate() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 028/100] mirror: Switch mirror_do_zero_or_discard() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 026/100] commit: Switch commit_run() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 029/100] mirror: Update signature of mirror_clip_sectors(), Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 027/100] mirror: Switch MirrorBlockJob to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 030/100] mirror: Switch mirror_cow_align() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 031/100] mirror: Switch mirror_do_read() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 032/100] mirror: Switch mirror_iteration() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 033/100] block: Drop unused bdrv_round_sectors_to_clusters(),
Kevin Wolf <=
- [Qemu-block] [PULL 034/100] backup: Switch BackupBlockJob to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 037/100] backup: Switch backup_run() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 035/100] backup: Switch block_backup.h to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 036/100] backup: Switch backup_do_cow() to byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 039/100] block: Minimize raw use of bds->total_sectors, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 040/100] block: Make bdrv_is_allocated_above() byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 038/100] block: Make bdrv_is_allocated() byte-based, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 044/100] qcow: require image size to be > 1 for new images, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 042/100] block: add ability to set a prefix for opt names, Kevin Wolf, 2017/07/07
- [Qemu-block] [PULL 043/100] qcow: document another weakness of qcow AES encryption, Kevin Wolf, 2017/07/07