blklogwrites.c (59c58f96b270f5edd4ad10954c3a96556cb3a728) blklogwrites.c (bd86fb990cfedc50d9705b8ed31d183f01942035)
1/*
2 * Write logging blk driver based on blkverify and blkdebug.
3 *
4 * Copyright (c) 2017 Tuomas Tynkkynen <tuomas@tuxera.com>
5 * Copyright (c) 2018 Aapo Vienamo <aapo@tuxera.com>
6 * Copyright (c) 2018 Ari Sundholm <ari@tuxera.com>
7 *
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.

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

277}
278
279static int64_t blk_log_writes_getlength(BlockDriverState *bs)
280{
281 return bdrv_getlength(bs->file->bs);
282}
283
284static void blk_log_writes_child_perm(BlockDriverState *bs, BdrvChild *c,
1/*
2 * Write logging blk driver based on blkverify and blkdebug.
3 *
4 * Copyright (c) 2017 Tuomas Tynkkynen <tuomas@tuxera.com>
5 * Copyright (c) 2018 Aapo Vienamo <aapo@tuxera.com>
6 * Copyright (c) 2018 Ari Sundholm <ari@tuxera.com>
7 *
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.

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

277}
278
279static int64_t blk_log_writes_getlength(BlockDriverState *bs)
280{
281 return bdrv_getlength(bs->file->bs);
282}
283
284static void blk_log_writes_child_perm(BlockDriverState *bs, BdrvChild *c,
285 const BdrvChildRole *role,
285 const BdrvChildClass *child_class,
286 BlockReopenQueue *ro_q,
287 uint64_t perm, uint64_t shrd,
288 uint64_t *nperm, uint64_t *nshrd)
289{
290 if (!c) {
291 *nperm = perm & DEFAULT_PERM_PASSTHROUGH;
292 *nshrd = (shrd & DEFAULT_PERM_PASSTHROUGH) | DEFAULT_PERM_UNCHANGED;
293 return;
294 }
295
296 if (!strcmp(c->name, "log")) {
286 BlockReopenQueue *ro_q,
287 uint64_t perm, uint64_t shrd,
288 uint64_t *nperm, uint64_t *nshrd)
289{
290 if (!c) {
291 *nperm = perm & DEFAULT_PERM_PASSTHROUGH;
292 *nshrd = (shrd & DEFAULT_PERM_PASSTHROUGH) | DEFAULT_PERM_UNCHANGED;
293 return;
294 }
295
296 if (!strcmp(c->name, "log")) {
297 bdrv_format_default_perms(bs, c, role, ro_q, perm, shrd, nperm, nshrd);
297 bdrv_format_default_perms(bs, c, child_class, ro_q, perm, shrd, nperm,
298 nshrd);
298 } else {
299 } else {
299 bdrv_filter_default_perms(bs, c, role, ro_q, perm, shrd, nperm, nshrd);
300 bdrv_filter_default_perms(bs, c, child_class, ro_q, perm, shrd, nperm,
301 nshrd);
300 }
301}
302
303static void blk_log_writes_refresh_limits(BlockDriverState *bs, Error **errp)
304{
305 BDRVBlkLogWritesState *s = bs->opaque;
306 bs->bl.request_alignment = s->sectorsize;
307}

--- 226 unchanged lines hidden ---
302 }
303}
304
305static void blk_log_writes_refresh_limits(BlockDriverState *bs, Error **errp)
306{
307 BDRVBlkLogWritesState *s = bs->opaque;
308 bs->bl.request_alignment = s->sectorsize;
309}

--- 226 unchanged lines hidden ---