Lines Matching defs:pReqInt
147 PRTFILEAIOREQINTERNAL pReqInt = (PRTFILEAIOREQINTERNAL)RTMemAllocZ(sizeof(RTFILEAIOREQINTERNAL));
148 if (RT_UNLIKELY(!pReqInt))
152 pReqInt->AioCB.aio_sigevent.sigev_notify = SIGEV_KEVENT;
153 pReqInt->AioCB.aio_sigevent.sigev_value.sival_ptr = pReqInt;
154 pReqInt->pCtxInt = NULL;
155 pReqInt->u32Magic = RTFILEAIOREQ_MAGIC;
156 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
158 *phReq = (RTFILEAIOREQ)pReqInt;
170 PRTFILEAIOREQINTERNAL pReqInt = hReq;
171 RTFILEAIOREQ_VALID_RETURN(pReqInt);
172 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
177 ASMAtomicUoWriteU32(&pReqInt->u32Magic, ~RTFILEAIOREQ_MAGIC);
178 RTMemFree(pReqInt);
193 PRTFILEAIOREQINTERNAL pReqInt = hReq;
194 RTFILEAIOREQ_VALID_RETURN(pReqInt);
195 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
201 pReqInt->AioCB.aio_sigevent.sigev_notify = SIGEV_KEVENT;
202 pReqInt->AioCB.aio_sigevent.sigev_value.sival_ptr = pReqInt;
203 pReqInt->AioCB.aio_lio_opcode = uTransferDirection;
204 pReqInt->AioCB.aio_fildes = RTFileToNative(hFile);
205 pReqInt->AioCB.aio_offset = off;
206 pReqInt->AioCB.aio_nbytes = cbTransfer;
207 pReqInt->AioCB.aio_buf = pvBuf;
208 pReqInt->fFlush = false;
209 pReqInt->pvUser = pvUser;
210 pReqInt->pCtxInt = NULL;
211 pReqInt->Rc = VERR_FILE_AIO_IN_PROGRESS;
212 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
233 PRTFILEAIOREQINTERNAL pReqInt = (PRTFILEAIOREQINTERNAL)hReq;
235 RTFILEAIOREQ_VALID_RETURN(pReqInt);
237 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
239 pReqInt->fFlush = true;
240 pReqInt->AioCB.aio_fildes = RTFileToNative(hFile);
241 pReqInt->AioCB.aio_offset = 0;
242 pReqInt->AioCB.aio_nbytes = 0;
243 pReqInt->AioCB.aio_buf = NULL;
244 pReqInt->pvUser = pvUser;
245 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
252 PRTFILEAIOREQINTERNAL pReqInt = hReq;
253 RTFILEAIOREQ_VALID_RETURN_RC(pReqInt, NULL);
255 return pReqInt->pvUser;
260 PRTFILEAIOREQINTERNAL pReqInt = hReq;
261 RTFILEAIOREQ_VALID_RETURN(pReqInt);
262 RTFILEAIOREQ_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_NOT_SUBMITTED);
265 int rcBSD = aio_cancel(pReqInt->AioCB.aio_fildes, &pReqInt->AioCB);
273 AssertMsg(VALID_PTR(pReqInt->pCtxInt),
276 ASMAtomicDecS32(&pReqInt->pCtxInt->cRequests);
277 pReqInt->Rc = VERR_FILE_AIO_CANCELED;
278 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
291 PRTFILEAIOREQINTERNAL pReqInt = hReq;
292 RTFILEAIOREQ_VALID_RETURN(pReqInt);
294 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
295 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, PREPARED, VERR_FILE_AIO_NOT_SUBMITTED);
297 if ( (RT_SUCCESS(pReqInt->Rc))
299 *pcbTransfered = pReqInt->cbTransfered;
301 return pReqInt->Rc;
378 PRTFILEAIOREQINTERNAL pReqInt;
383 pReqInt = pahReqs[i];
384 if (RTFILEAIOREQ_IS_NOT_VALID(pReqInt))
389 pReqInt = pahReqs[iUndo];
390 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
391 pReqInt->pCtxInt = NULL;
392 pReqInt->AioCB.aio_sigevent.sigev_notify_kqueue = 0;
398 pReqInt->AioCB.aio_sigevent.sigev_notify_kqueue = pCtxInt->iKQueue;
399 pReqInt->pCtxInt = pCtxInt;
400 RTFILEAIOREQ_SET_STATE(pReqInt, SUBMITTED);
402 if (pReqInt->fFlush)
422 pReqInt = pahReqs[i];
423 rcBSD = aio_error(&pReqInt->AioCB);
428 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
429 pReqInt->pCtxInt = NULL;
434 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
435 pReqInt->Rc = RTErrConvertFromErrno(rcBSD);
436 pReqInt->pCtxInt = NULL;
437 pReqInt->cbTransfered = 0;
451 pReqInt = pahReqs[0];
452 RTFILEAIOREQ_VALID_RETURN(pReqInt);
454 if (pReqInt->fFlush)
460 rcBSD = aio_fsync(O_SYNC, &pReqInt->AioCB);
466 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
467 pReqInt->pCtxInt = NULL;
472 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
473 pReqInt->Rc = RTErrConvertFromErrno(errno);
474 pReqInt->cbTransfered = 0;
475 return pReqInt->Rc;
555 PRTFILEAIOREQINTERNAL pReqInt = (PRTFILEAIOREQINTERNAL)aKEvents[i].udata;
556 AssertPtr(pReqInt);
557 Assert(pReqInt->u32Magic == RTFILEAIOREQ_MAGIC);
567 int cbTransfered = aio_return(&pReqInt->AioCB);
571 pReqInt->Rc = RTErrConvertFromErrno(cbTransfered);
572 pReqInt->cbTransfered = 0;
576 pReqInt->Rc = VINF_SUCCESS;
577 pReqInt->cbTransfered = cbTransfered;
579 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
580 pahReqs[cRequestsCompleted++] = (RTFILEAIOREQ)pReqInt;