static void vfs_pread_do(void *private_data);
static void vfs_pread_done(struct tevent_req *subreq);
+static int vfs_pread_state_destructor(struct vfswrap_pread_state *state);
static struct tevent_req *vfswrap_pread_send(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
}
tevent_req_set_callback(subreq, vfs_pread_done, req);
+ talloc_set_destructor(state, vfs_pread_state_destructor);
+
return req;
}
SMBPROFILE_BYTES_ASYNC_SET_IDLE(state->profile_bytes);
}
+static int vfs_pread_state_destructor(struct vfswrap_pread_state *state)
+{
+ return -1;
+}
+
static void vfs_pread_done(struct tevent_req *subreq)
{
struct tevent_req *req = tevent_req_callback_data(
subreq, struct tevent_req);
-#ifdef WITH_PROFILE
struct vfswrap_pread_state *state = tevent_req_data(
req, struct vfswrap_pread_state);
-#endif
int ret;
ret = pthreadpool_tevent_job_recv(subreq);
TALLOC_FREE(subreq);
SMBPROFILE_BYTES_ASYNC_END(state->profile_bytes);
+ talloc_set_destructor(state, NULL);
if (tevent_req_error(req, ret)) {
return;
}
static void vfs_pwrite_do(void *private_data);
static void vfs_pwrite_done(struct tevent_req *subreq);
+static int vfs_pwrite_state_destructor(struct vfswrap_pwrite_state *state);
static struct tevent_req *vfswrap_pwrite_send(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
}
tevent_req_set_callback(subreq, vfs_pwrite_done, req);
+ talloc_set_destructor(state, vfs_pwrite_state_destructor);
+
return req;
}
SMBPROFILE_BYTES_ASYNC_SET_IDLE(state->profile_bytes);
}
+static int vfs_pwrite_state_destructor(struct vfswrap_pwrite_state *state)
+{
+ return -1;
+}
+
static void vfs_pwrite_done(struct tevent_req *subreq)
{
struct tevent_req *req = tevent_req_callback_data(
subreq, struct tevent_req);
-#ifdef WITH_PROFILE
struct vfswrap_pwrite_state *state = tevent_req_data(
req, struct vfswrap_pwrite_state);
-#endif
int ret;
ret = pthreadpool_tevent_job_recv(subreq);
TALLOC_FREE(subreq);
SMBPROFILE_BYTES_ASYNC_END(state->profile_bytes);
+ talloc_set_destructor(state, NULL);
if (tevent_req_error(req, ret)) {
return;
}
static void vfs_fsync_do(void *private_data);
static void vfs_fsync_done(struct tevent_req *subreq);
+static int vfs_fsync_state_destructor(struct vfswrap_fsync_state *state);
static struct tevent_req *vfswrap_fsync_send(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
}
tevent_req_set_callback(subreq, vfs_fsync_done, req);
+ talloc_set_destructor(state, vfs_fsync_state_destructor);
+
return req;
}
state->vfs_aio_state.duration = nsec_time_diff(&end_time, &start_time);
}
+static int vfs_fsync_state_destructor(struct vfswrap_fsync_state *state)
+{
+ return -1;
+}
+
static void vfs_fsync_done(struct tevent_req *subreq)
{
struct tevent_req *req = tevent_req_callback_data(
subreq, struct tevent_req);
-#ifdef WITH_PROFILE
struct vfswrap_fsync_state *state = tevent_req_data(
req, struct vfswrap_fsync_state);
-#endif
int ret;
ret = pthreadpool_tevent_job_recv(subreq);
TALLOC_FREE(subreq);
SMBPROFILE_BASIC_ASYNC_END(state->profile_basic);
+ talloc_set_destructor(state, NULL);
if (tevent_req_error(req, ret)) {
return;
}