Revert "s3: VFS: vfs_default. Pass in struct vfswrap_pwrite_state as the callback...
authorJeremy Allison <jra@samba.org>
Fri, 13 Mar 2020 17:39:46 +0000 (10:39 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 18 Mar 2020 18:03:31 +0000 (18:03 +0000)
This reverts commit 13e25d68385aa951115e0e063ec6a9a281fea4a4.

Now we wait for all aio to finish on all SHUTDOWN_CLOSE
cases, this is no longer needed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_default.c

index 641764e41f1fcea9636848701a8e292782f0c6a3..cbc8335cd12433009ce9845e7741ba5d8a0db7d0 100644 (file)
@@ -976,7 +976,7 @@ static struct tevent_req *vfswrap_pwrite_send(struct vfs_handle_struct *handle,
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, vfs_pwrite_done, state);
+       tevent_req_set_callback(subreq, vfs_pwrite_done, req);
 
        talloc_set_destructor(state, vfs_pwrite_state_destructor);
 
@@ -1017,9 +1017,10 @@ static int vfs_pwrite_state_destructor(struct vfswrap_pwrite_state *state)
 
 static void vfs_pwrite_done(struct tevent_req *subreq)
 {
-       struct vfswrap_pwrite_state *state = tevent_req_callback_data(
-               subreq, struct vfswrap_pwrite_state);
-       struct tevent_req *req = state->req;
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct vfswrap_pwrite_state *state = tevent_req_data(
+               req, struct vfswrap_pwrite_state);
        int ret;
 
        ret = pthreadpool_tevent_job_recv(subreq);