[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 42/51] block: Make bdrv_filter_default_perms() static
From: |
Kevin Wolf |
Subject: |
[PULL 42/51] block: Make bdrv_filter_default_perms() static |
Date: |
Fri, 15 May 2020 14:45:12 +0200 |
From: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
include/block/block_int.h | 10 ----------
block.c | 17 +++++++++++------
2 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 0781d43af5..6fc5f0d333 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -1262,16 +1262,6 @@ int bdrv_child_try_set_perm(BdrvChild *c, uint64_t perm,
uint64_t shared,
*/
int bdrv_child_refresh_perms(BlockDriverState *bs, BdrvChild *c, Error **errp);
-/* Default implementation for BlockDriver.bdrv_child_perm() that can be used by
- * block filters: Forward CONSISTENT_READ, WRITE, WRITE_UNCHANGED and RESIZE to
- * all children */
-void bdrv_filter_default_perms(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
- BdrvChildRole child_role,
- BlockReopenQueue *reopen_queue,
- uint64_t perm, uint64_t shared,
- uint64_t *nperm, uint64_t *nshared);
-
/* Default implementation for BlockDriver.bdrv_child_perm() that can be used by
* (non-raw) image formats: Like above for bs->backing, but for bs->file it
* requires WRITE | RESIZE for read-write images, always requires
diff --git a/block.c b/block.c
index fb94adcca4..54bc1c3b2d 100644
--- a/block.c
+++ b/block.c
@@ -2382,12 +2382,17 @@ int bdrv_child_refresh_perms(BlockDriverState *bs,
BdrvChild *c, Error **errp)
return bdrv_child_try_set_perm(c, perms, shared, errp);
}
-void bdrv_filter_default_perms(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
- BdrvChildRole role,
- BlockReopenQueue *reopen_queue,
- uint64_t perm, uint64_t shared,
- uint64_t *nperm, uint64_t *nshared)
+/*
+ * Default implementation for .bdrv_child_perm() for block filters:
+ * Forward CONSISTENT_READ, WRITE, WRITE_UNCHANGED, and RESIZE to the
+ * filtered child.
+ */
+static void bdrv_filter_default_perms(BlockDriverState *bs, BdrvChild *c,
+ const BdrvChildClass *child_class,
+ BdrvChildRole role,
+ BlockReopenQueue *reopen_queue,
+ uint64_t perm, uint64_t shared,
+ uint64_t *nperm, uint64_t *nshared)
{
*nperm = perm & DEFAULT_PERM_PASSTHROUGH;
*nshared = (shared & DEFAULT_PERM_PASSTHROUGH) | DEFAULT_PERM_UNCHANGED;
--
2.25.4
- [PULL 33/51] block: Switch child_format users to child_of_bds, (continued)
- [PULL 33/51] block: Switch child_format users to child_of_bds, Kevin Wolf, 2020/05/15
- [PULL 37/51] block: Make format drivers use child_of_bds, Kevin Wolf, 2020/05/15
- [PULL 35/51] block: Make backing files child_of_bds children, Kevin Wolf, 2020/05/15
- [PULL 36/51] block: Drop child_backing, Kevin Wolf, 2020/05/15
- [PULL 38/51] block: Make filter drivers use child_of_bds, Kevin Wolf, 2020/05/15
- [PULL 39/51] block: Use child_of_bds in remaining places, Kevin Wolf, 2020/05/15
- [PULL 40/51] tests: Use child_of_bds instead of child_file, Kevin Wolf, 2020/05/15
- [PULL 41/51] block: Use bdrv_default_perms(), Kevin Wolf, 2020/05/15
- [PULL 43/51] block: Drop bdrv_format_default_perms(), Kevin Wolf, 2020/05/15
- [PULL 46/51] block: Drop @child_class from bdrv_child_perm(), Kevin Wolf, 2020/05/15
- [PULL 42/51] block: Make bdrv_filter_default_perms() static,
Kevin Wolf <=
- [PULL 44/51] block: Drop child_file, Kevin Wolf, 2020/05/15
- [PULL 45/51] block: Pass BdrvChildRole in remaining cases, Kevin Wolf, 2020/05/15
- [PULL 47/51] block/block-copy: Fix uninitialized variable in block_copy_task_entry, Kevin Wolf, 2020/05/15
- [PULL 49/51] iotests: log messages from notrun(), Kevin Wolf, 2020/05/15
- [PULL 50/51] hw/ide/ahci: Log lost IRQs, Kevin Wolf, 2020/05/15
- [PULL 51/51] iotests/030: Reduce run time by unthrottling job earlier, Kevin Wolf, 2020/05/15
- [PULL 48/51] block/block-copy: Simplify block_copy_do_copy(), Kevin Wolf, 2020/05/15
- Re: [PULL 00/51] Block layer patches, Peter Maydell, 2020/05/15
- Re: [PULL 00/51] Block layer patches, no-reply, 2020/05/15