[PATCHES] fix build (Re: [PATCH] Change VFS opendir paths to take struct smb_filename *)

Jeremy Allison jra at samba.org
Tue Mar 1 23:46:30 UTC 2016


On Wed, Mar 02, 2016 at 12:22:50AM +0100, Michael Adam wrote:
> Hi Jeremy,
> 
> Great patches!
> 
> Attached find patches that fix the build of the
> glusterfs and ceph vfs modules. :-)

Goddammmit !!!! :-) :-).

I was *sure* I'd gotten everything this time.

Sorry :-(.

Pushed.

> On 2016-02-26 at 22:06 -0800, Jeremy Allison wrote:
> > Here is a 5-patch set that does the following:
> > 
> > 1). VFS: Modify opendir to take a const struct smb_filename *
> > instead of const char *
> > 2). Changes internal struct smb_Dir to store struct smb_filename *
> > instead of const char *
> > 3). Fixes OpenDir() function to take a const struct smb_filename *
> > instead of const char *
> > 4). Cleanup use of talloc ctx inside call_trans2findfirst() (makes
> > subsequent patch cleaner).
> > 5). Fix dptr_create() to take a const struct smb_filename *
> > instead of const char *.
> > 
> > Passes local make test.
> > 
> > I know it's a slightly larger change than just
> > modifying the VFS, but pushing the smb_filename
> > changes out to the calling directory handle opening
> > functions makes it much clearer what this patchset
> > is trying to achieve.
> > 
> > All part of getting to the removal of lp_posix_pathnames() !
> > 
> > :-).
> > 
> > Please review and push if happy !
> > 
> > Jeremy.
> 

> From fc8ab0e74c32354340e10a790af7ca7a1836ca48 Mon Sep 17 00:00:00 2001
> From: Michael Adam <obnox at samba.org>
> Date: Wed, 2 Mar 2016 00:15:50 +0100
> Subject: [PATCH 1/2] vfs:ceph: fix build after opendir signature change.
> 
> Signed-off-by: Michael Adam <obnox at samba.org>
> ---
>  source3/modules/vfs_ceph.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
> index a56740a..2e1b623 100644
> --- a/source3/modules/vfs_ceph.c
> +++ b/source3/modules/vfs_ceph.c
> @@ -252,14 +252,16 @@ static int cephwrap_statvfs(struct vfs_handle_struct *handle,  const char *path,
>  
>  /* Directory operations */
>  
> -static DIR *cephwrap_opendir(struct vfs_handle_struct *handle,  const char *fname, const char *mask, uint32_t attr)
> +static DIR *cephwrap_opendir(struct vfs_handle_struct *handle,
> +			     const struct smb_filename *smb_fname,
> +			     const char *mask, uint32_t attr)
>  {
>  	int ret = 0;
>  	struct ceph_dir_result *result;
> -	DEBUG(10, ("[CEPH] opendir(%p, %s)\n", handle, fname));
> +	DEBUG(10, ("[CEPH] opendir(%p, %s)\n", handle, smb_fname->base_name));
>  
>  	/* Returns NULL if it does not exist or there are problems ? */
> -	ret = ceph_opendir(handle->data, fname, &result);
> +	ret = ceph_opendir(handle->data, smb_fname->base_name, &result);
>  	if (ret < 0) {
>  		result = NULL;
>  		errno = -ret; /* We return result which is NULL in this case */
> -- 
> 2.5.0
> 
> 
> From 0acd2a074e47987f82958e231b209c85c0696708 Mon Sep 17 00:00:00 2001
> From: Michael Adam <obnox at samba.org>
> Date: Wed, 2 Mar 2016 00:18:32 +0100
> Subject: [PATCH 2/2] vfs:glusterfs: fix build after opendir signature change
> 
> Signed-off-by: Michael Adam <obnox at samba.org>
> ---
>  source3/modules/vfs_glusterfs.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
> index 8e5316d..ef45f2d 100644
> --- a/source3/modules/vfs_glusterfs.c
> +++ b/source3/modules/vfs_glusterfs.c
> @@ -355,15 +355,16 @@ static uint32_t vfs_gluster_fs_capabilities(struct vfs_handle_struct *handle,
>  }
>  
>  static DIR *vfs_gluster_opendir(struct vfs_handle_struct *handle,
> -				const char *path, const char *mask,
> +				const struct smb_filename *smb_fname,
> +				const char *mask,
>  				uint32_t attributes)
>  {
>  	glfs_fd_t *fd;
>  
> -	fd = glfs_opendir(handle->data, path);
> +	fd = glfs_opendir(handle->data, smb_fname->base_name);
>  	if (fd == NULL) {
>  		DEBUG(0, ("glfs_opendir(%s) failed: %s\n",
> -			  path, strerror(errno)));
> +			  smb_fname->base_name, strerror(errno)));
>  	}
>  
>  	return (DIR *) fd;
> -- 
> 2.5.0
> 






More information about the samba-technical mailing list