summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2021-06-22 20:13:02 +0200
committerJeremy Allison <jra@samba.org>2021-10-08 19:28:32 +0000
commit8fa7848b4a002900e0c3384d2e0d41ea0fdf6ea9 (patch)
tree1a0adbd3e712540f693cb6bb1bdab0d45a77a4ed /examples
parent3afd4bd61033773312605102f7203ef54e2e0986 (diff)
downloadsamba-8fa7848b4a002900e0c3384d2e0d41ea0fdf6ea9.tar.gz
vfs: Add flags and xferlen args to SMB_VFS_OFFLOAD_READ_RECV
We missed these values which follow from MS-FSCC 2.3.80 “FSCTL_OFFLOAD_READ Reply”: Flags (4 bytes): A 32-bit unsigned integer that indicates which flags were returned for this operation. Possible values for the flags follow. All unused bits are reserved for future use, SHOULD be set to 0, and MUST be ignored. OFFLOAD_READ_FLAG_ALL_ZERO_BEYOND_CURRENT_RANGE (0x00000001) => The data beyond the current range is logically equivalent to zero. TransferLength (8 bytes): A 64-bit unsigned integer that contains the amount, in bytes, of data that the Token logically represents. This value indicates a contiguous region of the file from the beginning of the requested offset in the FileOffset field in the FSCTL_OFFLOAD_READ_INPUT data element (section 2.3.79). This value can be smaller than the CopyLength field specified in the FSCTL_OFFLOAD_READ_INPUT data element, which indicates that less data was logically represented (logically read) with the Token than was requested. The value of this field MUST be greater than 0x0000000000000000 and MUST be aligned to a logical sector boundary on the volume. As we currently only implement COPY_CHUNK over the OFFLOAD VFS interface, the VFS COPY_CHUNK backend in vfs_default just sets both values to 0 and they are unused in the SMB frontend. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/VFS/skel_opaque.c2
-rw-r--r--examples/VFS/skel_transparent.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index f393332c681..cc7bb880d5c 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -560,6 +560,8 @@ static struct tevent_req *skel_offload_read_send(
static NTSTATUS skel_offload_read_recv(struct tevent_req *req,
struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
+ uint32_t *flags,
+ uint64_t *xferlen,
DATA_BLOB *_token_blob)
{
NTSTATUS status;
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index d6bf3171b95..e145881b704 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -667,6 +667,8 @@ static uint64_t skel_fs_file_id(vfs_handle_struct *handle,
struct skel_offload_read_state {
struct vfs_handle_struct *handle;
+ uint32_t flags;
+ uint64_t xferlen;
DATA_BLOB token;
};
@@ -714,6 +716,8 @@ static void skel_offload_read_done(struct tevent_req *subreq)
status = SMB_VFS_NEXT_OFFLOAD_READ_RECV(subreq,
state->handle,
state,
+ &state->flags,
+ &state->xferlen,
&state->token);
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {
@@ -727,6 +731,8 @@ static void skel_offload_read_done(struct tevent_req *subreq)
static NTSTATUS skel_offload_read_recv(struct tevent_req *req,
struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
+ uint32_t *flags,
+ uint64_t *xferlen,
DATA_BLOB *_token)
{
struct skel_offload_read_state *state = tevent_req_data(
@@ -749,6 +755,8 @@ static NTSTATUS skel_offload_read_recv(struct tevent_req *req,
return NT_STATUS_NO_MEMORY;
}
+ *flags = state->flags;
+ *xferlen = state->xferlen;
*_token = token;
return NT_STATUS_OK;
}