diff options
author | Ralph Boehme <slow@samba.org> | 2017-06-03 12:57:59 +0200 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2017-07-03 19:59:07 +0200 |
commit | af6cbc7a441e05f71ae4e97c7d82c27868633e53 (patch) | |
tree | 9ab33e5a413195193694174fbb5c205cad1db1c0 /source3/smbd | |
parent | 47600c4977fb013f6f7c63f90ac9d64eac71bd71 (diff) | |
download | samba-af6cbc7a441e05f71ae4e97c7d82c27868633e53.tar.gz |
s3/vfs: add SMB_VFS_OFFLOAD_READ_SEND/RECV
Add SMB_VFS_OFFLOAD_READ_SEND an SMB_VFS_OFFLOAD_READ_RECV.
This paves the way for supporting server-side copy-chunk with source and
destination file-handles on different shares. It can be used to
implement copy offload fsctl in the future, but for now this will be
used as a mere copy-chunk replacement.
SMB_VFS_OFFLOAD_READ generates a token that associates an fsp with the
token and stores the fsp in a in-memory db.
Initially only a copy-chunk resume key fsctl is supported. In the future
this can be enhanced to support real offload fsctl.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/vfs.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 8304ef18b18..2088dbe7979 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -2350,6 +2350,30 @@ NTSTATUS smb_vfs_call_fset_dos_attributes(struct vfs_handle_struct *handle, return handle->fns->fset_dos_attributes_fn(handle, fsp, dosmode); } +struct tevent_req *smb_vfs_call_offload_read_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct vfs_handle_struct *handle, + struct files_struct *fsp, + uint32_t fsctl, + uint32_t ttl, + off_t offset, + size_t to_copy) +{ + VFS_FIND(offload_read_send); + return handle->fns->offload_read_send_fn(mem_ctx, ev, handle, + fsp, fsctl, + ttl, offset, to_copy); +} + +NTSTATUS smb_vfs_call_offload_read_recv(struct tevent_req *req, + struct vfs_handle_struct *handle, + TALLOC_CTX *mem_ctx, + DATA_BLOB *token_blob) +{ + VFS_FIND(offload_read_recv); + return handle->fns->offload_read_recv_fn(req, handle, mem_ctx, token_blob); +} + struct tevent_req *smb_vfs_call_copy_chunk_send(struct vfs_handle_struct *handle, TALLOC_CTX *mem_ctx, struct tevent_context *ev, |