[SCM] Samba Shared Repository - branch v4-20-test updated
Jule Anger
janger at samba.org
Thu Aug 22 10:35:02 UTC 2024
The branch, v4-20-test has been updated
via b9d9bec51c3 vfs_ceph{_new}: do not set errno upon successful call to libcephfs
via 92712fc7e27 vfs_ceph: explicit cast to uint64_t upon failure of ceph_statfs
via 67c90dec0a8 vfs_ceph: replace WRAP_RETURN macro with convenience helpers
via a9d32a3b96f vfs_ceph: re-map unimplemented hooks
via 33452ce95ff vfs_ceph: align lines-length with coding standard
from cccf0beb9f8 lib/param: Don't treat a missing include file as an error in handle_include().
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-20-test
- Log -----------------------------------------------------------------
commit b9d9bec51c3a7a0fdd51b69b892173974352c7ac
Author: Shachar Sharon <ssharon at redhat.com>
Date: Tue Jul 30 09:55:44 2024 +0300
vfs_ceph{_new}: do not set errno upon successful call to libcephfs
There is code in Samba that expects errno from a previous system call
to be preserved through a subsequent system call. Thus, avoid setting
"errno = 0" in status_code() and lstatus_code() upon successful return
from libcephfs API call.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15686
Signed-off-by: Shachar Sharon <ssharon at redhat.com>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Anoop C S <anoopcs at samba.org>
(cherry picked from commit a7f4e2bd47c7f4728f3ac8d90af693156a69c557)
Autobuild-User(v4-20-test): Jule Anger <janger at samba.org>
Autobuild-Date(v4-20-test): Thu Aug 22 10:34:46 UTC 2024 on atb-devel-224
commit 92712fc7e27e21fc279f73f0fe9803f67269967b
Author: Shachar Sharon <ssharon at 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'.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15686
Signed-off-by: Shachar Sharon <ssharon at redhat.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Anoop C S <anoopcs at samba.org>
(cherry picked from commit a7d34ec597fe810090d28bfda636b7450ecb06e5)
commit 67c90dec0a8f63acc467ac970bd518e9e384a66f
Author: Shachar Sharon <ssharon at 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.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15686
Signed-off-by: Shachar Sharon <ssharon at redhat.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Anoop C S <anoopcs at samba.org>
(cherry picked from commit 691a397b2707f2924e3f6910c9c574e01d811a97)
commit a9d32a3b96f6d8bbfcdc40bf3547be4f3dd750c8
Author: Shachar Sharon <ssharon at 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.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15686
Signed-off-by: Shachar Sharon <ssharon at redhat.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Anoop C S <anoopcs at samba.org>
(cherry picked from commit ee72f127c34f27ca496243631b2e7141de2bd59d)
commit 33452ce95ff1f32ab1cd4d53a63dc2d7d9861bf0
Author: Shachar Sharon <ssharon at 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.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15686
Signed-off-by: Shachar Sharon <ssharon at redhat.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Anoop C S <anoopcs at samba.org>
(cherry picked from commit b7e3f93ef0f17a5c85385f2e5a333fcf965766b5)
-----------------------------------------------------------------------
Summary of changes:
source3/modules/vfs_ceph.c | 375 +++++++++++++++++++++++----------------------
1 file changed, 188 insertions(+), 187 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index c9ee5414f03..6e2f893e872 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -49,21 +49,34 @@
#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;
+ }
+ return ret;
+}
+
+static inline ssize_t lstatus_code(intmax_t ret)
+{
+ if (ret < 0) {
+ errno = -((int)ret);
+ return -1;
+ }
+ return (ssize_t)ret;
+}
/*
* Track unique connections, as virtual mounts, to cephfs file systems.
@@ -221,8 +234,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);
@@ -344,54 +357,10 @@ static uint64_t cephwrap_disk_free(struct vfs_handle_struct *handle,
return *dfree;
} else {
DBG_DEBUG("[CEPH] ceph_statfs returned %d\n", ret);
- WRAP_RETURN(ret);
+ return (uint64_t)status_code(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 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
-}
-
static int cephwrap_statvfs(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
struct vfs_statvfs_struct *statbuf)
@@ -401,7 +370,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 +381,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 +466,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 +484,7 @@ static int cephwrap_mkdirat(struct vfs_handle_struct *handle,
TALLOC_FREE(full_fname);
- WRAP_RETURN(result);
+ return status_code(result);
#endif
}
@@ -522,7 +495,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 +577,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 +587,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 +662,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 +733,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.
@@ -818,7 +813,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 +868,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 +883,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 +912,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 +925,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 +933,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 +946,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 +990,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 +1005,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 +1018,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 +1100,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 +1127,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 +1152,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 +1182,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 +1191,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 +1208,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 +1216,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);
}
-static int strict_allocate_ftruncate(struct vfs_handle_struct *handle, files_struct *fsp, off_t len)
+static int strict_allocate_ftruncate(struct vfs_handle_struct *handle,
+ files_struct *fsp,
+ off_t len)
{
off_t space_to_write;
int result;
@@ -1234,16 +1245,21 @@ static int strict_allocate_ftruncate(struct vfs_handle_struct *handle, files_str
/* Shrink - just ftruncate. */
if (pst->st_ex_size > len) {
result = ceph_ftruncate(handle->data, fsp_get_io_fd(fsp), len);
- WRAP_RETURN(result);
+ return status_code(result);
}
space_to_write = len - pst->st_ex_size;
- result = ceph_fallocate(handle->data, fsp_get_io_fd(fsp), 0, pst->st_ex_size,
+ result = ceph_fallocate(handle->data,
+ fsp_get_io_fd(fsp),
+ 0,
+ pst->st_ex_size,
space_to_write);
- WRAP_RETURN(result);
+ return status_code(result);
}
-static int cephwrap_ftruncate(struct vfs_handle_struct *handle, files_struct *fsp, off_t len)
+static int cephwrap_ftruncate(struct vfs_handle_struct *handle,
+ files_struct *fsp,
+ off_t len)
{
int result = -1;
--
Samba Shared Repository
More information about the samba-cvs
mailing list