s3: VFS: vfs_default. Pass in struct vfswrap_fsync_state as the callback data to...
[metze/samba-autobuild/.git] / source3 / modules / vfs_default.c
index 28b8c04dee42eb8cd320bd90be19bcf064c58c99..f9d958a003dd831a13588a6d4405268a12afd857 100644 (file)
@@ -1116,7 +1116,7 @@ static struct tevent_req *vfswrap_fsync_send(struct vfs_handle_struct *handle,
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       tevent_req_set_callback(subreq, vfs_fsync_done, req);
+       tevent_req_set_callback(subreq, vfs_fsync_done, state);
 
        talloc_set_destructor(state, vfs_fsync_state_destructor);
 
@@ -1156,10 +1156,9 @@ static int vfs_fsync_state_destructor(struct vfswrap_fsync_state *state)
 
 static void vfs_fsync_done(struct tevent_req *subreq)
 {
-       struct tevent_req *req = tevent_req_callback_data(
-               subreq, struct tevent_req);
-       struct vfswrap_fsync_state *state = tevent_req_data(
-               req, struct vfswrap_fsync_state);
+       struct vfswrap_fsync_state *state = tevent_req_callback_data(
+               subreq, struct vfswrap_fsync_state);
+       struct tevent_req *req = state->req;
        int ret;
 
        ret = pthreadpool_tevent_job_recv(subreq);