summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_streams_xattr.c
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/modules/vfs_streams_xattr.c
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/modules/vfs_streams_xattr.c')
-rw-r--r--source3/modules/vfs_streams_xattr.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
index 218e5ec078..8870c6e471 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -1023,6 +1023,31 @@ static int streams_xattr_ftruncate(struct vfs_handle_struct *handle,
return 0;
}
+static int streams_xattr_posix_fallocate(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ SMB_OFF_T offset,
+ SMB_OFF_T len)
+{
+ struct stream_io *sio =
+ (struct stream_io *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
+
+ DEBUG(10, ("streams_xattr_posix_fallocate called for file %s offset %.0f"
+ "len = %.0f\n",
+ fsp_str_dbg(fsp), (double)offset, (double)len));
+
+ if (sio == NULL) {
+ return SMB_VFS_NEXT_POSIX_FALLOCATE(handle, fsp, offset, len);
+ }
+
+ if (!streams_xattr_recheck(sio)) {
+ return -1;
+ }
+
+ /* Let the pwrite code path handle it. */
+ return ENOSYS;
+}
+
+
static struct vfs_fn_pointers vfs_streams_xattr_fns = {
.fs_capabilities = streams_xattr_fs_capabilities,
.open = streams_xattr_open,
@@ -1034,6 +1059,7 @@ static struct vfs_fn_pointers vfs_streams_xattr_fns = {
.unlink = streams_xattr_unlink,
.rename = streams_xattr_rename,
.ftruncate = streams_xattr_ftruncate,
+ .posix_fallocate = streams_xattr_posix_fallocate,
.streaminfo = streams_xattr_streaminfo,
};