Lines Matching refs:reqp
350 aio_req_t *reqp; in _aiorw() local
424 if ((reqp = _aio_req_alloc()) == NULL) { in _aiorw()
433 reqp->req_op = mode; in _aiorw()
434 reqp->req_resultp = resultp; in _aiorw()
435 ap = &reqp->req_args; in _aiorw()
441 if (_aio_hash_insert(resultp, reqp) != 0) { in _aiorw()
442 _aio_req_free(reqp); in _aiorw()
450 _aio_req_add(reqp, &__nextworker_rw, umode); in _aiorw()
457 aio_req_t *reqp; in aiocancel() local
469 reqp = _aio_hash_find(resultp); in aiocancel()
470 if (reqp == NULL) { in aiocancel()
477 aiowp = reqp->req_worker; in aiocancel()
479 (void) _aio_cancel_req(aiowp, reqp, &canceled, &done); in aiocancel()
689 aio_req_t *reqp; in aiocancel_all() local
721 while ((reqp = *reqpp) != NULL) { in aiocancel_all()
722 if (cancelall || reqp->req_args.fd == fd) { in aiocancel_all()
723 *reqpp = reqp->req_next; in aiocancel_all()
724 if (last == reqp) { in aiocancel_all()
725 last = reqp->req_next; in aiocancel_all()
727 if (_aio_done_head == reqp) { in aiocancel_all()
732 _aio_set_result(reqp, -1, ECANCELED); in aiocancel_all()
733 (void) _aio_hash_del(reqp->req_resultp); in aiocancel_all()
734 _aio_req_free(reqp); in aiocancel_all()
736 reqpp = &reqp->req_next; in aiocancel_all()
737 last = reqp; in aiocancel_all()
765 aio_req_t *reqp; in _aio_cancel_work() local
771 reqp = aiowp->work_tail1; in _aio_cancel_work()
772 while (reqp != NULL) { in _aio_cancel_work()
773 if (fd < 0 || reqp->req_args.fd == fd) { in _aio_cancel_work()
774 if (_aio_cancel_req(aiowp, reqp, canceled, done)) { in _aio_cancel_work()
780 reqp = aiowp->work_tail1; in _aio_cancel_work()
784 reqp = reqp->req_next; in _aio_cancel_work()
790 if ((reqp = aiowp->work_req) != NULL && in _aio_cancel_work()
791 (fd < 0 || reqp->req_args.fd == fd)) in _aio_cancel_work()
792 (void) _aio_cancel_req(aiowp, reqp, canceled, done); in _aio_cancel_work()
801 _aio_cancel_req(aio_worker_t *aiowp, aio_req_t *reqp, int *canceled, int *done) in _aio_cancel_req() argument
803 int ostate = reqp->req_state; in _aio_cancel_req()
809 if (ostate == AIO_REQ_DONE && !POSIX_AIO(reqp) && in _aio_cancel_req()
810 aiowp->work_prev1 == reqp) { in _aio_cancel_req()
819 _aio_set_result(reqp, -1, ECANCELED); in _aio_cancel_req()
820 (void) _aio_hash_del(reqp->req_resultp); in _aio_cancel_req()
821 reqp->req_state = AIO_REQ_CANCELED; in _aio_cancel_req()
830 if (reqp->req_op == AIOFSYNC && reqp != aiowp->work_req) { in _aio_cancel_req()
831 ASSERT(POSIX_AIO(reqp)); in _aio_cancel_req()
833 if (!reqp->req_head->lio_canned) { in _aio_cancel_req()
834 reqp->req_head->lio_canned = 1; in _aio_cancel_req()
840 reqp->req_state = AIO_REQ_CANCELED; in _aio_cancel_req()
841 _aio_req_del(aiowp, reqp, ostate); in _aio_cancel_req()
842 (void) _aio_hash_del(reqp->req_resultp); in _aio_cancel_req()
844 if (reqp == aiowp->work_req) { in _aio_cancel_req()
853 _aio_set_result(reqp, -1, ECANCELED); in _aio_cancel_req()
857 if (!POSIX_AIO(reqp)) { in _aio_cancel_req()
859 _aio_set_result(reqp, -1, ECANCELED); in _aio_cancel_req()
860 _aio_req_free(reqp); in _aio_cancel_req()
865 _aiodone(reqp, -1, ECANCELED); in _aio_cancel_req()
872 _aio_create_worker(aio_req_t *reqp, int mode) in _aio_create_worker() argument
911 if (reqp) { in _aio_create_worker()
912 reqp->req_state = AIO_REQ_QUEUED; in _aio_create_worker()
913 reqp->req_worker = aiowp; in _aio_create_worker()
914 aiowp->work_head1 = reqp; in _aio_create_worker()
915 aiowp->work_tail1 = reqp; in _aio_create_worker()
916 aiowp->work_next1 = reqp; in _aio_create_worker()
926 if (reqp) { in _aio_create_worker()
927 reqp->req_state = 0; in _aio_create_worker()
928 reqp->req_worker = NULL; in _aio_create_worker()
1028 aio_req_t *reqp; /* current AIO request */ in _aio_do_request() local
1064 while ((reqp = _aio_req_get(aiowp)) == NULL) { in _aio_do_request()
1068 arg = &reqp->req_args; in _aio_do_request()
1069 ASSERT(reqp->req_state == AIO_REQ_INPROGRESS || in _aio_do_request()
1070 reqp->req_state == AIO_REQ_CANCELED); in _aio_do_request()
1073 switch (reqp->req_op) { in _aio_do_request()
1169 if (_aio_fsync_del(aiowp, reqp)) in _aio_do_request()
1171 ASSERT(reqp->req_head == NULL); in _aio_do_request()
1177 if (reqp->req_state == AIO_REQ_CANCELED) { in _aio_do_request()
1190 if (_aio_hash_insert(reqp->req_resultp, reqp) != 0) in _aio_do_request()
1211 aio_req_t *reqp; in _aio_finish_request() local
1214 if ((reqp = aiowp->work_req) == NULL) in _aio_finish_request()
1218 if (reqp->req_state == AIO_REQ_CANCELED) { in _aio_finish_request()
1222 if (!POSIX_AIO(reqp)) { in _aio_finish_request()
1224 if (reqp->req_state == AIO_REQ_INPROGRESS) { in _aio_finish_request()
1225 reqp->req_state = AIO_REQ_DONE; in _aio_finish_request()
1226 _aio_set_result(reqp, retval, error); in _aio_finish_request()
1236 _aio_req_free(reqp); in _aio_finish_request()
1253 if (reqp->req_state == AIO_REQ_INPROGRESS) in _aio_finish_request()
1254 reqp->req_state = AIO_REQ_DONE; in _aio_finish_request()
1256 _aiodone(reqp, retval, error); in _aio_finish_request()
1262 _aio_req_mark_done(aio_req_t *reqp) in _aio_req_mark_done() argument
1265 if (reqp->req_largefile) in _aio_req_mark_done()
1266 ((aiocb64_t *)reqp->req_aiocbp)->aio_state = USERAIO_DONE; in _aio_req_mark_done()
1269 ((aiocb_t *)reqp->req_aiocbp)->aio_state = USERAIO_DONE; in _aio_req_mark_done()
1315 aio_req_t *reqp; in _aio_do_notify() local
1328 while ((reqp = _aio_req_get(aiowp)) == NULL) { in _aio_do_notify()
1332 send_notification(&reqp->req_notify); in _aio_do_notify()
1333 _aio_req_free(reqp); in _aio_do_notify()
1345 _aiodone(aio_req_t *reqp, ssize_t retval, int error) in _aiodone() argument
1347 aio_result_t *resultp = reqp->req_resultp; in _aiodone()
1359 ASSERT(POSIX_AIO(reqp)); in _aiodone()
1370 switch (reqp->req_sigevent.sigev_notify) { in _aiodone()
1398 if ((np.np_signo = reqp->req_sigevent.sigev_signo) != 0) in _aiodone()
1400 np.np_user = reqp->req_sigevent.sigev_value.sival_ptr; in _aiodone()
1402 if ((np.np_port = reqp->req_sigevent.sigev_signo) >= 0) in _aiodone()
1404 np.np_event = reqp->req_op; in _aiodone()
1405 if (np.np_event == AIOFSYNC && reqp->req_largefile) in _aiodone()
1407 np.np_object = (uintptr_t)reqp->req_aiocbp; in _aiodone()
1408 np.np_user = reqp->req_sigevent.sigev_value.sival_ptr; in _aiodone()
1412 _aio_set_result(reqp, retval, error); in _aiodone()
1416 head = reqp->req_head; in _aiodone()
1417 reqp->req_head = NULL; in _aiodone()
1420 _aio_enq_doneq(reqp); in _aiodone()
1421 reqp = NULL; in _aiodone()
1424 _aio_req_mark_done(reqp); in _aiodone()
1483 if (reqp != NULL) { in _aiodone()
1493 reqp->req_notify = np; in _aiodone()
1494 reqp->req_op = AIONOTIFY; in _aiodone()
1495 _aio_req_add(reqp, &__workers_no, AIONOTIFY); in _aiodone()
1496 reqp = NULL; in _aiodone()
1507 if (reqp != NULL) in _aiodone()
1508 _aio_req_free(reqp); in _aiodone()
1517 _aio_fsync_del(aio_worker_t *aiowp, aio_req_t *reqp) in _aio_fsync_del() argument
1519 aio_lio_t *head = reqp->req_head; in _aio_fsync_del()
1522 ASSERT(reqp == aiowp->work_req); in _aio_fsync_del()
1535 _aio_req_free(reqp); in _aio_fsync_del()
1539 reqp->req_head = NULL; in _aio_fsync_del()
1541 reqp->req_state = AIO_REQ_CANCELED; in _aio_fsync_del()
1552 _aio_req_free(reqp); in _aio_fsync_del()
1596 aio_req_t *reqp; in _aio_work_done() local
1600 reqp = aiowp->work_prev1; in _aio_work_done()
1601 reqp->req_next = NULL; in _aio_work_done()
1609 if (reqp->req_state == AIO_REQ_CANCELED) { in _aio_work_done()
1617 _aio_req_free(reqp); in _aio_work_done()
1631 ASSERT(reqp != NULL); in _aio_work_done()
1634 _aio_done_head = _aio_done_tail = reqp; in _aio_work_done()
1636 _aio_done_head->req_next = reqp; in _aio_work_done()
1637 _aio_done_head = reqp; in _aio_work_done()
1659 aio_req_t *reqp; in _aio_req_done() local
1664 if ((reqp = _aio_done_tail) != NULL) { in _aio_req_done()
1665 if ((_aio_done_tail = reqp->req_next) == NULL) in _aio_req_done()
1669 (void) _aio_hash_del(reqp->req_resultp); in _aio_req_done()
1670 resultp = reqp->req_resultp; in _aio_req_done()
1671 ASSERT(reqp->req_state == AIO_REQ_DONE); in _aio_req_done()
1672 _aio_req_free(reqp); in _aio_req_done()
1676 if (reqp == NULL && _aio_outstand_cnt == 0) { in _aio_req_done()
1695 _aio_set_result(aio_req_t *reqp, ssize_t retval, int error) in _aio_set_result() argument
1697 aio_result_t *resultp = reqp->req_resultp; in _aio_set_result()
1699 if (POSIX_AIO(reqp)) { in _aio_set_result()
1715 _aio_req_add(aio_req_t *reqp, aio_worker_t **nextworker, int mode) in _aio_req_add() argument
1723 ASSERT(reqp->req_state != AIO_REQ_DONEQ); in _aio_req_add()
1724 reqp->req_next = NULL; in _aio_req_add()
1779 if (_aio_create_worker(reqp, mode)) in _aio_req_add()
1806 if (_aio_create_worker(reqp, mode)) in _aio_req_add()
1827 aiowp->work_tail1 = reqp; in _aio_req_add()
1828 aiowp->work_next1 = reqp; in _aio_req_add()
1830 aiowp->work_head1->req_next = reqp; in _aio_req_add()
1832 aiowp->work_next1 = reqp; in _aio_req_add()
1834 reqp->req_state = AIO_REQ_QUEUED; in _aio_req_add()
1835 reqp->req_worker = aiowp; in _aio_req_add()
1836 aiowp->work_head1 = reqp; in _aio_req_add()
1861 aio_req_t *reqp; in _aio_req_get() local
1864 if ((reqp = aiowp->work_next1) != NULL) { in _aio_req_get()
1875 if (POSIX_AIO(reqp)) { in _aio_req_get()
1877 aiowp->work_tail1 = reqp->req_next; in _aio_req_get()
1881 aiowp->work_prev1->req_next = reqp->req_next; in _aio_req_get()
1882 if (aiowp->work_head1 == reqp) in _aio_req_get()
1883 aiowp->work_head1 = reqp->req_next; in _aio_req_get()
1887 aiowp->work_prev1 = reqp; in _aio_req_get()
1891 ASSERT(reqp != reqp->req_next); in _aio_req_get()
1892 aiowp->work_next1 = reqp->req_next; in _aio_req_get()
1895 switch (reqp->req_op) { in _aio_req_get()
1908 reqp->req_state = AIO_REQ_INPROGRESS; in _aio_req_get()
1910 aiowp->work_req = reqp; in _aio_req_get()
1911 ASSERT(reqp != NULL || aiowp->work_count1 == 0); in _aio_req_get()
1913 return (reqp); in _aio_req_get()
1917 _aio_req_del(aio_worker_t *aiowp, aio_req_t *reqp, int ostate) in _aio_req_del() argument
1925 if (POSIX_AIO(reqp)) { in _aio_req_del()
1933 if (next == reqp) { in _aio_req_del()
1965 !POSIX_AIO(reqp) && aiowp->work_done1 > 0); in _aio_req_del()
1985 _aio_enq_doneq(aio_req_t *reqp) in _aio_enq_doneq() argument
1988 _aio_doneq = reqp; in _aio_enq_doneq()
1989 reqp->req_next = reqp->req_prev = reqp; in _aio_enq_doneq()
1991 reqp->req_next = _aio_doneq; in _aio_enq_doneq()
1992 reqp->req_prev = _aio_doneq->req_prev; in _aio_enq_doneq()
1993 _aio_doneq->req_prev->req_next = reqp; in _aio_enq_doneq()
1994 _aio_doneq->req_prev = reqp; in _aio_enq_doneq()
1996 reqp->req_state = AIO_REQ_DONEQ; in _aio_enq_doneq()
2004 _aio_req_remove(aio_req_t *reqp) in _aio_req_remove() argument
2006 if (reqp && reqp->req_state != AIO_REQ_DONEQ) in _aio_req_remove()
2009 if (reqp) { in _aio_req_remove()
2011 if (_aio_doneq == reqp) in _aio_req_remove()
2012 _aio_doneq = reqp->req_next; in _aio_req_remove()
2013 if (_aio_doneq == reqp) { in _aio_req_remove()
2017 aio_req_t *tmp = reqp->req_next; in _aio_req_remove()
2018 reqp->req_prev->req_next = tmp; in _aio_req_remove()
2019 tmp->req_prev = reqp->req_prev; in _aio_req_remove()
2021 } else if ((reqp = _aio_doneq) != NULL) { in _aio_req_remove()
2022 if (reqp == reqp->req_next) { in _aio_req_remove()
2026 reqp->req_prev->req_next = _aio_doneq = reqp->req_next; in _aio_req_remove()
2027 _aio_doneq->req_prev = reqp->req_prev; in _aio_req_remove()
2030 if (reqp) { in _aio_req_remove()
2032 reqp->req_next = reqp->req_prev = reqp; in _aio_req_remove()
2033 reqp->req_state = AIO_REQ_DONE; in _aio_req_remove()
2035 return (reqp); in _aio_req_remove()
2044 _aio_hash_insert(aio_result_t *resultp, aio_req_t *reqp) in _aio_hash_insert() argument
2060 *prev = reqp; in _aio_hash_insert()
2061 ASSERT(reqp->req_link == NULL); in _aio_hash_insert()
2124 aio_req_t *reqp; in _aio_rw() local
2174 if ((reqp = _aio_req_alloc()) == NULL) { in _aio_rw()
2182 reqp->req_head = lio_head; in _aio_rw()
2183 reqp->req_type = AIO_POSIX_REQ; in _aio_rw()
2184 reqp->req_op = mode; in _aio_rw()
2185 reqp->req_largefile = 0; in _aio_rw()
2188 reqp->req_sigevent.sigev_notify = SIGEV_NONE; in _aio_rw()
2190 reqp->req_sigevent.sigev_notify = SIGEV_SIGNAL; in _aio_rw()
2191 reqp->req_sigevent.sigev_signo = in _aio_rw()
2193 reqp->req_sigevent.sigev_value.sival_ptr = in _aio_rw()
2197 reqp->req_sigevent.sigev_notify = SIGEV_PORT; in _aio_rw()
2202 reqp->req_sigevent.sigev_signo = in _aio_rw()
2204 reqp->req_sigevent.sigev_value.sival_ptr = in _aio_rw()
2207 reqp->req_sigevent.sigev_notify = SIGEV_THREAD; in _aio_rw()
2212 reqp->req_sigevent.sigev_signo = in _aio_rw()
2214 reqp->req_sigevent.sigev_value.sival_ptr = in _aio_rw()
2218 reqp->req_resultp = &aiocbp->aio_resultp; in _aio_rw()
2219 reqp->req_aiocbp = aiocbp; in _aio_rw()
2220 ap = &reqp->req_args; in _aio_rw()
2227 _aio_hash_insert(&aiocbp->aio_resultp, reqp) != 0) { in _aio_rw()
2230 _aio_req_add(reqp, nextworker, mode); in _aio_rw()
2242 aio_req_t *reqp; in _aio_rw64() local
2292 if ((reqp = _aio_req_alloc()) == NULL) { in _aio_rw64()
2300 reqp->req_head = lio_head; in _aio_rw64()
2301 reqp->req_type = AIO_POSIX_REQ; in _aio_rw64()
2302 reqp->req_op = mode; in _aio_rw64()
2303 reqp->req_largefile = 1; in _aio_rw64()
2306 reqp->req_sigevent.sigev_notify = SIGEV_NONE; in _aio_rw64()
2308 reqp->req_sigevent.sigev_notify = SIGEV_SIGNAL; in _aio_rw64()
2309 reqp->req_sigevent.sigev_signo = in _aio_rw64()
2311 reqp->req_sigevent.sigev_value.sival_ptr = in _aio_rw64()
2315 reqp->req_sigevent.sigev_notify = SIGEV_PORT; in _aio_rw64()
2316 reqp->req_sigevent.sigev_signo = in _aio_rw64()
2318 reqp->req_sigevent.sigev_value.sival_ptr = in _aio_rw64()
2321 reqp->req_sigevent.sigev_notify = SIGEV_THREAD; in _aio_rw64()
2322 reqp->req_sigevent.sigev_signo = in _aio_rw64()
2324 reqp->req_sigevent.sigev_value.sival_ptr = in _aio_rw64()
2328 reqp->req_resultp = &aiocbp->aio_resultp; in _aio_rw64()
2329 reqp->req_aiocbp = aiocbp; in _aio_rw64()
2330 ap = &reqp->req_args; in _aio_rw64()
2337 _aio_hash_insert(&aiocbp->aio_resultp, reqp) != 0) { in _aio_rw64()
2340 _aio_req_add(reqp, nextworker, mode); in _aio_rw64()