[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] preallocate: do not enable filter inside preallocate_co_getl
From: |
Denis V. Lunev |
Subject: |
[PATCH 2/6] preallocate: do not enable filter inside preallocate_co_getlength() |
Date: |
Thu, 28 Nov 2024 19:25:49 +0100 |
Let us auto-enable it inside handle_write() and truncate(), i.e. on the
actual write operation. This just makes things more relaxing.
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
CC: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Hanna Reitz <hreitz@redhat.com>
---
block/preallocate.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/block/preallocate.c b/block/preallocate.c
index c14e6a530d..d0ed56eecb 100644
--- a/block/preallocate.c
+++ b/block/preallocate.c
@@ -494,20 +494,13 @@ static int coroutine_fn GRAPH_RDLOCK
preallocate_co_flush(BlockDriverState *bs)
static int64_t coroutine_fn GRAPH_RDLOCK
preallocate_co_getlength(BlockDriverState *bs)
{
- int64_t ret;
BDRVPreallocateState *s = bs->opaque;
if (s->data_end >= 0) {
return s->data_end;
}
- ret = bdrv_co_getlength(bs->file->bs);
-
- if (has_prealloc_perms(bs)) {
- s->file_end = s->zero_start = s->data_end = ret;
- }
-
- return ret;
+ return bdrv_co_getlength(bs->file->bs);
}
static int GRAPH_RDLOCK
--
2.45.2
- [PATCH v3 0/6] block/preallocate: fix image truncation logic, Denis V. Lunev, 2024/11/28
- [PATCH 3/6] preallocate: rework preallocate_truncate_to_real_size(), Denis V. Lunev, 2024/11/28
- [PATCH 4/6] preallocate: remove bottom half from preallocate filter, Denis V. Lunev, 2024/11/28
- [PATCH 2/6] preallocate: do not enable filter inside preallocate_co_getlength(),
Denis V. Lunev <=
- [PATCH 6/6] iotests: add preallocate filter checks, Denis V. Lunev, 2024/11/28
- [PATCH 5/6] preallocate: simplify preallocate_drop_resize, Denis V. Lunev, 2024/11/28
- [PATCH 1/6] preallocate: truncate the image inside bdrv_inactivate(), Denis V. Lunev, 2024/11/28