[SCM] Samba Shared Repository - branch master updated

David Disseldorp ddiss at samba.org
Sat Jan 11 15:00:10 UTC 2020


The branch, master has been updated
       via  e61ddeef4cc vfs_ceph: drop support for pre-hammer libcephfs versions
       via  888002f99e1 vfs_ceph: drop support for building without statx
      from  748379c66bc s3: smbd: msdfs: Change create_msdfs_link() to call SMB_VFS_CREATE_DFS_PATHAT().

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e61ddeef4cc35402b623dbb655ab06058866bfc4
Author: David Disseldorp <ddiss at samba.org>
Date:   Thu Jan 9 16:01:22 2020 +0100

    vfs_ceph: drop support for pre-hammer libcephfs versions
    
    The last Ceph Hammer release (0.94.10) came in Feb 2017, as is no longer
    supported upstream. Drop support for building Samba vfs_ceph against
    version prior to 0.94.0.
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Samuel Cabrero <scabrero at samba.org>
    
    Autobuild-User(master): David Disseldorp <ddiss at samba.org>
    Autobuild-Date(master): Sat Jan 11 14:59:36 UTC 2020 on sn-devel-184

commit 888002f99e113bceec5329b0962b4068e0df49ce
Author: David Disseldorp <ddiss at samba.org>
Date:   Thu Jan 9 17:11:39 2020 +0100

    vfs_ceph: drop support for building without statx
    
    libcephfs statx became available with the Kraken (11.2.0) release of
    Ceph in Jan 2017. Versions prior to this are no longer supported
    upstream, so we can drop support within Samba vfs_ceph.
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Samuel Cabrero <scabrero at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_ceph.c | 141 ---------------------------------------------
 source3/wscript            |  10 ++--
 2 files changed, 5 insertions(+), 146 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 848e369e5c2..e73e3ab4f2e 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -294,11 +294,7 @@ static uint32_t cephwrap_fs_capabilities(struct vfs_handle_struct *handle,
 {
 	uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
 
-#ifdef HAVE_CEPH_STATX
 	*p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
-#else
-	*p_ts_res = TIMESTAMP_SET_MSEC;
-#endif
 
 	return caps;
 }
@@ -669,7 +665,6 @@ static int cephwrap_fsync_recv(struct tevent_req *req,
 	return 0;
 }
 
-#ifdef HAVE_CEPH_STATX
 #define SAMBA_STATX_ATTR_MASK	(CEPH_STATX_BASIC_STATS|CEPH_STATX_BTIME)
 
 static void init_stat_ex_from_ceph_statx(struct stat_ex *dst, const struct ceph_statx *stx)
@@ -809,126 +804,6 @@ static int cephwrap_ntimes(struct vfs_handle_struct *handle,
 	return result;
 }
 
-#else /* HAVE_CEPH_STATX */
-
-static int cephwrap_stat(struct vfs_handle_struct *handle,
-			struct smb_filename *smb_fname)
-{
-	int result = -1;
-	struct stat stbuf;
-
-	DBG_DEBUG("[CEPH] stat(%p, %s)\n", handle, smb_fname_str_dbg(smb_fname));
-
-	if (smb_fname->stream_name) {
-		errno = ENOENT;
-		return result;
-	}
-
-	result = ceph_stat(handle->data, smb_fname->base_name, (struct stat *) &stbuf);
-	DBG_DEBUG("[CEPH] stat(...) = %d\n", result);
-	if (result < 0) {
-		WRAP_RETURN(result);
-	}
-
-	DBG_DEBUG("[CEPH]\tstbuf = {dev = %llu, ino = %llu, mode = 0x%x, nlink = %llu, "
-		   "uid = %d, gid = %d, rdev = %llu, size = %llu, blksize = %llu, "
-		   "blocks = %llu, atime = %llu, mtime = %llu, ctime = %llu}\n",
-		   llu(stbuf.st_dev), llu(stbuf.st_ino), stbuf.st_mode, llu(stbuf.st_nlink),
-		   stbuf.st_uid, stbuf.st_gid, llu(stbuf.st_rdev), llu(stbuf.st_size), llu(stbuf.st_blksize),
-		   llu(stbuf.st_blocks), llu(stbuf.st_atime), llu(stbuf.st_mtime), llu(stbuf.st_ctime));
-
-	init_stat_ex_from_stat(
-			&smb_fname->st, &stbuf,
-			lp_fake_directory_create_times(SNUM(handle->conn)));
-	DBG_DEBUG("[CEPH] mode = 0x%x\n", smb_fname->st.st_ex_mode);
-	return result;
-}
-
-static int cephwrap_fstat(struct vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
-{
-	int result = -1;
-	struct stat stbuf;
-
-	DBG_DEBUG("[CEPH] fstat(%p, %d)\n", handle, fsp->fh->fd);
-	result = ceph_fstat(handle->data, fsp->fh->fd, (struct stat *) &stbuf);
-	DBG_DEBUG("[CEPH] fstat(...) = %d\n", result);
-	if (result < 0) {
-		WRAP_RETURN(result);
-	}
-
-	DBG_DEBUG("[CEPH]\tstbuf = {dev = %llu, ino = %llu, mode = 0x%x, nlink = %llu, "
-		   "uid = %d, gid = %d, rdev = %llu, size = %llu, blksize = %llu, "
-		   "blocks = %llu, atime = %llu, mtime = %llu, ctime = %llu}\n",
-		   llu(stbuf.st_dev), llu(stbuf.st_ino), stbuf.st_mode, llu(stbuf.st_nlink),
-		   stbuf.st_uid, stbuf.st_gid, llu(stbuf.st_rdev), llu(stbuf.st_size), llu(stbuf.st_blksize),
-		   llu(stbuf.st_blocks), llu(stbuf.st_atime), llu(stbuf.st_mtime), llu(stbuf.st_ctime));
-
-	init_stat_ex_from_stat(
-			sbuf, &stbuf,
-			lp_fake_directory_create_times(SNUM(handle->conn)));
-	DBG_DEBUG("[CEPH] mode = 0x%x\n", sbuf->st_ex_mode);
-	return result;
-}
-
-static int cephwrap_lstat(struct vfs_handle_struct *handle,
-			 struct smb_filename *smb_fname)
-{
-	int result = -1;
-	struct stat stbuf;
-
-	DBG_DEBUG("[CEPH] lstat(%p, %s)\n", handle, smb_fname_str_dbg(smb_fname));
-
-	if (smb_fname->stream_name) {
-		errno = ENOENT;
-		return result;
-	}
-
-	result = ceph_lstat(handle->data, smb_fname->base_name, &stbuf);
-	DBG_DEBUG("[CEPH] lstat(...) = %d\n", result);
-	if (result < 0) {
-		WRAP_RETURN(result);
-	}
-
-	init_stat_ex_from_stat(
-			&smb_fname->st, &stbuf,
-			lp_fake_directory_create_times(SNUM(handle->conn)));
-	return result;
-}
-
-static int cephwrap_ntimes(struct vfs_handle_struct *handle,
-			 const struct smb_filename *smb_fname,
-			 struct smb_file_time *ft)
-{
-	struct utimbuf buf;
-	int result;
-
-	if (is_omit_timespec(&ft->atime)) {
-		buf.actime = smb_fname->st.st_ex_atime.tv_sec;
-	} else {
-		buf.actime = ft->atime.tv_sec;
-	}
-	if (is_omit_timespec(&ft->mtime)) {
-		buf.modtime = smb_fname->st.st_ex_mtime.tv_sec;
-	} else {
-		buf.modtime = ft->mtime.tv_sec;
-	}
-	if (!is_omit_timespec(&ft->create_time)) {
-		set_create_timespec_ea(handle->conn, smb_fname,
-				       ft->create_time);
-	}
-	if (buf.actime == smb_fname->st.st_ex_atime.tv_sec &&
-	    buf.modtime == smb_fname->st.st_ex_mtime.tv_sec) {
-		return 0;
-	}
-
-	result = ceph_utime(handle->data, smb_fname->base_name, &buf);
-	DBG_DEBUG("[CEPH] ntimes(%p, %s, {%ld, %ld, %ld, %ld}) = %d\n", handle, smb_fname_str_dbg(smb_fname),
-				ft->mtime.tv_sec, ft->atime.tv_sec, ft->ctime.tv_sec,
-				ft->create_time.tv_sec, result);
-	return result;
-}
-#endif /* HAVE_CEPH_STATX */
-
 static int cephwrap_unlinkat(struct vfs_handle_struct *handle,
 			struct files_struct *dirfsp,
 			const struct smb_filename *smb_fname,
@@ -1292,11 +1167,7 @@ static ssize_t cephwrap_fgetxattr(struct vfs_handle_struct *handle, struct files
 {
 	int ret;
 	DBG_DEBUG("[CEPH] fgetxattr(%p, %p, %s, %p, %llu)\n", handle, fsp, name, value, llu(size));
-#if LIBCEPHFS_VERSION_CODE >= LIBCEPHFS_VERSION(0, 94, 0)
 	ret = ceph_fgetxattr(handle->data, fsp->fh->fd, name, value, size);
-#else
-	ret = ceph_getxattr(handle->data, fsp->fsp_name->base_name, name, value, size);
-#endif
 	DBG_DEBUG("[CEPH] fgetxattr(...) = %d\n", ret);
 	if (ret < 0) {
 		WRAP_RETURN(ret);
@@ -1325,11 +1196,7 @@ static ssize_t cephwrap_flistxattr(struct vfs_handle_struct *handle, struct file
 	int ret;
 	DBG_DEBUG("[CEPH] flistxattr(%p, %p, %p, %llu)\n",
 		  handle, fsp, list, llu(size));
-#if LIBCEPHFS_VERSION_CODE >= LIBCEPHFS_VERSION(0, 94, 0)
 	ret = ceph_flistxattr(handle->data, fsp->fh->fd, list, size);
-#else
-	ret = ceph_listxattr(handle->data, fsp->fsp_name->base_name, list, size);
-#endif
 	DBG_DEBUG("[CEPH] flistxattr(...) = %d\n", ret);
 	if (ret < 0) {
 		WRAP_RETURN(ret);
@@ -1353,11 +1220,7 @@ static int cephwrap_fremovexattr(struct vfs_handle_struct *handle, struct files_
 {
 	int ret;
 	DBG_DEBUG("[CEPH] fremovexattr(%p, %p, %s)\n", handle, fsp, name);
-#if LIBCEPHFS_VERSION_CODE >= LIBCEPHFS_VERSION(0, 94, 0)
 	ret = ceph_fremovexattr(handle->data, fsp->fh->fd, name);
-#else
-	ret = ceph_removexattr(handle->data, fsp->fsp_name->base_name, name);
-#endif
 	DBG_DEBUG("[CEPH] fremovexattr(...) = %d\n", ret);
 	WRAP_RETURN(ret);
 }
@@ -1382,12 +1245,8 @@ static int cephwrap_fsetxattr(struct vfs_handle_struct *handle, struct files_str
 {
 	int ret;
 	DBG_DEBUG("[CEPH] fsetxattr(%p, %p, %s, %p, %llu, %d)\n", handle, fsp, name, value, llu(size), flags);
-#if LIBCEPHFS_VERSION_CODE >= LIBCEPHFS_VERSION(0, 94, 0)
 	ret = ceph_fsetxattr(handle->data, fsp->fh->fd,
 			     name, value, size, flags);
-#else
-	ret = ceph_setxattr(handle->data, fsp->fsp_name->base_name, name, value, size, flags);
-#endif
 	DBG_DEBUG("[CEPH] fsetxattr(...) = %d\n", ret);
 	WRAP_RETURN(ret);
 }
diff --git a/source3/wscript b/source3/wscript
index bfe47c63113..62fe8ea7d59 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1711,13 +1711,13 @@ main() {
     if (Options.options.with_cephfs and
         conf.CHECK_HEADERS('cephfs/libcephfs.h', False, False, 'cephfs') and
         conf.CHECK_LIB('cephfs', shlib=True)):
-        if Options.options.with_acl_support:
+        if (Options.options.with_acl_support and
+            conf.CHECK_FUNCS_IN('ceph_statx', 'cephfs',
+                                headers='cephfs/libcephfs.h')):
             conf.DEFINE('HAVE_CEPH', '1')
-            if conf.CHECK_FUNCS_IN('ceph_statx', 'cephfs',
-                                   headers='cephfs/libcephfs.h'):
-                conf.DEFINE('HAVE_CEPH_STATX', '1')
         else:
-            Logs.warn("ceph support disabled due to --without-acl-support")
+            Logs.warn('''Ceph support disabled due to --without-acl-support
+                      or lack of ceph_statx support''')
             conf.undefine('HAVE_CEPH')
 
     if Options.options.with_glusterfs:


-- 
Samba Shared Repository



More information about the samba-cvs mailing list