summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_time_audit.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-12-17 23:08:01 -0800
committerJeremy Allison <jra@samba.org>2010-12-18 08:59:27 +0100
commit716ea734e4cd83a2030ca2cac10056bdaab1a021 (patch)
tree8caf80f6c76f5de768896e6d0aebaf3fadbc3116 /source3/modules/vfs_time_audit.c
parent7157221da5bc6787b08ab26c9e83c08208b41d8a (diff)
downloadsamba-716ea734e4cd83a2030ca2cac10056bdaab1a021.tar.gz
samba-716ea734e4cd83a2030ca2cac10056bdaab1a021.tar.bz2
samba-716ea734e4cd83a2030ca2cac10056bdaab1a021.zip
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 <jra@samba.org> Autobuild-Date: Sat Dec 18 08:59:27 CET 2010 on sn-devel-104
Diffstat (limited to 'source3/modules/vfs_time_audit.c')
-rw-r--r--source3/modules/vfs_time_audit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index e9481b5d67..136807f067 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -905,8 +905,9 @@ static int smb_time_audit_ftruncate(vfs_handle_struct *handle,
return result;
}
-static int smb_time_audit_posix_fallocate(vfs_handle_struct *handle,
+static int smb_time_audit_fallocate(vfs_handle_struct *handle,
files_struct *fsp,
+ enum vfs_fallocate_mode mode,
SMB_OFF_T offset,
SMB_OFF_T len)
{
@@ -915,12 +916,12 @@ static int smb_time_audit_posix_fallocate(vfs_handle_struct *handle,
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_POSIX_FALLOCATE(handle, fsp, offset, len);
+ result = SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
- smb_time_audit_log("posix_fallocate", timediff);
+ smb_time_audit_log("fallocate", timediff);
}
return result;
@@ -2357,7 +2358,7 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
.getwd = smb_time_audit_getwd,
.ntimes = smb_time_audit_ntimes,
.ftruncate = smb_time_audit_ftruncate,
- .posix_fallocate = smb_time_audit_posix_fallocate,
+ .fallocate = smb_time_audit_fallocate,
.lock = smb_time_audit_lock,
.kernel_flock = smb_time_audit_kernel_flock,
.linux_setlease = smb_time_audit_linux_setlease,