From 716ea734e4cd83a2030ca2cac10056bdaab1a021 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Dec 2010 23:08:01 -0800 Subject: Rename vfs operation posix_fallocate to just fallocate and add the vfs_fallocate_mode parameter. It turns out we need the fallocate operations to be able to both allocate and extend filesize, and to allocate and not extend filesize, and posix_fallocate can only do the former. So by defining the vfs op as posix_fallocate we lose the opportunity to use any underlying syscalls (like Linux fallocate) that can do the latter as well. We don't currently use the non-extending filesize call, but now I've changed the vfs op definition we can in the future. For the moment simply map the fallocate op onto posix_fallocate for the VFS_FALLOCATE_EXTEND_SIZE case and return ENOSYS for the VFS_FALLOCATE_KEEP_SIZE case. Jeremy. Autobuild-User: Jeremy Allison Autobuild-Date: Sat Dec 18 08:59:27 CET 2010 on sn-devel-104 --- source3/modules/vfs_full_audit.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/modules/vfs_full_audit.c') diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index b7c0888a22..10422fca79 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -124,7 +124,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_GETWD, SMB_VFS_OP_NTIMES, SMB_VFS_OP_FTRUNCATE, - SMB_VFS_OP_POSIX_FALLOCATE, + SMB_VFS_OP_FALLOCATE, SMB_VFS_OP_LOCK, SMB_VFS_OP_KERNEL_FLOCK, SMB_VFS_OP_LINUX_SETLEASE, @@ -263,7 +263,7 @@ static struct { { SMB_VFS_OP_GETWD, "getwd" }, { SMB_VFS_OP_NTIMES, "ntimes" }, { SMB_VFS_OP_FTRUNCATE, "ftruncate" }, - { SMB_VFS_OP_POSIX_FALLOCATE,"posix_fallocate" }, + { SMB_VFS_OP_FALLOCATE,"fallocate" }, { SMB_VFS_OP_LOCK, "lock" }, { SMB_VFS_OP_KERNEL_FLOCK, "kernel_flock" }, { SMB_VFS_OP_LINUX_SETLEASE, "linux_setlease" }, @@ -1224,15 +1224,16 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp return result; } -static int smb_full_audit_posix_fallocate(vfs_handle_struct *handle, files_struct *fsp, +static int smb_full_audit_fallocate(vfs_handle_struct *handle, files_struct *fsp, + enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len) { int result; - result = SMB_VFS_NEXT_POSIX_FALLOCATE(handle, fsp, offset, len); + result = SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len); - do_log(SMB_VFS_OP_POSIX_FALLOCATE, (result >= 0), handle, + do_log(SMB_VFS_OP_FALLOCATE, (result >= 0), handle, "%s", fsp_str_do_log(fsp)); return result; @@ -2234,7 +2235,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .getwd = smb_full_audit_getwd, .ntimes = smb_full_audit_ntimes, .ftruncate = smb_full_audit_ftruncate, - .posix_fallocate = smb_full_audit_posix_fallocate, + .fallocate = smb_full_audit_fallocate, .lock = smb_full_audit_lock, .kernel_flock = smb_full_audit_kernel_flock, .linux_setlease = smb_full_audit_linux_setlease, -- cgit