preallocate.c (3da71a2111de9f0bc475f8292d009265ab34365f) preallocate.c (79a558664840adf502fe94907b0a680836e3e98e)
1/*
2 * preallocate filter driver
3 *
4 * The driver performs preallocate operation: it is injected above
5 * some node, and before each write over EOF it does additional preallocating
6 * write-zeroes request.
7 *
8 * Copyright (c) 2020 Virtuozzo International GmbH.

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

536{
537 /*
538 * In case of errors, we'll simply keep the exclusive lock on the image
539 * indefinitely.
540 */
541 preallocate_drop_resize(opaque, NULL);
542}
543
1/*
2 * preallocate filter driver
3 *
4 * The driver performs preallocate operation: it is injected above
5 * some node, and before each write over EOF it does additional preallocating
6 * write-zeroes request.
7 *
8 * Copyright (c) 2020 Virtuozzo International GmbH.

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

536{
537 /*
538 * In case of errors, we'll simply keep the exclusive lock on the image
539 * indefinitely.
540 */
541 preallocate_drop_resize(opaque, NULL);
542}
543
544static void preallocate_set_perm(BlockDriverState *bs,
545 uint64_t perm, uint64_t shared)
544static void GRAPH_RDLOCK
545preallocate_set_perm(BlockDriverState *bs, uint64_t perm, uint64_t shared)
546{
547 BDRVPreallocateState *s = bs->opaque;
548
549 if (can_write_resize(perm)) {
550 qemu_bh_cancel(s->drop_resize_bh);
551 if (s->data_end < 0) {
552 s->data_end = s->file_end = s->zero_start =
553 bs->file->bs->total_sectors * BDRV_SECTOR_SIZE;

--- 61 unchanged lines hidden ---
546{
547 BDRVPreallocateState *s = bs->opaque;
548
549 if (can_write_resize(perm)) {
550 qemu_bh_cancel(s->drop_resize_bh);
551 if (s->data_end < 0) {
552 s->data_end = s->file_end = s->zero_start =
553 bs->file->bs->total_sectors * BDRV_SECTOR_SIZE;

--- 61 unchanged lines hidden ---