[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/55] gluster: Add preallocated truncation
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 12/55] gluster: Add preallocated truncation |
Date: |
Tue, 13 Feb 2018 18:04:46 +0100 |
From: Max Reitz <address@hidden>
By using qemu_do_cluster_truncate() in qemu_cluster_truncate(), we now
automatically have preallocated truncation.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <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.13.6
- [Qemu-devel] [PULL 09/55] gluster: Move glfs_close() to create's clean-up, (continued)
- [Qemu-devel] [PULL 09/55] gluster: Move glfs_close() to create's clean-up, Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 11/55] gluster: Query current size in do_truncate(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 07/55] iotests: Use virtio-blk in 155, Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 14/55] sheepdog: Pass old and new size to sd_prealloc(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 15/55] sheepdog: Allow fully preallocated truncation, Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 13/55] sheepdog: Make sd_prealloc() take a BDS, Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 17/55] qcow2: Fix documentation of get_cluster_table(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 20/55] qcow2: Remove BDS parameter from qcow2_cache_get_table_idx(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 22/55] qcow2: Remove BDS parameter from qcow2_cache_entry_mark_dirty(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 21/55] qcow2: Remove BDS parameter from qcow2_cache_table_release(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 12/55] gluster: Add preallocated truncation,
Kevin Wolf <=
- [Qemu-devel] [PULL 18/55] qcow2: Add table size field to Qcow2Cache, Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 19/55] qcow2: Remove BDS parameter from qcow2_cache_get_table_addr(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 23/55] qcow2: Remove BDS parameter from qcow2_cache_put(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 31/55] qcow2: Update l2_load() to support L2 slices, Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 16/55] block: maintain persistent disabled bitmaps, Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 30/55] qcow2: Add offset_to_l2_slice_index(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 34/55] qcow2: Refactor get_cluster_table(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 25/55] qcow2: Remove BDS parameter from qcow2_cache_clean_unused(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 28/55] qcow2: Add offset_to_l1_index(), Kevin Wolf, 2018/02/13
- [Qemu-devel] [PULL 26/55] qcow2: Remove BDS parameter from qcow2_cache_discard(), Kevin Wolf, 2018/02/13