diff options
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r-- | source3/modules/vfs_default.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 977a5630ac..63993fed36 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -854,7 +854,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs emulation is being done by the libc (like on AIX with JFS1). In that case we do our own emulation. posix_fallocate implementations can return ENOTSUP or EINVAL in cases like that. */ - ret = sys_posix_fallocate(fsp->fh->fd, st.st_ex_size, space_to_write); + ret = SMB_VFS_POSIX_FALLOCATE(fsp, st.st_ex_size, space_to_write); if (ret == ENOSPC) { errno = ENOSPC; return -1; @@ -862,7 +862,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs if (ret == 0) { return 0; } - DEBUG(10,("strict_allocate_ftruncate: sys_posix_fallocate failed with " + DEBUG(10,("strict_allocate_ftruncate: SMB_VFS_POSIX_FALLOCATE failed with " "error %d. Falling back to slow manual allocation\n", ret)); /* available disk space is enough or not? */ @@ -974,6 +974,19 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_O return result; } +static int vfswrap_posix_fallocate(vfs_handle_struct *handle, + files_struct *fsp, + SMB_OFF_T offset, + SMB_OFF_T len) +{ + int result; + + START_PROFILE(syscall_posix_fallocate); + result = sys_posix_fallocate(fsp->fh->fd, offset, len); + END_PROFILE(syscall_posix_fallocate); + return result; +} + static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) { bool result; |