[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/7] gluster: Add preallocated truncation
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH 4/7] gluster: Add preallocated truncation |
Date: |
Tue, 13 Feb 2018 14:03:53 +0100 |
By using qemu_do_cluster_truncate() in qemu_cluster_truncate(), we now
automatically have preallocated truncation.
Signed-off-by: Max Reitz <address@hidden>
---
block/gluster.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/block/gluster.c b/block/gluster.c
index 806b894bc8..3f17b7819d 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -1122,23 +1122,8 @@ static coroutine_fn int
qemu_gluster_co_rw(BlockDriverState *bs,
static int qemu_gluster_truncate(BlockDriverState *bs, int64_t offset,
PreallocMode prealloc, Error **errp)
{
- int ret;
BDRVGlusterState *s = bs->opaque;
-
- if (prealloc != PREALLOC_MODE_OFF) {
- error_setg(errp, "Unsupported preallocation mode '%s'",
- PreallocMode_str(prealloc));
- return -ENOTSUP;
- }
-
- ret = glfs_ftruncate(s->fd, offset);
- if (ret < 0) {
- ret = -errno;
- error_setg_errno(errp, -ret, "Failed to truncate file");
- return ret;
- }
-
- return 0;
+ return qemu_gluster_do_truncate(s->fd, offset, prealloc, errp);
}
static coroutine_fn int qemu_gluster_co_readv(BlockDriverState *bs,
--
2.14.3
- [Qemu-devel] [PATCH 0/7] block: Preallocated truncation for gluster and sheepdog, Max Reitz, 2018/02/13
- [Qemu-devel] [PATCH 4/7] gluster: Add preallocated truncation,
Max Reitz <=
- [Qemu-devel] [PATCH 1/7] gluster: Move glfs_close() to create's clean-up, Max Reitz, 2018/02/13
- [Qemu-devel] [PATCH 2/7] gluster: Pull truncation from qemu_gluster_create, Max Reitz, 2018/02/13
- [Qemu-devel] [PATCH 7/7] sheepdog: Allow fully preallocated truncation, Max Reitz, 2018/02/13
- [Qemu-devel] [PATCH 3/7] gluster: Query current size in do_truncate(), Max Reitz, 2018/02/13
- [Qemu-devel] [PATCH 5/7] sheepdog: Make sd_prealloc() take a BDS, Max Reitz, 2018/02/13