summaryrefslogtreecommitdiffstats
path: root/source3/modules/vfs_ceph.c
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2015-02-09 18:21:59 +0100
committerJeremy Allison <jra@samba.org>2015-03-09 21:27:07 +0100
commit12c0b6bf4055b0466d0a2962d5ac34ac60357de3 (patch)
treec9a8bed2fc463020192cd9191ea7cf615a9e0ebd /source3/modules/vfs_ceph.c
parent3787119eb8d85d122badb22b3bcc15ed5c32765d (diff)
downloadsamba-12c0b6bf4055b0466d0a2962d5ac34ac60357de3.tar.gz
samba-12c0b6bf4055b0466d0a2962d5ac34ac60357de3.tar.xz
samba-12c0b6bf4055b0466d0a2962d5ac34ac60357de3.zip
s3/vfs: change fallocate mode flags from enum->uint32_t
The Linux fallocate syscall offers a mode parameter which can take the following flags: FALLOC_FL_KEEP_SIZE FALLOC_FL_PUNCH_HOLE (since 2.6.38) FALLOC_FL_COLLAPSE_RANGE (since 3.15) FALLOC_FL_ZERO_RANGE (since 3.14) The flags are not exclusive, e.g. FALLOC_FL_PUNCH_HOLE must be specified alongside FALLOC_FL_KEEP_SIZE. Samba currently takes a vfs_fallocate_mode enum parameter for the VFS fallocate hook, taking either an EXTEND_SIZE or KEEP_SIZE value. This commit changes the fallocate hook such that it accepts a uint32_t flags parameter, in preparation for PUNCH_HOLE and ZERO_RANGE support. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/modules/vfs_ceph.c')
-rw-r--r--source3/modules/vfs_ceph.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 096742863c..d53a2de338 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -796,8 +796,7 @@ static int strict_allocate_ftruncate(struct vfs_handle_struct *handle, files_str
emulation is being done by the libc (like on AIX with JFS1). In that
case we do our own emulation. fallocate implementations can
return ENOTSUP or EINVAL in cases like that. */
- ret = SMB_VFS_FALLOCATE(fsp, VFS_FALLOCATE_EXTEND_SIZE,
- pst->st_ex_size, space_to_write);
+ ret = SMB_VFS_FALLOCATE(fsp, 0, pst->st_ex_size, space_to_write);
if (ret == -1 && errno == ENOSPC) {
return -1;
}