The branch, master has been updated
       via  2d743185e0c vfs_ceph: use consistent code style when setting errno
       via  a7d34ec597f vfs_ceph: explicit cast to uint64_t upon failure of 
ceph_statfs
       via  0f92c6055a6 vfs_ceph: adjust code-style of cephwrap_disk_free
       via  691a397b270 vfs_ceph: replace WRAP_RETURN macro with convenience 
helpers
       via  0bc917b01fc vfs_ceph: use talloc in realpath hook
       via  ee72f127c34 vfs_ceph: re-map unimplemented hooks
       via  b7e3f93ef0f vfs_ceph: align lines-length with coding standard
       via  4e21a8b2786 vfs_ceph: improve readability of cephwrap_realpath
      from  3c1691aff55 Extended the documentation for the "tls certfile" 
parameter in the smb.conf.

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


- Log -----------------------------------------------------------------
commit 2d743185e0c6e848f1aaf0395ea8824ac5381086
Author: Shachar Sharon <ssha...@redhat.com>
Date:   Tue May 28 12:36:14 2024 +0300

    vfs_ceph: use consistent code style when setting errno
    
    When setting explicit value to 'errno' use same coding-style as used in
    this entire module (spaces before and after assignment operator).
    
    Signed-off-by: Shachar Sharon <ssha...@redhat.com>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Anoop C S <anoo...@samba.org>
    
    Autobuild-User(master): Anoop C S <anoo...@samba.org>
    Autobuild-Date(master): Thu Jun 27 06:35:19 UTC 2024 on atb-devel-224

commit a7d34ec597fe810090d28bfda636b7450ecb06e5
Author: Shachar Sharon <ssha...@redhat.com>
Date:   Thu May 30 11:02:37 2024 +0300

    vfs_ceph: explicit cast to uint64_t upon failure of ceph_statfs
    
    When a call to 'ceph_statfs' from with 'cephwrap_disk_free' returns
    non-zero status do an explicit cast to uint64_t for the negative (-1)
    value returned by 'status_code'.
    
    Signed-off-by: Shachar Sharon <ssha...@redhat.com>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Anoop C S <anoo...@samba.org>

commit 0f92c6055a6257f5bcbf3f27b21536f9d023cdfa
Author: Shachar Sharon <ssha...@redhat.com>
Date:   Mon May 27 12:30:44 2024 +0300

    vfs_ceph: adjust code-style of cephwrap_disk_free
    
    The common convention in 'vfs_ceph.c' module is to bailout (by return or
    goto) whenever the return value from libcephfs call is not OK. Apply
    this code-style to cephwrap_disk_free hook.
    
    Signed-off-by: Shachar Sharon <ssha...@redhat.com>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Anoop C S <anoo...@samba.org>

commit 691a397b2707f2924e3f6910c9c574e01d811a97
Author: Shachar Sharon <ssha...@redhat.com>
Date:   Thu May 23 17:15:40 2024 +0300

    vfs_ceph: replace WRAP_RETURN macro with convenience helpers
    
    The WRAP_RETURN is a non-hygienic macro, and as such has the potential
    of creating bogus code (e.g. 'return WRAP_RETURN(ret);' which existed
    in the code in the past but did not yield any compiler warning). Prefer
    simple convenience helper functions instead, which are also type safe.
    
    Signed-off-by: Shachar Sharon <ssha...@redhat.com>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Anoop C S <anoo...@samba.org>

commit 0bc917b01fcf3b6a22b60c1bb57b379b1374a216
Author: Shachar Sharon <ssha...@redhat.com>
Date:   Wed May 22 16:28:32 2024 +0300

    vfs_ceph: use talloc in realpath hook
    
    Prefer talloc_asprintf over asprintf when resolving realpath.
    Re-format code using 'git clang-format'.
    
    Signed-off-by: Shachar Sharon <ssha...@redhat.com>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Anoop C S <anoo...@samba.org>

