summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Wolf2017-05-04 18:52:41 +0200
committerKevin Wolf2017-05-11 12:08:24 +0200
commit22d5cd82e98b61b1dbd791fab9f4ae0f77c0ed14 (patch)
treeae50fa8d281322729c448797d0195c51f3d208cc
parentblock: Fix write/resize permissions for inactive images (diff)
downloadqemu-22d5cd82e98b61b1dbd791fab9f4ae0f77c0ed14.tar.gz
qemu-22d5cd82e98b61b1dbd791fab9f4ae0f77c0ed14.tar.xz
qemu-22d5cd82e98b61b1dbd791fab9f4ae0f77c0ed14.zip
file-posix: Remove .bdrv_inactivate/invalidate_cache
Now that the block layer takes care to request a lot less permissions for inactive nodes, the special-casing in file-posix isn't necessary any more. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
-rw-r--r--block/file-posix.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/block/file-posix.c b/block/file-posix.c
index a09055b700..4354d49642 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2190,35 +2190,6 @@ static void raw_abort_perm_update(BlockDriverState *bs)
raw_handle_perm_lock(bs, RAW_PL_ABORT, 0, 0, NULL);
}
-static int raw_inactivate(BlockDriverState *bs)
-{
- int ret;
- uint64_t perm = 0;
- uint64_t shared = BLK_PERM_ALL;
-
- ret = raw_handle_perm_lock(bs, RAW_PL_PREPARE, perm, shared, NULL);
- if (ret) {
- return ret;
- }
- raw_handle_perm_lock(bs, RAW_PL_COMMIT, perm, shared, NULL);
- return 0;
-}
-
-
-static void raw_invalidate_cache(BlockDriverState *bs, Error **errp)
-{
- BDRVRawState *s = bs->opaque;
- int ret;
-
- assert(!(bdrv_get_flags(bs) & BDRV_O_INACTIVE));
- ret = raw_handle_perm_lock(bs, RAW_PL_PREPARE, s->perm, s->shared_perm,
- errp);
- if (ret) {
- return;
- }
- raw_handle_perm_lock(bs, RAW_PL_COMMIT, s->perm, s->shared_perm, NULL);
-}
-
BlockDriver bdrv_file = {
.format_name = "file",
.protocol_name = "file",
@@ -2249,8 +2220,6 @@ BlockDriver bdrv_file = {
.bdrv_get_info = raw_get_info,
.bdrv_get_allocated_file_size
= raw_get_allocated_file_size,
- .bdrv_inactivate = raw_inactivate,
- .bdrv_invalidate_cache = raw_invalidate_cache,
.bdrv_check_perm = raw_check_perm,
.bdrv_set_perm = raw_set_perm,
.bdrv_abort_perm_update = raw_abort_perm_update,
@@ -2712,8 +2681,6 @@ static BlockDriver bdrv_host_device = {
.bdrv_get_info = raw_get_info,
.bdrv_get_allocated_file_size
= raw_get_allocated_file_size,
- .bdrv_inactivate = raw_inactivate,
- .bdrv_invalidate_cache = raw_invalidate_cache,
.bdrv_check_perm = raw_check_perm,
.bdrv_set_perm = raw_set_perm,
.bdrv_abort_perm_update = raw_abort_perm_update,