[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 37/45] block: make round_to_clusters public
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH v2 37/45] block: make round_to_clusters public |
Date: |
Wed, 26 Sep 2012 17:56:43 +0200 |
This is needed in the following patch.
Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
block.c | 16 ++++++++--------
block.h | 4 ++++
2 file modificati, 12 inserzioni(+), 8 rimozioni(-)
diff --git a/block.c b/block.c
index af4237b..16da2a9 100644
--- a/block.c
+++ b/block.c
@@ -1653,10 +1653,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;
@@ -1698,8 +1698,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;
@@ -2022,8 +2022,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/block.h b/block.h
index 676135d..e586d67 100644
--- a/block.h
+++ b/block.h
@@ -303,6 +303,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.12
- [Qemu-devel] [PATCH v2 18/45] qemu-iotests: add tests for streaming error handling, (continued)
- [Qemu-devel] [PATCH v2 18/45] qemu-iotests: add tests for streaming error handling, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 22/45] block: introduce new dirty bitmap functionality, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 23/45] block: export dirty bitmap information in query-block, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 26/45] mirror: introduce mirror job, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 24/45] block: add block-job-complete, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 27/45] qmp: add drive-mirror command, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 32/45] qmp: add pull_event function, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 36/45] block: implement dirty bitmap using HBitmap, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 37/45] block: make round_to_clusters public,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v2 39/45] block: return count of dirty sectors, not chunks, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 38/45] mirror: perform COW if the cluster size is bigger than the granularity, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 41/45] mirror: allow customizing the granularity, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 43/45] mirror: add buf-size argument to drive-mirror, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 42/45] mirror: switch mirror_iteration to AIO, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 44/45] mirror: support more than one in-flight AIO operation, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 35/45] add hierarchical bitmap data type and test cases, Paolo Bonzini, 2012/09/26
- [Qemu-devel] [PATCH v2 34/45] host-utils: add ffsl, Paolo Bonzini, 2012/09/26