vfs_glusterfs: Adapt to changes in libgfapi signatures
authorAnoop C S <anoopcs@redhat.com>
Tue, 20 Mar 2018 06:02:20 +0000 (11:32 +0530)
committerKarolin Seeger <kseeger@samba.org>
Tue, 5 Feb 2019 14:33:28 +0000 (15:33 +0100)
VFS module for GlusterFS fails to compile due to recent changes done to
some API signatures. Therefore adding missing arguments to those APIs
adapting to new signatures.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13330

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Feb  3 17:00:33 CET 2019 on sn-devel-144

(cherry picked from commit 0e3eda5bab5ae9316a42725aea048fb350020ec7)

source3/modules/vfs_glusterfs.c
source3/wscript

index e32456f60b3d24ac9dce43fa9504d7fcc0513edb..c6037d6c767473e596ca3d1b27a3378c8ca12e7e 100644 (file)
@@ -628,7 +628,11 @@ static ssize_t vfs_gluster_pread(struct vfs_handle_struct *handle,
                return -1;
        }
 
+#ifdef HAVE_GFAPI_VER_7_6
+       return glfs_pread(glfd, data, n, offset, 0, NULL);
+#else
        return glfs_pread(glfd, data, n, offset, 0);
+#endif
 }
 
 struct glusterfs_aio_state;
@@ -659,7 +663,14 @@ static int aio_wrapper_destructor(struct glusterfs_aio_wrapper *wrap)
  * threads once the async IO submitted is complete. To notify
  * Samba of the completion we use a pipe based queue.
  */
+#ifdef HAVE_GFAPI_VER_7_6
+static void aio_glusterfs_done(glfs_fd_t *fd, ssize_t ret,
+                              struct glfs_stat *prestat,
+                              struct glfs_stat *poststat,
+                              void *data)
+#else
 static void aio_glusterfs_done(glfs_fd_t *fd, ssize_t ret, void *data)
+#endif
 {
        struct glusterfs_aio_state *state = NULL;
        int sts = 0;
@@ -958,7 +969,11 @@ static ssize_t vfs_gluster_pwrite(struct vfs_handle_struct *handle,
                return -1;
        }
 
+#ifdef HAVE_GFAPI_VER_7_6
+       return glfs_pwrite(glfd, data, n, offset, 0, NULL, NULL);
+#else
        return glfs_pwrite(glfd, data, n, offset, 0);
+#endif
 }
 
 static off_t vfs_gluster_lseek(struct vfs_handle_struct *handle,
@@ -1243,7 +1258,11 @@ static int vfs_gluster_ftruncate(struct vfs_handle_struct *handle,
                return -1;
        }
 
+#ifdef HAVE_GFAPI_VER_7_6
+       return glfs_ftruncate(glfd, offset, NULL, NULL);
+#else
        return glfs_ftruncate(glfd, offset);
+#endif
 }
 
 static int vfs_gluster_fallocate(struct vfs_handle_struct *handle,
index 31bd7333bddcf130e6d8aeefef5f03b33a73ddd4..6677406b10a87c356c3e649bf8044b4a8d65aa09 100644 (file)
@@ -1568,6 +1568,9 @@ main() {
         conf.CHECK_CFG(package='glusterfs-api', args='"glusterfs-api >= 6" --cflags --libs',
                        msg='Checking for glusterfs-api >= 6',
                        uselib_store="GFAPI_VER_6")
+        conf.CHECK_CFG(package='glusterfs-api', args='"glusterfs-api >= 7.6" --cflags --libs',
+                       msg='Checking for glusterfs-api >= 7.6',
+                       uselib_store="GFAPI_VER_7_6")
     else:
         conf.SET_TARGET_TYPE('gfapi', 'EMPTY')
         conf.undefine('HAVE_GLUSTERFS')