diff options
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/smbprofile.h | 6 | ||||
-rw-r--r-- | source3/include/vfs.h | 13 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 8 |
3 files changed, 18 insertions, 9 deletions
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 647bf17e64..ff8ab90ce1 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -179,9 +179,9 @@ enum profile_stats_values #define syscall_ftruncate_count __profile_stats_value(PR_VALUE_SYSCALL_FTRUNCATE, count) #define syscall_ftruncate_time __profile_stats_value(PR_VALUE_SYSCALL_FTRUNCATE, time) - PR_VALUE_SYSCALL_POSIX_FALLOCATE, -#define syscall_posix_fallocate_count __profile_stats_value(PR_VALUE_SYSCALL_POSIX_FALLOCATE, count) -#define syscall_posix_fallocate_time __profile_stats_value(PR_VALUE_SYSCALL_POSIX_FALLOCATE, time) + PR_VALUE_SYSCALL_FALLOCATE, +#define syscall_fallocate_count __profile_stats_value(PR_VALUE_SYSCALL_FALLOCATE, count) +#define syscall_fallocate_time __profile_stats_value(PR_VALUE_SYSCALL_FALLOCATE, time) PR_VALUE_SYSCALL_FCNTL_LOCK, #define syscall_fcntl_lock_count __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_LOCK, count) 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, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 2eedd2bfbb..bb6428ead5 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -249,10 +249,10 @@ #define SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset) \ smb_vfs_call_ftruncate((handle)->next, (fsp), (offset)) -#define SMB_VFS_POSIX_FALLOCATE(fsp, offset, len) \ - smb_vfs_call_posix_fallocate((fsp)->conn->vfs_handles, (fsp), (offset), (len)) -#define SMB_VFS_NEXT_POSIX_FALLOCATE(handle, fsp, offset, len) \ - smb_vfs_call_posix_fallocate((handle)->next, (fsp), (offset), (len)) +#define SMB_VFS_FALLOCATE(fsp, mode, offset, len) \ + smb_vfs_call_fallocate((fsp)->conn->vfs_handles, (fsp), (mode), (offset), (len)) +#define SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len) \ + smb_vfs_call_fallocate((handle)->next, (fsp), (mode), (offset), (len)) #define SMB_VFS_LOCK(fsp, op, offset, count, type) \ smb_vfs_call_lock((fsp)->conn->vfs_handles, (fsp), (op), (offset), (count), (type)) |