copy-on-read.c (fcb7e040f5c69ca1f0678f991ab5354488a9e192) copy-on-read.c (c86422c5549c0983b4b4525b8f56a1c69dd67aa1)
1/*
2 * Copy-on-read filter block driver
3 *
4 * Copyright (c) 2018 Red Hat, Inc.
5 *
6 * Author:
7 * Max Reitz <mreitz@redhat.com>
8 *

--- 107 unchanged lines hidden (view full) ---

116 /* We must not request write permissions for an inactive node, the child
117 * cannot provide it. */
118 if (!(bs->open_flags & BDRV_O_INACTIVE)) {
119 *nperm |= BLK_PERM_WRITE_UNCHANGED;
120 }
121}
122
123
1/*
2 * Copy-on-read filter block driver
3 *
4 * Copyright (c) 2018 Red Hat, Inc.
5 *
6 * Author:
7 * Max Reitz <mreitz@redhat.com>
8 *

--- 107 unchanged lines hidden (view full) ---

116 /* We must not request write permissions for an inactive node, the child
117 * cannot provide it. */
118 if (!(bs->open_flags & BDRV_O_INACTIVE)) {
119 *nperm |= BLK_PERM_WRITE_UNCHANGED;
120 }
121}
122
123
124static int64_t cor_getlength(BlockDriverState *bs)
124static int64_t coroutine_fn cor_co_getlength(BlockDriverState *bs)
125{
125{
126 return bdrv_getlength(bs->file->bs);
126 return bdrv_co_getlength(bs->file->bs);
127}
128
129
130static int coroutine_fn cor_co_preadv_part(BlockDriverState *bs,
131 int64_t offset, int64_t bytes,
132 QEMUIOVector *qiov,
133 size_t qiov_offset,
134 BdrvRequestFlags flags)

--- 110 unchanged lines hidden (view full) ---

245static BlockDriver bdrv_copy_on_read = {
246 .format_name = "copy-on-read",
247 .instance_size = sizeof(BDRVStateCOR),
248
249 .bdrv_open = cor_open,
250 .bdrv_close = cor_close,
251 .bdrv_child_perm = cor_child_perm,
252
127}
128
129
130static int coroutine_fn cor_co_preadv_part(BlockDriverState *bs,
131 int64_t offset, int64_t bytes,
132 QEMUIOVector *qiov,
133 size_t qiov_offset,
134 BdrvRequestFlags flags)

--- 110 unchanged lines hidden (view full) ---

245static BlockDriver bdrv_copy_on_read = {
246 .format_name = "copy-on-read",
247 .instance_size = sizeof(BDRVStateCOR),
248
249 .bdrv_open = cor_open,
250 .bdrv_close = cor_close,
251 .bdrv_child_perm = cor_child_perm,
252
253 .bdrv_getlength = cor_getlength,
253 .bdrv_co_getlength = cor_co_getlength,
254
255 .bdrv_co_preadv_part = cor_co_preadv_part,
256 .bdrv_co_pwritev_part = cor_co_pwritev_part,
257 .bdrv_co_pwrite_zeroes = cor_co_pwrite_zeroes,
258 .bdrv_co_pdiscard = cor_co_pdiscard,
259 .bdrv_co_pwritev_compressed = cor_co_pwritev_compressed,
260
261 .bdrv_eject = cor_eject,

--- 27 unchanged lines hidden ---
254
255 .bdrv_co_preadv_part = cor_co_preadv_part,
256 .bdrv_co_pwritev_part = cor_co_pwritev_part,
257 .bdrv_co_pwrite_zeroes = cor_co_pwrite_zeroes,
258 .bdrv_co_pdiscard = cor_co_pdiscard,
259 .bdrv_co_pwritev_compressed = cor_co_pwritev_compressed,
260
261 .bdrv_eject = cor_eject,

--- 27 unchanged lines hidden ---