qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 for-3.0] block/gluster: Handle changed glfs_f


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 for-3.0] block/gluster: Handle changed glfs_ftruncate signature
Date: Fri, 27 Jul 2018 08:21:40 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 07/27/2018 03:19 AM, Niels de Vos wrote:
From: Prasanna Kumar Kalever <address@hidden>

New versions of Glusters libgfapi.so have an updated glfs_ftruncate()

s/Glusters/Gluster's/

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(-)

Seems reasonable to get into 3.0 if we still can (for fewer platforms with failed builds); but not the end of the world if it slips into 3.1.

@@ -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) {

Adding 'ret' is not strictly necessary (checking the return directly in the 'if' still works), but doesn't hurt. So,

Reviewed-by: Eric Blake <address@hidden>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]