summaryrefslogtreecommitdiff
path: root/source3/include
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/include
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/include')
-rw-r--r--source3/include/smbprofile.h4
-rw-r--r--source3/include/vfs.h10
-rw-r--r--source3/include/vfs_macros.h5
3 files changed, 19 insertions, 0 deletions
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index 5015d2a9e4..647bf17e64 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -179,6 +179,10 @@ 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_FCNTL_LOCK,
#define syscall_fcntl_lock_count __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_LOCK, count)
#define syscall_fcntl_lock_time __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_LOCK, time)
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 9121069a27..cb49a17ce2 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -128,6 +128,8 @@
/* Changed to version 28 - Add private_flags uint32_t to CREATE call. */
/* Leave at 28 - not yet released. Change realpath to assume NULL and return a
malloc'ed path. JRA. */
+/* Leave at 28 - not yet released. Move posix_fallocate into the VFS
+ where it belongs. JRA. */
#define SMB_VFS_INTERFACE_VERSION 28
@@ -250,6 +252,10 @@ 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,
+ struct files_struct *fsp,
+ 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);
int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp,
uint32 share_mode, uint32_t access_mask);
@@ -602,6 +608,10 @@ 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,
+ struct files_struct *fsp,
+ SMB_OFF_T offset,
+ SMB_OFF_T len);
bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
struct files_struct *fsp, int op, SMB_OFF_T offset,
SMB_OFF_T count, int type);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 5b38e64cbf..2eedd2bfbb 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -249,6 +249,11 @@
#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_LOCK(fsp, op, offset, count, type) \
smb_vfs_call_lock((fsp)->conn->vfs_handles, (fsp), (op), (offset), (count), (type))
#define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) \