Lines Matching refs:pReqInt
355 PRTFILEAIOREQINTERNAL pReqInt = (PRTFILEAIOREQINTERNAL)RTMemAllocZ(sizeof(RTFILEAIOREQINTERNAL));
356 if (RT_UNLIKELY(!pReqInt))
359 pReqInt->pCtxInt = NULL;
360 pReqInt->u32Magic = RTFILEAIOREQ_MAGIC;
361 pReqInt->iWaitingList = RTFILEAIOCTX_WAIT_ENTRY_INVALID;
362 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
364 *phReq = (RTFILEAIOREQ)pReqInt;
377 PRTFILEAIOREQINTERNAL pReqInt = hReq;
378 RTFILEAIOREQ_VALID_RETURN(pReqInt);
379 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
384 ASMAtomicUoWriteU32(&pReqInt->u32Magic, ~RTFILEAIOREQ_MAGIC);
385 RTMemFree(pReqInt);
400 PRTFILEAIOREQINTERNAL pReqInt = hReq;
401 RTFILEAIOREQ_VALID_RETURN(pReqInt);
402 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
408 memset(&pReqInt->AioCB, 0, sizeof(struct aiocb));
409 pReqInt->fFlush = false;
410 pReqInt->AioCB.aio_lio_opcode = uTransferDirection;
411 pReqInt->AioCB.aio_fildes = RTFileToNative(hFile);
412 pReqInt->AioCB.aio_offset = off;
413 pReqInt->AioCB.aio_nbytes = cbTransfer;
414 pReqInt->AioCB.aio_buf = pvBuf;
415 pReqInt->pvUser = pvUser;
416 pReqInt->pCtxInt = NULL;
417 pReqInt->Rc = VERR_FILE_AIO_IN_PROGRESS;
418 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
442 PRTFILEAIOREQINTERNAL pReqInt = (PRTFILEAIOREQINTERNAL)hReq;
444 RTFILEAIOREQ_VALID_RETURN(pReqInt);
445 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
448 pReqInt->fFlush = true;
449 pReqInt->AioCB.aio_fildes = RTFileToNative(hFile);
450 pReqInt->AioCB.aio_offset = 0;
451 pReqInt->AioCB.aio_nbytes = 0;
452 pReqInt->AioCB.aio_buf = NULL;
453 pReqInt->pvUser = pvUser;
454 pReqInt->Rc = VERR_FILE_AIO_IN_PROGRESS;
455 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
463 PRTFILEAIOREQINTERNAL pReqInt = hReq;
464 RTFILEAIOREQ_VALID_RETURN_RC(pReqInt, NULL);
466 return pReqInt->pvUser;
472 PRTFILEAIOREQINTERNAL pReqInt = hReq;
473 RTFILEAIOREQ_VALID_RETURN(pReqInt);
474 RTFILEAIOREQ_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_NOT_SUBMITTED);
476 ASMAtomicXchgBool(&pReqInt->fCanceled, true);
478 int rcPosix = aio_cancel(pReqInt->AioCB.aio_fildes, &pReqInt->AioCB);
482 PRTFILEAIOCTXINTERNAL pCtxInt = pReqInt->pCtxInt;
490 ASMAtomicWritePtr(&pCtxInt->pReqToCancel, pReqInt);
498 pReqInt->Rc = VERR_FILE_AIO_CANCELED;
499 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
513 PRTFILEAIOREQINTERNAL pReqInt = hReq;
514 RTFILEAIOREQ_VALID_RETURN(pReqInt);
515 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
516 RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, PREPARED, VERR_FILE_AIO_NOT_SUBMITTED);
519 if ( (RT_SUCCESS(pReqInt->Rc))
521 *pcbTransfered = pReqInt->cbTransfered;
523 return pReqInt->Rc;
642 PRTFILEAIOREQINTERNAL pReqInt;
647 pReqInt = pahReqs[i];
648 if (RTFILEAIOREQ_IS_NOT_VALID(pReqInt))
653 pReqInt = pahReqs[iUndo];
654 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
655 pReqInt->pCtxInt = NULL;
659 pNext = pReqInt->pNext;
660 pPrev = pReqInt->pPrev;
672 pReqInt->pCtxInt = pCtxInt;
674 if (pReqInt->fFlush)
678 pReqInt->pNext = pHead;
680 pHead->pPrev = pReqInt;
681 pReqInt->pPrev = NULL;
682 pHead = pReqInt;
683 RTFILEAIOREQ_SET_STATE(pReqInt, SUBMITTED);
704 pReqInt = pahReqs[i];
706 rcPosix = aio_error(&pReqInt->AioCB);
719 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
724 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
733 pReqInt->Rc = RTErrConvertFromErrno(errno);
735 pReqInt->Rc = RTErrConvertFromErrno(rcPosix);
737 pReqInt->cbTransfered = 0;
741 pNext = pReqInt->pNext;
742 pPrev = pReqInt->pPrev;
750 pReqInt->pNext = NULL;
751 pReqInt->pPrev = NULL;
773 pReqInt = pahReqs[0];
775 if (pReqInt->fFlush)
781 rcPosix = aio_fsync(O_SYNC, &pReqInt->AioCB);
787 RTFILEAIOREQ_SET_STATE(pReqInt, PREPARED);
792 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED);
793 pReqInt->Rc = rc;
795 pReqInt->cbTransfered = 0;
800 pReqInt->pNext = pHead;
802 pHead->pPrev = pReqInt;
803 pReqInt->pPrev = NULL;
804 pHead = pReqInt;
805 RTFILEAIOREQ_SET_STATE(pReqInt, SUBMITTED);