From: Stefan Metzmacher Date: Thu, 22 Mar 2018 09:54:41 +0000 (+0100) Subject: vfs_default: maintain vfswrap_offload_write_state->{src_ev,dst_ev} X-Git-Tag: tevent-0.9.37~291 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db83a8f7c86946d478a55b611779b9666a47cabc;p=thirdparty%2Fsamba.git vfs_default: maintain vfswrap_offload_write_state->{src_ev,dst_ev} These get filled with impersonation wrappers in the following commits. Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index baeb285eeb3..ede11ad34ed 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -1584,13 +1584,14 @@ static NTSTATUS vfswrap_offload_read_recv(struct tevent_req *req, } struct vfswrap_offload_write_state { - struct tevent_context *ev; uint8_t *buf; bool read_lck_locked; bool write_lck_locked; DATA_BLOB *token; + struct tevent_context *src_ev; struct files_struct *src_fsp; off_t src_off; + struct tevent_context *dst_ev; struct files_struct *dst_fsp; off_t dst_off; off_t to_copy; @@ -1641,9 +1642,9 @@ static struct tevent_req *vfswrap_offload_write_send( } *state = (struct vfswrap_offload_write_state) { - .ev = ev, .token = token, .src_off = transfer_offset, + .dst_ev = ev, .dst_fsp = dest_fsp, .dst_off = dest_off, .to_copy = to_copy, @@ -1685,7 +1686,6 @@ static struct tevent_req *vfswrap_offload_write_send( if (tevent_req_nterror(req, status)) { return tevent_req_post(req, ev); } - state->src_fsp = src_fsp; DBG_DEBUG("server side copy chunk of length %" PRIu64 "\n", to_copy); @@ -1701,6 +1701,9 @@ static struct tevent_req *vfswrap_offload_write_send( return tevent_req_post(req, ev); } + state->src_ev = state->src_fsp->conn->sconn->ev_ctx; + state->src_fsp = src_fsp; + state->buf = talloc_array(state, uint8_t, num); if (tevent_req_nomem(state->buf, req)) { return tevent_req_post(req, ev); @@ -1765,7 +1768,7 @@ static NTSTATUS vfswrap_offload_write_loop(struct tevent_req *req) } subreq = SMB_VFS_PREAD_SEND(state, - state->src_fsp->conn->sconn->ev_ctx, + state->src_ev, state->src_fsp, state->buf, state->next_io_size, @@ -1829,7 +1832,7 @@ static void vfswrap_offload_write_read_done(struct tevent_req *subreq) } subreq = SMB_VFS_PWRITE_SEND(state, - state->ev, + state->dst_ev, state->dst_fsp, state->buf, state->next_io_size,