[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/4] block: complete public block status API
From: |
Paolo Bonzini |
Subject: |
[PATCH 2/4] block: complete public block status API |
Date: |
Wed, 5 Apr 2023 12:32:14 +0200 |
Include both coroutine and non-coroutine versions, the latter being
co_wrapper_mixed_bdrv_rdlock of the former.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/io.c | 18 +++++-------------
include/block/block-io.h | 18 ++++++++++++------
2 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/block/io.c b/block/io.c
index e86090b7692b..0aad0f57d8c7 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2570,21 +2570,13 @@ int coroutine_fn
bdrv_co_block_status_above(BlockDriverState *bs,
bytes, pnum, map, file, NULL);
}
-int bdrv_block_status_above(BlockDriverState *bs, BlockDriverState *base,
- int64_t offset, int64_t bytes, int64_t *pnum,
- int64_t *map, BlockDriverState **file)
+int coroutine_fn bdrv_co_block_status(BlockDriverState *bs, int64_t offset,
+ int64_t bytes, int64_t *pnum,
+ int64_t *map, BlockDriverState **file)
{
IO_CODE();
- return bdrv_common_block_status_above(bs, base, false, true, offset, bytes,
- pnum, map, file, NULL);
-}
-
-int bdrv_block_status(BlockDriverState *bs, int64_t offset, int64_t bytes,
- int64_t *pnum, int64_t *map, BlockDriverState **file)
-{
- IO_CODE();
- return bdrv_block_status_above(bs, bdrv_filter_or_cow_bs(bs),
- offset, bytes, pnum, map, file);
+ return bdrv_co_block_status_above(bs, bdrv_filter_or_cow_bs(bs),
+ offset, bytes, pnum, map, file);
}
/*
diff --git a/include/block/block-io.h b/include/block/block-io.h
index 5da99d4d60ff..0947f83d9ac7 100644
--- a/include/block/block-io.h
+++ b/include/block/block-io.h
@@ -113,17 +113,23 @@ int coroutine_fn GRAPH_RDLOCK bdrv_co_pdiscard(BdrvChild
*child, int64_t offset,
int64_t bytes);
bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs);
-int bdrv_block_status(BlockDriverState *bs, int64_t offset,
- int64_t bytes, int64_t *pnum, int64_t *map,
- BlockDriverState **file);
+
+int coroutine_fn GRAPH_RDLOCK
+bdrv_co_block_status(BlockDriverState *bs, int64_t offset,
+ int64_t bytes, int64_t *pnum,
+ int64_t *map, BlockDriverState **file);
+int co_wrapper_mixed_bdrv_rdlock bdrv_block_status(BlockDriverState *bs,
int64_t offset,
+ int64_t bytes, int64_t
*pnum,
+ int64_t *map,
BlockDriverState **file);
int coroutine_fn GRAPH_RDLOCK
bdrv_co_block_status_above(BlockDriverState *bs, BlockDriverState *base,
int64_t offset, int64_t bytes, int64_t *pnum,
int64_t *map, BlockDriverState **file);
-int bdrv_block_status_above(BlockDriverState *bs, BlockDriverState *base,
- int64_t offset, int64_t bytes, int64_t *pnum,
- int64_t *map, BlockDriverState **file);
+int co_wrapper_mixed_bdrv_rdlock
+bdrv_block_status_above(BlockDriverState *bs, BlockDriverState *base,
+ int64_t offset, int64_t bytes, int64_t *pnum,
+ int64_t *map, BlockDriverState **file);
int coroutine_fn GRAPH_RDLOCK
bdrv_co_is_allocated(BlockDriverState *bs, int64_t offset, int64_t bytes,
--
2.39.2
- [PATCH 0/4] block: clean up coroutine versions of bdrv_{is_allocated, block_status}*, Paolo Bonzini, 2023/04/05
- [PATCH 1/4] block: rename the bdrv_co_block_status static function, Paolo Bonzini, 2023/04/05
- [PATCH 2/4] block: complete public block status API,
Paolo Bonzini <=
- [PATCH 3/4] block: switch to co_wrapper for bdrv_is_allocated_*, Paolo Bonzini, 2023/04/05
- [PATCH 4/4] block: convert more bdrv_is_allocated* and bdrv_block_status* calls to coroutine versions, Paolo Bonzini, 2023/04/05
- Re: [PATCH 0/4] block: clean up coroutine versions of bdrv_{is_allocated, block_status}*, Paolo Bonzini, 2023/04/21