Skip to content

Commit

Permalink
block: Make bdrv_filter_default_perms() static
Browse files Browse the repository at this point in the history
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200513110544.176672-31-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
XanClic authored and kevmw committed May 18, 2020
1 parent 69dca43 commit 87278af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
17 changes: 11 additions & 6 deletions block.c
Expand Up @@ -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;
Expand Down
10 changes: 0 additions & 10 deletions include/block/block_int.h
Expand Up @@ -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
Expand Down

0 comments on commit 87278af

Please sign in to comment.