Skip to content

Commit

Permalink
block: Inline bdrv_set_backing_noperm()
Browse files Browse the repository at this point in the history
It's only a single line and has a single caller. Inlining makes things
a bit easier to follow.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20231027155333.420094-15-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
kevmw committed Nov 7, 2023
1 parent d0f9fd9 commit 3204c2e
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -3532,19 +3532,7 @@ bdrv_set_file_or_backing_noperm(BlockDriverState *parent_bs,
*
* If a backing child is already present (i.e. we're detaching a node), that
* child node must be drained.
*
* After calling this function, the transaction @tran may only be completed
* while holding a writer lock for the graph.
*/
static int GRAPH_WRLOCK
bdrv_set_backing_noperm(BlockDriverState *bs,
BlockDriverState *backing_hd,
Transaction *tran, Error **errp)
{
GLOBAL_STATE_CODE();
return bdrv_set_file_or_backing_noperm(bs, backing_hd, true, tran, errp);
}

int bdrv_set_backing_hd_drained(BlockDriverState *bs,
BlockDriverState *backing_hd,
Error **errp)
Expand All @@ -3558,7 +3546,7 @@ int bdrv_set_backing_hd_drained(BlockDriverState *bs,
assert(bs->backing->bs->quiesce_counter > 0);
}

ret = bdrv_set_backing_noperm(bs, backing_hd, tran, errp);
ret = bdrv_set_file_or_backing_noperm(bs, backing_hd, true, tran, errp);
if (ret < 0) {
goto out;
}
Expand Down

0 comments on commit 3204c2e

Please sign in to comment.