[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/36] block: Drop bdrv_is_first_non_filter()
From: |
Kevin Wolf |
Subject: |
[PULL 20/36] block: Drop bdrv_is_first_non_filter() |
Date: |
Tue, 18 Feb 2020 15:07:06 +0100 |
From: Max Reitz <address@hidden>
It is unused now. (And it was ugly because it needed to explore all BDS
chains from the top.)
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
include/block/block.h | 1 -
block.c | 26 --------------------------
2 files changed, 27 deletions(-)
diff --git a/include/block/block.h b/include/block/block.h
index 6cd566324d..6a8462a5bc 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -394,7 +394,6 @@ int bdrv_amend_options(BlockDriverState *bs_new, QemuOpts
*opts,
/* external snapshots */
bool bdrv_recurse_is_first_non_filter(BlockDriverState *bs,
BlockDriverState *candidate);
-bool bdrv_is_first_non_filter(BlockDriverState *candidate);
/* check if a named node can be replaced when doing drive-mirror */
BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs,
diff --git a/block.c b/block.c
index 9db0b973fe..145d0baf5e 100644
--- a/block.c
+++ b/block.c
@@ -6234,32 +6234,6 @@ bool bdrv_recurse_is_first_non_filter(BlockDriverState
*bs,
return false;
}
-/* This function checks if the candidate is the first non filter bs down it's
- * bs chain. Since we don't have pointers to parents it explore all bs chains
- * from the top. Some filters can choose not to pass down the recursion.
- */
-bool bdrv_is_first_non_filter(BlockDriverState *candidate)
-{
- BlockDriverState *bs;
- BdrvNextIterator it;
-
- /* walk down the bs forest recursively */
- for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
- bool perm;
-
- /* try to recurse in this top level bs */
- perm = bdrv_recurse_is_first_non_filter(bs, candidate);
-
- /* candidate is the first non filter */
- if (perm) {
- bdrv_next_cleanup(&it);
- return true;
- }
- }
-
- return false;
-}
-
BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs,
const char *node_name, Error **errp)
{
--
2.20.1
- [PULL 16/36] block: Remove superfluous semicolons, (continued)
- [PULL 16/36] block: Remove superfluous semicolons, Kevin Wolf, 2020/02/18
- [PULL 17/36] block/io_uring: Remove superfluous semicolon, Kevin Wolf, 2020/02/18
- [PULL 13/36] commit: Fix is_read for block_job_error_action(), Kevin Wolf, 2020/02/18
- [PULL 19/36] blockdev: Allow resizing everywhere, Kevin Wolf, 2020/02/18
- [PULL 18/36] blockdev: Allow external snapshots everywhere, Kevin Wolf, 2020/02/18
- [PULL 21/36] iotests: Let 041 use -blockdev for quorum children, Kevin Wolf, 2020/02/18
- [PULL 15/36] iotests: Test error handling policies with block-commit, Kevin Wolf, 2020/02/18
- [PULL 22/36] quorum: Fix child permissions, Kevin Wolf, 2020/02/18
- [PULL 23/36] block: Add bdrv_recurse_can_replace(), Kevin Wolf, 2020/02/18
- [PULL 24/36] blkverify: Implement .bdrv_recurse_can_replace(), Kevin Wolf, 2020/02/18
- [PULL 20/36] block: Drop bdrv_is_first_non_filter(),
Kevin Wolf <=
- [PULL 25/36] quorum: Implement .bdrv_recurse_can_replace(), Kevin Wolf, 2020/02/18
- [PULL 27/36] block: Remove bdrv_recurse_is_first_non_filter(), Kevin Wolf, 2020/02/18
- [PULL 26/36] block: Use bdrv_recurse_can_replace(), Kevin Wolf, 2020/02/18
- [PULL 28/36] mirror: Double-check immediately before replacing, Kevin Wolf, 2020/02/18
- [PULL 29/36] quorum: Stop marking it as a filter, Kevin Wolf, 2020/02/18
- [PULL 31/36] iotests: Add VM.assert_block_path(), Kevin Wolf, 2020/02/18
- [PULL 30/36] iotests: Use complete_and_wait() in 155, Kevin Wolf, 2020/02/18
- [PULL 33/36] iotests: Resolve TODOs in 041, Kevin Wolf, 2020/02/18
- [PULL 32/36] iotests/041: Drop superfluous shutdowns, Kevin Wolf, 2020/02/18
- [PULL 34/36] iotests: Use self.image_len in TestRepairQuorum, Kevin Wolf, 2020/02/18