commit ee72f127c34f27ca496243631b2e7141de2bd59d
Author: Shachar Sharon <ssha...@redhat.com>
Date:   Wed May 22 16:11:57 2024 +0300

    vfs_ceph: re-map unimplemented hooks
    
    Code cleanup: prefer standard convenience helpers for unimplemented
    VFS hooks.
    
    Signed-off-by: Shachar Sharon <ssha...@redhat.com>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Anoop C S <anoo...@samba.org>

commit b7e3f93ef0f17a5c85385f2e5a333fcf965766b5
Author: Shachar Sharon <ssha...@redhat.com>
Date:   Sun May 26 16:24:06 2024 +0300

    vfs_ceph: align lines-length with coding standard
    
    Coding standard requires following Linux kernel style guide, with an
    explicit statement that "Maximum Line Width is 80 Characters". Align
    vfs_ceph.c with this convention: split long lines into multiple lines
    and use 'git clang-format' to do auto-formatting based on Samba project
    '.clang-format' settings.
    
    Signed-off-by: Shachar Sharon <ssha...@redhat.com>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Anoop C S <anoo...@samba.org>

commit 4e21a8b278629ac043ae20ca8a445e2d1138af82
Author: Shachar Sharon <ssha...@redhat.com>
Date:   Thu May 30 10:27:35 2024 +0300

    vfs_ceph: improve readability of cephwrap_realpath
    
    Minor code cleanup: use local variable to reference current-work dir.
    This commit is in preparation to following code-cleanup which aligns
    line-length with Samba's coding conventions.
    
    Signed-off-by: Shachar Sharon <ssha...@redhat.com>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Anoop C S <anoo...@samba.org>

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

Summary of changes:
 source3/modules/vfs_ceph.c | 421 ++++++++++++++++++++++-----------------------
 1 file changed, 210 insertions(+), 211 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index bb1650446c9..04ab6f7c052 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -49,21 +49,36 @@
 #endif
 
 /*
- * Use %llu whenever we have a 64bit unsigned int, and cast to (long long 
unsigned)
+ * Use %llu whenever we have a 64bit unsigned int, and cast to (long long
+ * unsigned)
  */
 #define llu(_var) ((long long unsigned)_var)
 
 /*
- * Note, libcephfs's return code model is to return -errno! So we have to
- * convert to what Samba expects, which is to set errno to -return and return 
-1
+ * Note, libcephfs's return code model is to return -errno. Thus we have to
+ * convert to what Samba expects: set errno to non-negative value and return 
-1.
+ *
+ * Using convenience helper functions to avoid non-hygienic macro.
  */
