diff options
Diffstat (limited to 'source3/modules/vfs_streams_xattr.c')
-rw-r--r-- | source3/modules/vfs_streams_xattr.c | 26 |
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, }; |