Changeset 23340 in vbox for trunk/src/VBox
- Timestamp:
- Sep 25, 2009 3:43:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/fileaio-posix.cpp
r20961 r23340 421 421 AssertPtrReturn(phAioCtx, VERR_INVALID_POINTER); 422 422 423 if (cAioReqsMax == RTFILEAIO_UNLIMITED_REQS) 424 return VERR_OUT_OF_RANGE; 425 423 426 pCtxInt = (PRTFILEAIOCTXINTERNAL)RTMemAllocZ( sizeof(RTFILEAIOCTXINTERNAL) 424 427 + cAioReqsMax * sizeof(PRTFILEAIOREQINTERNAL)); … … 591 594 } 592 595 593 /* Check if we have a flush request now. */ 596 /* 597 * Check if we have a flush request now. 598 * If not we hit the AIO_LISTIO_MAX limit 599 * and will continue submitting requests 600 * above. 601 */ 594 602 if (cReqs) 595 603 { … … 597 605 RTFILEAIOREQ_VALID_RETURN(pReqInt); 598 606 599 Assert(pReqInt->fFlush); 600 601 /* 602 * lio_listio does not work with flush requests so 603 * we have to use aio_fsync directly. 604 */ 605 rcPosix = aio_fsync(O_SYNC, &pReqInt->AioCB); 606 if (RT_UNLIKELY(rcPosix < 0)) 607 608 if (pReqInt->fFlush) 607 609 { 608 rc = RTErrConvertFromErrno(errno); 609 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED); 610 pReqInt->Rc = rc; 611 pReqInt->cbTransfered = 0; 612 613 /* Unlink from the list. */ 614 PRTFILEAIOREQINTERNAL pNext, pPrev; 615 pNext = pReqInt->pNext; 616 pPrev = pReqInt->pPrev; 617 if (pNext) 618 pNext->pPrev = pPrev; 619 if (pPrev) 620 pPrev->pNext = pNext; 621 else 622 pHead = pNext; 623 break; 610 /* 611 * lio_listio does not work with flush requests so 612 * we have to use aio_fsync directly. 613 */ 614 rcPosix = aio_fsync(O_SYNC, &pReqInt->AioCB); 615 if (RT_UNLIKELY(rcPosix < 0)) 616 { 617 rc = RTErrConvertFromErrno(errno); 618 RTFILEAIOREQ_SET_STATE(pReqInt, COMPLETED); 619 pReqInt->Rc = rc; 620 pReqInt->cbTransfered = 0; 621 622 /* Unlink from the list. */ 623 PRTFILEAIOREQINTERNAL pNext, pPrev; 624 pNext = pReqInt->pNext; 625 pPrev = pReqInt->pPrev; 626 if (pNext) 627 pNext->pPrev = pPrev; 628 if (pPrev) 629 pPrev->pNext = pNext; 630 else 631 pHead = pNext; 632 break; 633 } 634 635 ASMAtomicIncS32(&pCtxInt->cRequests); 636 cReqs--; 637 pahReqs++; 624 638 } 625 626 ASMAtomicIncS32(&pCtxInt->cRequests);627 cReqs--;628 pahReqs++;629 639 } 630 640 } while (cReqs);
Note:
See TracChangeset
for help on using the changeset viewer.