aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2020-05-13 13:05:44 +0200
committerKevin Wolf <kwolf@redhat.com>2020-05-18 19:05:25 +0200
commite5d8a4068526d3fb692e3402485edd03bc11c084 (patch)
treee1ec36109c0c771cae4e98be562724b7e1be21c3 /block
parent1f38f04eacd4c3b9409dcb411525f203cce168a1 (diff)
block: Drop @child_class from bdrv_child_perm()
Implementations should decide the necessary permissions based on @role. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200513110544.176672-35-mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/backup-top.c3
-rw-r--r--block/blkdebug.c3
-rw-r--r--block/blklogwrites.c3
-rw-r--r--block/commit.c1
-rw-r--r--block/copy-on-read.c1
-rw-r--r--block/mirror.c1
-rw-r--r--block/quorum.c1
-rw-r--r--block/replication.c1
-rw-r--r--block/vvfat.c4
9 files changed, 4 insertions, 14 deletions
diff --git a/block/backup-top.c b/block/backup-top.c
index f0efec18b5..af2f20f346 100644
--- a/block/backup-top.c
+++ b/block/backup-top.c
@@ -122,7 +122,6 @@ static void backup_top_refresh_filename(BlockDriverState *bs)
}
static void backup_top_child_perm(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
BdrvChildRole role,
BlockReopenQueue *reopen_queue,
uint64_t perm, uint64_t shared,
@@ -156,7 +155,7 @@ static void backup_top_child_perm(BlockDriverState *bs, BdrvChild *c,
*nperm = BLK_PERM_WRITE;
} else {
/* Source child */
- bdrv_default_perms(bs, c, child_class, role, reopen_queue,
+ bdrv_default_perms(bs, c, role, reopen_queue,
perm, shared, nperm, nshared);
if (perm & BLK_PERM_WRITE) {
diff --git a/block/blkdebug.c b/block/blkdebug.c
index a925d8295e..7194bc7f06 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -995,7 +995,6 @@ static int blkdebug_reopen_prepare(BDRVReopenState *reopen_state,
}
static void blkdebug_child_perm(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
BdrvChildRole role,
BlockReopenQueue *reopen_queue,
uint64_t perm, uint64_t shared,
@@ -1003,7 +1002,7 @@ static void blkdebug_child_perm(BlockDriverState *bs, BdrvChild *c,
{
BDRVBlkdebugState *s = bs->opaque;
- bdrv_default_perms(bs, c, child_class, role, reopen_queue,
+ bdrv_default_perms(bs, c, role, reopen_queue,
perm, shared, nperm, nshared);
*nperm |= s->take_child_perms;
diff --git a/block/blklogwrites.c b/block/blklogwrites.c
index 8684fb1c74..6753bd9a3e 100644
--- a/block/blklogwrites.c
+++ b/block/blklogwrites.c
@@ -283,7 +283,6 @@ static int64_t blk_log_writes_getlength(BlockDriverState *bs)
}
static void blk_log_writes_child_perm(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
BdrvChildRole role,
BlockReopenQueue *ro_q,
uint64_t perm, uint64_t shrd,
@@ -295,7 +294,7 @@ static void blk_log_writes_child_perm(BlockDriverState *bs, BdrvChild *c,
return;
}
- bdrv_default_perms(bs, c, child_class, role, ro_q, perm, shrd,
+ bdrv_default_perms(bs, c, role, ro_q, perm, shrd,
nperm, nshrd);
}
diff --git a/block/commit.c b/block/commit.c
index 6af1c808bc..7732d02dfe 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -223,7 +223,6 @@ static void bdrv_commit_top_refresh_filename(BlockDriverState *bs)
}
static void bdrv_commit_top_child_perm(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
BdrvChildRole role,
BlockReopenQueue *reopen_queue,
uint64_t perm, uint64_t shared,
diff --git a/block/copy-on-read.c b/block/copy-on-read.c
index c857ea0da7..a6e3c74a68 100644
--- a/block/copy-on-read.c
+++ b/block/copy-on-read.c
@@ -52,7 +52,6 @@ static int cor_open(BlockDriverState *bs, QDict *options, int flags,
#define PERM_UNCHANGED (BLK_PERM_ALL & ~PERM_PASSTHROUGH)
static void cor_child_perm(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
BdrvChildRole role,
BlockReopenQueue *reopen_queue,
uint64_t perm, uint64_t shared,
diff --git a/block/mirror.c b/block/mirror.c
index cb4bdad32a..e8e8844afc 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1492,7 +1492,6 @@ static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs)
}
static void bdrv_mirror_top_child_perm(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
BdrvChildRole role,
BlockReopenQueue *reopen_queue,
uint64_t perm, uint64_t shared,
diff --git a/block/quorum.c b/block/quorum.c
index 616ac3a927..7cf7ab1546 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -1153,7 +1153,6 @@ static char *quorum_dirname(BlockDriverState *bs, Error **errp)
}
static void quorum_child_perm(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
BdrvChildRole role,
BlockReopenQueue *reopen_queue,
uint64_t perm, uint64_t shared,
diff --git a/block/replication.c b/block/replication.c
index cc9c473ad1..ccf7b78160 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -164,7 +164,6 @@ static void replication_close(BlockDriverState *bs)
}
static void replication_child_perm(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
BdrvChildRole role,
BlockReopenQueue *reopen_queue,
uint64_t perm, uint64_t shared,
diff --git a/block/vvfat.c b/block/vvfat.c
index 089abe1e29..c65a98e3ee 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -3213,7 +3213,6 @@ err:
}
static void vvfat_child_perm(BlockDriverState *bs, BdrvChild *c,
- const BdrvChildClass *child_class,
BdrvChildRole role,
BlockReopenQueue *reopen_queue,
uint64_t perm, uint64_t shared,
@@ -3221,8 +3220,7 @@ static void vvfat_child_perm(BlockDriverState *bs, BdrvChild *c,
{
BDRVVVFATState *s = bs->opaque;
- assert(c == s->qcow ||
- (child_class == &child_of_bds && (role & BDRV_CHILD_COW)));
+ assert(c == s->qcow || (role & BDRV_CHILD_COW));
if (c == s->qcow) {
/* This is a private node, nobody should try to attach to it */