[PATCH] adapt vfs_glusterfs to new gfapi signatures

Jeremy Allison jra at samba.org
Sun Feb 3 12:51:41 UTC 2019


On Fri, Feb 01, 2019 at 12:22:20PM +0100, G√ľnther Deschner via samba-technical wrote:
> Hi,
> 
> attached Anoop's patch to allow compilation of vfs_glusterfs with future
> gfapi versions. Can we have a 2nd team rb+ please?

LGTM. RB+ and pushed.

Jeremy.

> From 6b5f446e68f2328ff6038d6ce16dfe218a55c8e5 Mon Sep 17 00:00:00 2001
> From: Anoop C S <anoopcs at redhat.com>
> Date: Tue, 20 Mar 2018 11:32:20 +0530
> Subject: [PATCH] vfs_glusterfs: Adapt to changes in libgfapi signatures
> 
> 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 at redhat.com>
> Reviewed-by: Guenther Deschner <gd at samba.org>
> ---
>  source3/modules/vfs_glusterfs.c | 19 +++++++++++++++++++
>  source3/wscript                 |  3 +++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
> index a241ac9db9f..601be5a2da4 100644
> --- a/source3/modules/vfs_glusterfs.c
> +++ b/source3/modules/vfs_glusterfs.c
> @@ -633,7 +633,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;
> @@ -664,7 +668,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;
> @@ -954,7 +965,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,
> @@ -1239,7 +1254,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,
> diff --git a/source3/wscript b/source3/wscript
> index d2916593888..17331a1aa50 100644
> --- a/source3/wscript
> +++ b/source3/wscript
> @@ -1570,6 +1570,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')
> -- 
> 2.20.1
> 







More information about the samba-technical mailing list