From 8998f4b01310e4b45e75d8d5f3260b5ba5c1cdf9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Dec 2010 16:53:16 -0800 Subject: Added call out to a Linux-compatible fallocate() when we need to extend a file allocation extent without changing end-of-file size. Autobuild-User: Jeremy Allison Autobuild-Date: Tue Dec 21 02:41:24 CET 2010 on sn-devel-104 --- source3/modules/vfs_default.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/modules/vfs_default.c') diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index e08d48ff5f..54f38c3714 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -965,9 +965,10 @@ static int vfswrap_fallocate(vfs_handle_struct *handle, START_PROFILE(syscall_fallocate); if (mode == VFS_FALLOCATE_EXTEND_SIZE) { result = sys_posix_fallocate(fsp->fh->fd, offset, len); + } else if (mode == VFS_FALLOCATE_KEEP_SIZE) { + result = sys_fallocate(fsp->fh->fd, mode, offset, len); } else { - /* TODO - implement call into Linux fallocate call. */ - errno = ENOSYS; + errno = EINVAL; result = -1; } END_PROFILE(syscall_fallocate); -- cgit