function that returns additional 'struct stat' structures to enable
advanced caching of attributes. This is useful for file servers, not so
much for QEMU. Nevertheless, the API has changed and needs to be
adopted.
Signed-off-by: Prasanna Kumar Kalever <address@hidden>
Signed-off-by: Niels de Vos <address@hidden>
---
v2: do a compile check as suggested by Eric Blake
v3: define old backwards compatible glfs_ftruncate() macro, from Eric Blake
---
block/gluster.c | 11 +++++++++--
configure | 18 ++++++++++++++++++
2 files changed, 27 insertions(+), 2 deletions(-)
@@ -997,6 +1001,7 @@ static int qemu_gluster_do_truncate(struct glfs_fd *fd,
int64_t offset,
PreallocMode prealloc, Error **errp)
{
int64_t current_length;
+ int ret;
current_length = glfs_lseek(fd, 0, SEEK_END);
if (current_length < 0) {
@@ -1024,7 +1029,8 @@ static int qemu_gluster_do_truncate(struct glfs_fd *fd,
int64_t offset,
#endif /* CONFIG_GLUSTERFS_FALLOCATE */
#ifdef CONFIG_GLUSTERFS_ZEROFILL
case PREALLOC_MODE_FULL:
- if (glfs_ftruncate(fd, offset)) {
+ ret = glfs_ftruncate(fd, offset, NULL, NULL);
+ if (ret) {