-#define WRAP_RETURN(_res) \
-       errno = 0; \
-       if (_res < 0) { \
-               errno = -_res; \
-               return -1; \
-       } \
-       return _res \
+static inline int status_code(int ret)
+{
+       if (ret < 0) {
+               errno = -ret;
+               return -1;
+       }
+       errno = 0;
+       return ret;
+}
+
+static inline ssize_t lstatus_code(intmax_t ret)
+{
+       if (ret < 0) {
+               errno = -((int)ret);
+               return -1;
+       }
+       errno = 0;
+       return (ssize_t)ret;
+}
 
 /*
  * Track unique connections, as virtual mounts, to cephfs file systems.
@@ -221,8 +236,8 @@ static struct ceph_mount_info *cephmount_mount_fs(const int 
snum)
        }
        /*
         * select a cephfs file system to use:
-        * In ceph, multiple file system support has been stable since 
'pacific'.
-        * Permit different shares to access different file systems.
+        * In ceph, multiple file system support has been stable since
+        * 'pacific'. Permit different shares to access different file systems.
         */
        if (fsname != NULL) {
                ret = cephmount_select_fs(mnt, fsname);
@@ -331,65 +346,20 @@ static uint64_t cephwrap_disk_free(struct 
vfs_handle_struct *handle,
        struct statvfs statvfs_buf = { 0 };
        int ret;
 
-       if (!(ret = ceph_statfs(handle->data, smb_fname->base_name,
-                       &statvfs_buf))) {
-               /*
-                * Provide all the correct values.
-                */
-               *bsize = statvfs_buf.f_bsize;
-               *dfree = statvfs_buf.f_bavail;
-               *dsize = statvfs_buf.f_blocks;
-               DBG_DEBUG("[CEPH] bsize: %llu, dfree: %llu, dsize: %llu\n",
-                       llu(*bsize), llu(*dfree), llu(*dsize));
-               return *dfree;
-       } else {
+       ret = ceph_statfs(handle->data, smb_fname->base_name, &statvfs_buf);
+       if (ret < 0) {
                DBG_DEBUG("[CEPH] ceph_statfs returned %d\n", ret);
-               WRAP_RETURN(ret);
-       }
-}
-
-static int cephwrap_get_quota(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               enum SMB_QUOTA_TYPE qtype,
-                               unid_t id,
-                               SMB_DISK_QUOTA *qt)
-{
-       /* libcephfs: Ceph does not implement this */
-#if 0
-/* was ifdef HAVE_SYS_QUOTAS */
-       int ret;
-
-       ret = ceph_get_quota(handle->conn->connectpath, qtype, id, qt);
-
-       if (ret) {
-               errno = -ret;
-               ret = -1;
+               return (uint64_t)status_code(ret);
        }
-
-       return ret;
-#else
-       errno = ENOSYS;
-       return -1;
-#endif
-}
-
-static int cephwrap_set_quota(struct vfs_handle_struct *handle,  enum 
SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt)
-{
-       /* libcephfs: Ceph does not implement this */
-#if 0
-/* was ifdef HAVE_SYS_QUOTAS */
-       int ret;
-
-       ret = ceph_set_quota(handle->conn->connectpath, qtype, id, qt);
-       if (ret) {
-               errno = -ret;
-               ret = -1;
-       }
-
-       return ret;
-#else
-       WRAP_RETURN(-ENOSYS);
-#endif
+       /*
+        * Provide all the correct values.
+        */
+       *bsize = statvfs_buf.f_bsize;
+       *dfree = statvfs_buf.f_bavail;
+       *dsize = statvfs_buf.f_blocks;
+       DBG_DEBUG("[CEPH] bsize: %llu, dfree: %llu, dsize: %llu\n", llu(*bsize),
+               llu(*dfree), llu(*dsize));
+       return *dfree;
 }
 
 static int cephwrap_statvfs(struct vfs_handle_struct *handle,
@@ -401,7 +371,7 @@ static int cephwrap_statvfs(struct vfs_handle_struct 
*handle,
 
        ret = ceph_statfs(handle->data, smb_fname->base_name, &statvfs_buf);
        if (ret < 0) {
-               WRAP_RETURN(ret);
+               return status_code(ret);
        }
 
        statbuf->OptimalTransferSize = statvfs_buf.f_frsize;
@@ -412,15 +382,19 @@ static int cephwrap_statvfs(struct vfs_handle_struct 
*handle,
        statbuf->TotalFileNodes = statvfs_buf.f_files;
        statbuf->FreeFileNodes = statvfs_buf.f_ffree;
        statbuf->FsIdentifier = statvfs_buf.f_fsid;
-       DBG_DEBUG("[CEPH] f_bsize: %ld, f_blocks: %ld, f_bfree: %ld, f_bavail: 
%ld\n",
-               (long int)statvfs_buf.f_bsize, (long int)statvfs_buf.f_blocks,
-               (long int)statvfs_buf.f_bfree, (long int)statvfs_buf.f_bavail);
+       DBG_DEBUG("[CEPH] f_bsize: %ld, f_blocks: %ld, f_bfree: %ld, "
+                 "f_bavail: %ld\n",
+                 (long int)statvfs_buf.f_bsize,
+                 (long int)statvfs_buf.f_blocks,
+                 (long int)statvfs_buf.f_bfree,
+                 (long int)statvfs_buf.f_bavail);
 
        return ret;
 }
 
-static uint32_t cephwrap_fs_capabilities(struct vfs_handle_struct *handle,
-                                        enum timestamp_set_resolution 
*p_ts_res)
+static uint32_t cephwrap_fs_capabilities(
+       struct vfs_handle_struct *handle,
+       enum timestamp_set_resolution *p_ts_res)
 {
        uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
 
@@ -493,7 +467,7 @@ static int cephwrap_mkdirat(struct vfs_handle_struct 
*handle,
 
        DBG_DEBUG("[CEPH] mkdirat(...) = %d\n", result);
 
-       WRAP_RETURN(result);
+       return status_code(result);
 #else
        struct smb_filename *full_fname = NULL;
 
@@ -511,7 +485,7 @@ static int cephwrap_mkdirat(struct vfs_handle_struct 
*handle,
 
        TALLOC_FREE(full_fname);
 
-       WRAP_RETURN(result);
+       return status_code(result);
 #endif
 }
 
@@ -522,7 +496,7 @@ static int cephwrap_closedir(struct vfs_handle_struct 
*handle, DIR *dirp)
        DBG_DEBUG("[CEPH] closedir(%p, %p)\n", handle, dirp);
        result = ceph_closedir(handle->data, (struct ceph_dir_result *) dirp);
        DBG_DEBUG("[CEPH] closedir(...) = %d\n", result);
-       WRAP_RETURN(result);
+       return status_code(result);
 }
 
 /* File operations */
@@ -604,7 +578,7 @@ out:
        TALLOC_FREE(name);
        fsp->fsp_flags.have_proc_fds = false;
        DBG_DEBUG("[CEPH] open(...) = %d\n", result);
-       WRAP_RETURN(result);
+       return status_code(result);
 }
 
 static int cephwrap_close(struct vfs_handle_struct *handle, files_struct *fsp)
@@ -614,20 +588,27 @@ static int cephwrap_close(struct vfs_handle_struct 
*handle, files_struct *fsp)
        DBG_DEBUG("[CEPH] close(%p, %p)\n", handle, fsp);
        result = ceph_close(handle->data, fsp_get_pathref_fd(fsp));
        DBG_DEBUG("[CEPH] close(...) = %d\n", result);
-
-       WRAP_RETURN(result);
+       return status_code(result);
 }
 
-static ssize_t cephwrap_pread(struct vfs_handle_struct *handle, files_struct 
*fsp, void *data,
-                       size_t n, off_t offset)
+static ssize_t cephwrap_pread(struct vfs_handle_struct *handle,
+                             files_struct *fsp,
+                             void *data,
+                             size_t n,
+                             off_t offset)
 {
        ssize_t result;
 
-       DBG_DEBUG("[CEPH] pread(%p, %p, %p, %llu, %llu)\n", handle, fsp, data, 
llu(n), llu(offset));
+       DBG_DEBUG("[CEPH] pread(%p, %p, %p, %llu, %llu)\n",
+                 handle,
+                 fsp,
+                 data,
+                 llu(n),
+                 llu(offset));
 
        result = ceph_read(handle->data, fsp_get_io_fd(fsp), data, n, offset);
        DBG_DEBUG("[CEPH] pread(...) = %llu\n", llu(result));
-       WRAP_RETURN(result);
+       return lstatus_code(result);
 }
 
 struct cephwrap_pread_state {
@@ -682,15 +663,23 @@ static ssize_t cephwrap_pread_recv(struct tevent_req *req,
        return state->bytes_read;
 }
 
-static ssize_t cephwrap_pwrite(struct vfs_handle_struct *handle, files_struct 
*fsp, const void *data,
-                       size_t n, off_t offset)
+static ssize_t cephwrap_pwrite(struct vfs_handle_struct *handle,
+                              files_struct *fsp,
+                              const void *data,
+                              size_t n,
+                              off_t offset)
 {
        ssize_t result;
 
-       DBG_DEBUG("[CEPH] pwrite(%p, %p, %p, %llu, %llu)\n", handle, fsp, data, 
llu(n), llu(offset));
+       DBG_DEBUG("[CEPH] pwrite(%p, %p, %p, %llu, %llu)\n",
+                 handle,
+                 fsp,
+                 data,
+                 llu(n),
+                 llu(offset));
        result = ceph_write(handle->data, fsp_get_io_fd(fsp), data, n, offset);
        DBG_DEBUG("[CEPH] pwrite(...) = %llu\n", llu(result));
-       WRAP_RETURN(result);
+       return lstatus_code(result);
 }
 
 struct cephwrap_pwrite_state {
@@ -745,17 +734,24 @@ static ssize_t cephwrap_pwrite_recv(struct tevent_req 
*req,
        return state->bytes_written;
 }
 
-static off_t cephwrap_lseek(struct vfs_handle_struct *handle, files_struct 
*fsp, off_t offset, int whence)
+static off_t cephwrap_lseek(struct vfs_handle_struct *handle,
+                           files_struct *fsp,
+                           off_t offset,
+                           int whence)
 {
        off_t result = 0;
 
        DBG_DEBUG("[CEPH] cephwrap_lseek\n");
        result = ceph_lseek(handle->data, fsp_get_io_fd(fsp), offset, whence);
-       WRAP_RETURN(result);
+       return lstatus_code(result);
 }
 
-static ssize_t cephwrap_sendfile(struct vfs_handle_struct *handle, int tofd, 
files_struct *fromfsp, const DATA_BLOB *hdr,
-                       off_t offset, size_t n)
+static ssize_t cephwrap_sendfile(struct vfs_handle_struct *handle,
+                                int tofd,
+                                files_struct *fromfsp,
+                                const DATA_BLOB *hdr,
+                                off_t offset,
+                                size_t n)
 {
        /*
         * We cannot support sendfile because libcephfs is in user space.
@@ -775,7 +771,7 @@ static ssize_t cephwrap_recvfile(struct vfs_handle_struct 
*handle,
         * We cannot support recvfile because libcephfs is in user space.
         */
        DBG_DEBUG("[CEPH] cephwrap_recvfile\n");
-       errno=ENOTSUP;
+       errno = ENOTSUP;
        return -1;
 }
 
@@ -818,7 +814,7 @@ static int cephwrap_renameat(struct vfs_handle_struct 
*handle,
        TALLOC_FREE(full_fname_src);
        TALLOC_FREE(full_fname_dst);
 
-       WRAP_RETURN(result);
+       return status_code(result);
 }
 
 /*
@@ -873,7 +869,8 @@ static int cephwrap_fsync_recv(struct tevent_req *req,
 
 #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)
+static void init_stat_ex_from_ceph_statx(struct stat_ex *dst,
+                                        const struct ceph_statx *stx)
 {
        DBG_DEBUG("[CEPH]\tstx = {dev = %llx, ino = %llu, mode = 0x%x, "
                  "nlink = %llu, uid = %d, gid = %d, rdev = %llx, size = %llu, "
@@ -887,8 +884,11 @@ static void init_stat_ex_from_ceph_statx(struct stat_ex 
*dst, const struct ceph_
                  llu(stx->stx_btime.tv_sec));
 
        if ((stx->stx_mask & SAMBA_STATX_ATTR_MASK) != SAMBA_STATX_ATTR_MASK) {
-               DBG_WARNING("%s: stx->stx_mask is incorrect (wanted %x, got 
%x)\n",
-                               __func__, SAMBA_STATX_ATTR_MASK, stx->stx_mask);
+               DBG_WARNING("%s: stx->stx_mask is incorrect "
+                           "(wanted %x, got %x)\n",
+                           __func__,
+                           SAMBA_STATX_ATTR_MASK,
+                           stx->stx_mask);
        }
 
        dst->st_ex_dev = stx->stx_dev;
@@ -913,7 +913,9 @@ static int cephwrap_stat(struct vfs_handle_struct *handle,
        int result = -1;
        struct ceph_statx stx = { 0 };
 
-       DBG_DEBUG("[CEPH] stat(%p, %s)\n", handle, 
smb_fname_str_dbg(smb_fname));
+       DBG_DEBUG("[CEPH] stat(%p, %s)\n",
+                 handle,
+                 smb_fname_str_dbg(smb_fname));
 
        if (smb_fname->stream_name) {
                errno = ENOENT;
@@ -924,7 +926,7 @@ static int cephwrap_stat(struct vfs_handle_struct *handle,
                                SAMBA_STATX_ATTR_MASK, 0);
        DBG_DEBUG("[CEPH] statx(...) = %d\n", result);
        if (result < 0) {
-               WRAP_RETURN(result);
+               return status_code(result);
        }
 
        init_stat_ex_from_ceph_statx(&smb_fname->st, &stx);
@@ -932,7 +934,9 @@ static int cephwrap_stat(struct vfs_handle_struct *handle,
        return result;
 }
 
-static int cephwrap_fstat(struct vfs_handle_struct *handle, files_struct *fsp, 
SMB_STRUCT_STAT *sbuf)
+static int cephwrap_fstat(struct vfs_handle_struct *handle,
+                         files_struct *fsp,
+                         SMB_STRUCT_STAT *sbuf)
 {
        int result = -1;
        struct ceph_statx stx = { 0 };
@@ -943,7 +947,7 @@ static int cephwrap_fstat(struct vfs_handle_struct *handle, 
files_struct *fsp, S
                                SAMBA_STATX_ATTR_MASK, 0);
        DBG_DEBUG("[CEPH] fstat(...) = %d\n", result);
        if (result < 0) {
-               WRAP_RETURN(result);
+               return status_code(result);
        }
 
        init_stat_ex_from_ceph_statx(sbuf, &stx);
@@ -987,7 +991,7 @@ static int cephwrap_fstatat(struct vfs_handle_struct 
*handle,
 
        DBG_DEBUG("[CEPH] fstatat(...) = %d\n", result);
        if (result < 0) {
-               WRAP_RETURN(result);
+               return status_code(result);
        }
 
        init_stat_ex_from_ceph_statx(sbuf, &stx);
@@ -1002,7 +1006,9 @@ static int cephwrap_lstat(struct vfs_handle_struct 
*handle,
        int result = -1;
        struct ceph_statx stx = { 0 };
 
-       DBG_DEBUG("[CEPH] lstat(%p, %s)\n", handle, 
smb_fname_str_dbg(smb_fname));
+       DBG_DEBUG("[CEPH] lstat(%p, %s)\n",
+                 handle,
+                 smb_fname_str_dbg(smb_fname));
 
        if (smb_fname->stream_name) {
                errno = ENOENT;
@@ -1013,7 +1019,7 @@ static int cephwrap_lstat(struct vfs_handle_struct 
*handle,
                                SAMBA_STATX_ATTR_MASK, AT_SYMLINK_NOFOLLOW);
        DBG_DEBUG("[CEPH] lstat(...) = %d\n", result);
        if (result < 0) {
-               WRAP_RETURN(result);
+               return status_code(result);
        }
 
        init_stat_ex_from_ceph_statx(&smb_fname->st, &stx);
@@ -1095,7 +1101,7 @@ static int cephwrap_unlinkat(struct vfs_handle_struct 
*handle,
                               smb_fname->base_name,
                               flags);
        DBG_DEBUG("[CEPH] unlinkat(...) = %d\n", result);
-       WRAP_RETURN(result);
+       return status_code(result);
 #else
        struct smb_filename *full_fname = NULL;
 
@@ -1122,11 +1128,13 @@ static int cephwrap_unlinkat(struct vfs_handle_struct 
*handle,
        }
        TALLOC_FREE(full_fname);
        DBG_DEBUG("[CEPH] unlink(...) = %d\n", result);
-       WRAP_RETURN(result);
+       return status_code(result);
 #endif
 }
 
-static int cephwrap_fchmod(struct vfs_handle_struct *handle, files_struct 
*fsp, mode_t mode)
+static int cephwrap_fchmod(struct vfs_handle_struct *handle,
+                          files_struct *fsp,
+                          mode_t mode)
 {
        int result;
 
@@ -1145,10 +1153,13 @@ static int cephwrap_fchmod(struct vfs_handle_struct 
*handle, files_struct *fsp,
                                    mode);
        }
        DBG_DEBUG("[CEPH] fchmod(...) = %d\n", result);
-       WRAP_RETURN(result);
+       return status_code(result);
 }
 
-static int cephwrap_fchown(struct vfs_handle_struct *handle, files_struct 
*fsp, uid_t uid, gid_t gid)
+static int cephwrap_fchown(struct vfs_handle_struct *handle,
+                          files_struct *fsp,
+                          uid_t uid,
+                          gid_t gid)
 {
        int result;
 
@@ -1172,7 +1183,7 @@ static int cephwrap_fchown(struct vfs_handle_struct 
*handle, files_struct *fsp,
        }
 
        DBG_DEBUG("[CEPH] fchown(...) = %d\n", result);
-       WRAP_RETURN(result);
+       return status_code(result);
 }
 
 static int cephwrap_lchown(struct vfs_handle_struct *handle,
@@ -1181,10 +1192,14 @@ static int cephwrap_lchown(struct vfs_handle_struct 
*handle,
                        gid_t gid)
 {
        int result;
-       DBG_DEBUG("[CEPH] lchown(%p, %s, %d, %d)\n", handle, 
smb_fname->base_name, uid, gid);
+       DBG_DEBUG("[CEPH] lchown(%p, %s, %d, %d)\n",
+                 handle,
+                 smb_fname->base_name,
+                 uid,
+                 gid);
        result = ceph_lchown(handle->data, smb_fname->base_name, uid, gid);
        DBG_DEBUG("[CEPH] lchown(...) = %d\n", result);
-       WRAP_RETURN(result);
+       return status_code(result);
 }
 
 static int cephwrap_chdir(struct vfs_handle_struct *handle,
@@ -1194,7 +1209,7 @@ static int cephwrap_chdir(struct vfs_handle_struct 
*handle,
        DBG_DEBUG("[CEPH] chdir(%p, %s)\n", handle, smb_fname->base_name);
        result = ceph_chdir(handle->data, smb_fname->base_name);
        DBG_DEBUG("[CEPH] chdir(...) = %d\n", result);
-       WRAP_RETURN(result);
+       return status_code(result);
 }
 
 static struct smb_filename *cephwrap_getwd(struct vfs_handle_struct *handle,
@@ -1202,15 +1217,12 @@ static struct smb_filename *cephwrap_getwd(struct 
vfs_handle_struct *handle,
 {
        const char *cwd = ceph_getcwd(handle->data);
        DBG_DEBUG("[CEPH] getwd(%p) = %s\n", handle, cwd);
-       return synthetic_smb_fname(ctx,
-                               cwd,
-                               NULL,
-                               NULL,
-                               0,
-                               0);
+       return synthetic_smb_fname(ctx, cwd, NULL, NULL, 0, 0);
 }


-- 
Samba Shared Repository

Reply via email to