This allows the caller to free the link before the request.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14430
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
DATA_BLOB in_data,
bool write_through);
bool cancel_smb2_aio(struct smb_request *smbreq);
-bool aio_add_req_to_fsp(files_struct *fsp, struct tevent_req *req);
+struct aio_req_fsp_link;
+struct aio_req_fsp_link *aio_add_req_to_fsp(files_struct *fsp, struct tevent_req *req);
struct aio_extra *create_aio_extra(TALLOC_CTX *mem_ctx,
files_struct *fsp,
size_t buflen);
return 0;
}
-bool aio_add_req_to_fsp(files_struct *fsp, struct tevent_req *req)
+struct aio_req_fsp_link *aio_add_req_to_fsp(files_struct *fsp, struct tevent_req *req)
{
size_t array_len;
struct aio_req_fsp_link *lnk;
lnk = talloc(req, struct aio_req_fsp_link);
if (lnk == NULL) {
- return false;
+ return NULL;
}
array_len = talloc_array_length(fsp->aio_requests);
if (fsp->num_aio_requests + 10 < 10) {
/* Integer wrap. */
TALLOC_FREE(lnk);
- return false;
+ return NULL;
}
/*
fsp->num_aio_requests+10);
if (tmp == NULL) {
TALLOC_FREE(lnk);
- return false;
+ return NULL;
}
fsp->aio_requests = tmp;
}
#endif
talloc_set_destructor(lnk, aio_del_req_from_fsp);
- return true;
+ return lnk;
}
struct pwrite_fsync_state {