summaryrefslogtreecommitdiff
path: root/source3/include/vfs.h
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/include/vfs.h
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/include/vfs.h')
-rw-r--r--source3/include/vfs.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index cb49a17ce2..72d61e330f 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -130,6 +130,8 @@
malloc'ed path. JRA. */
/* Leave at 28 - not yet released. Move posix_fallocate into the VFS
where it belongs. JRA. */
+/* Leave at 28 - not yet released. Rename posix_fallocate to fallocate
+ to split out the two possible uses. JRA. */
#define SMB_VFS_INTERFACE_VERSION 28
@@ -168,6 +170,11 @@ enum vfs_translate_direction {
vfs_translate_to_windows
};
+enum vfs_fallocate_mode {
+ VFS_FALLOCATE_EXTEND_SIZE = 0,
+ VFS_FALLOCATE_KEEP_SIZE = 1
+};
+
/*
Available VFS operations. These values must be in sync with vfs_ops struct
(struct vfs_fn_pointers and struct vfs_handle_pointers inside of struct vfs_ops).
@@ -252,8 +259,9 @@ struct vfs_fn_pointers {
const struct smb_filename *smb_fname,
struct smb_file_time *ft);
int (*ftruncate)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset);
- int (*posix_fallocate)(struct vfs_handle_struct *handle,
+ int (*fallocate)(struct vfs_handle_struct *handle,
struct files_struct *fsp,
+ enum vfs_fallocate_mode mode,
SMB_OFF_T offset,
SMB_OFF_T len);
bool (*lock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
@@ -608,8 +616,9 @@ int smb_vfs_call_ntimes(struct vfs_handle_struct *handle,
struct smb_file_time *ft);
int smb_vfs_call_ftruncate(struct vfs_handle_struct *handle,
struct files_struct *fsp, SMB_OFF_T offset);
-int smb_vfs_call_posix_fallocate(struct vfs_handle_struct *handle,
+int smb_vfs_call_fallocate(struct vfs_handle_struct *handle,
struct files_struct *fsp,
+ enum vfs_fallocate_mode mode,
SMB_OFF_T offset,
SMB_OFF_T len);
bool smb_vfs_call_lock(struct vfs_handle_struct *handle,