[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/24] block: make round_to_clusters public
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 04/24] block: make round_to_clusters public |
Date: |
Fri, 25 Jan 2013 19:45:40 +0100 |
From: Paolo Bonzini <address@hidden>
This is needed in the following patch.
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 16 ++++++++--------
include/block/block.h | 4 ++++
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/block.c b/block.c
index e0ff736..4a4ab16 100644
--- a/block.c
+++ b/block.c
@@ -1673,10 +1673,10 @@ static void tracked_request_begin(BdrvTrackedRequest
*req,
/**
* Round a region to cluster boundaries
*/
-static void round_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 sector_num, int nb_sectors,
+ int64_t *cluster_sector_num,
+ int *cluster_nb_sectors)
{
BlockDriverInfo bdi;
@@ -1718,8 +1718,8 @@ static void coroutine_fn
wait_for_overlapping_requests(BlockDriverState *bs,
* CoR read and write operations are atomic and guest writes cannot
* interleave between them.
*/
- round_to_clusters(bs, sector_num, nb_sectors,
- &cluster_sector_num, &cluster_nb_sectors);
+ bdrv_round_to_clusters(bs, sector_num, nb_sectors,
+ &cluster_sector_num, &cluster_nb_sectors);
do {
retry = false;
@@ -2185,8 +2185,8 @@ static int coroutine_fn
bdrv_co_do_copy_on_readv(BlockDriverState *bs,
/* Cover entire cluster so no additional backing file I/O is required when
* allocating cluster in the image file.
*/
- round_to_clusters(bs, sector_num, nb_sectors,
- &cluster_sector_num, &cluster_nb_sectors);
+ bdrv_round_to_clusters(bs, sector_num, nb_sectors,
+ &cluster_sector_num, &cluster_nb_sectors);
trace_bdrv_co_do_copy_on_readv(bs, sector_num, nb_sectors,
cluster_sector_num, cluster_nb_sectors);
diff --git a/include/block/block.h b/include/block/block.h
index 678fc60..9ee9068 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -309,6 +309,10 @@ int bdrv_get_flags(BlockDriverState *bs);
int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors);
int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
+void bdrv_round_to_clusters(BlockDriverState *bs,
+ int64_t sector_num, int nb_sectors,
+ int64_t *cluster_sector_num,
+ int *cluster_nb_sectors);
const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
void bdrv_get_backing_filename(BlockDriverState *bs,
--
1.7.6.5
- [Qemu-devel] [PULL 00/24] Block patches, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 01/24] host-utils: add ffsl, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 03/24] block: implement dirty bitmap using HBitmap, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 02/24] add hierarchical bitmap data type and test cases, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 05/24] mirror: perform COW if the cluster size is bigger than the granularity, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 04/24] block: make round_to_clusters public,
Kevin Wolf <=
- [Qemu-devel] [PATCH 07/24] block: allow customizing the granularity of the dirty bitmap, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 06/24] block: return count of dirty sectors, not chunks, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 09/24] mirror: switch mirror_iteration to AIO, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 08/24] mirror: allow customizing the granularity, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 10/24] mirror: add buf-size argument to drive-mirror, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 11/24] mirror: support more than one in-flight AIO operation, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 13/24] block: Add special error code for wrong format, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 12/24] mirror: support arbitrarily-sized iterations, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 14/24] block: Use error code EMEDIUMTYPE for wrong format in some block drivers, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 18/24] mirror: do nothing on zero-sized disk, Kevin Wolf, 2013/01/25