From 12c0b6bf4055b0466d0a2962d5ac34ac60357de3 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Mon, 9 Feb 2015 18:21:59 +0100 Subject: 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 Reviewed-by: Jeremy Allison --- examples/VFS/skel_opaque.c | 2 +- examples/VFS/skel_transparent.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/VFS') diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 2a53c8a9d3..b6b1aefe5b 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -393,7 +393,7 @@ static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, } static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp, - enum vfs_fallocate_mode mode, off_t offset, off_t len) + uint32_t mode, off_t offset, off_t len) { errno = ENOSYS; return -1; diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index eb561db043..f7ed537025 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -490,7 +490,7 @@ static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, } static int skel_fallocate(vfs_handle_struct *handle, files_struct *fsp, - enum vfs_fallocate_mode mode, off_t offset, off_t len) + uint32_t mode, off_t offset, off_t len) { return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len); } -- cgit