summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-12-02 16:25:59 -0800
committerJeremy Allison <jra@samba.org>2010-12-02 16:25:59 -0800
commit5819a36aef030772f1e9da81655c1f911a10372c (patch)
tree8746c0f52b94f3b2bd722474b653860b10df2a14 /source3/smbd
parentde8ceb5364de86f9b016251201474f011c16f6cb (diff)
downloadsamba-5819a36aef030772f1e9da81655c1f911a10372c.tar.gz
samba-5819a36aef030772f1e9da81655c1f911a10372c.tar.bz2
samba-5819a36aef030772f1e9da81655c1f911a10372c.zip
Move posix_fallocate into the VFS where it belongs.
Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/vfs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 8757682242..1829e3ae42 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -609,7 +609,7 @@ int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len)
* 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, offset, num_to_write);
+ ret = SMB_VFS_POSIX_FALLOCATE(fsp, offset, num_to_write);
if (ret == ENOSPC) {
errno = ENOSPC;
ret = -1;
@@ -619,7 +619,7 @@ int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len)
set_filelen_write_cache(fsp, len);
goto out;
}
- DEBUG(10,("vfs_fill_sparse: sys_posix_fallocate failed with "
+ DEBUG(10,("vfs_fill_sparse: SMB_VFS_POSIX_FALLOCATE failed with "
"error %d. Falling back to slow manual allocation\n", ret));
}
@@ -1439,6 +1439,15 @@ int smb_vfs_call_ftruncate(struct vfs_handle_struct *handle,
return handle->fns->ftruncate(handle, fsp, offset);
}
+int smb_vfs_call_posix_fallocate(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ SMB_OFF_T offset,
+ SMB_OFF_T len)
+{
+ VFS_FIND(posix_fallocate);
+ return handle->fns->posix_fallocate(handle, fsp, offset, len);
+}
+
int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle,
struct files_struct *fsp, uint32 share_mode,
uint32_t access_mask)