… | |
… | |
299 | |
299 | |
300 | if (iocb->io.aio_buf) |
300 | if (iocb->io.aio_buf) |
301 | { |
301 | { |
302 | evsys_io_cancel (linuxaio_ctx, &iocb->io, (struct io_event *)0); |
302 | evsys_io_cancel (linuxaio_ctx, &iocb->io, (struct io_event *)0); |
303 | /* on relevant kernels, io_cancel fails with EINPROGRES if everything is fine */ |
303 | /* on relevant kernels, io_cancel fails with EINPROGRES if everything is fine */ |
304 | assert (("libev: linuxaio unexpected io_cancel failed", errno != EINPROGRESS)); |
304 | assert (("libev: linuxaio unexpected io_cancel failed", errno == EINPROGRESS)); |
305 | } |
305 | } |
306 | |
306 | |
307 | if (nev) |
307 | if (nev) |
308 | { |
308 | { |
309 | iocb->io.aio_buf = |
309 | iocb->io.aio_buf = |
… | |
… | |
322 | linuxaio_epoll_cb (EV_P_ struct ev_io *w, int revents) |
322 | linuxaio_epoll_cb (EV_P_ struct ev_io *w, int revents) |
323 | { |
323 | { |
324 | epoll_poll (EV_A_ 0); |
324 | epoll_poll (EV_A_ 0); |
325 | } |
325 | } |
326 | |
326 | |
327 | static void |
327 | inline_speed |
|
|
328 | void |
328 | linuxaio_fd_rearm (EV_P_ int fd) |
329 | linuxaio_fd_rearm (EV_P_ int fd) |
329 | { |
330 | { |
330 | anfds [fd].events = 0; |
331 | anfds [fd].events = 0; |
331 | linuxaio_iocbps [fd]->io.aio_buf = 0; |
332 | linuxaio_iocbps [fd]->io.aio_buf = 0; |
332 | fd_change (EV_A_ fd, EV_ANFD_REIFY); |
333 | fd_change (EV_A_ fd, EV_ANFD_REIFY); |
… | |
… | |
348 | fd, |
349 | fd, |
349 | (res & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) |
350 | (res & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) |
350 | | (res & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) |
351 | | (res & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) |
351 | ); |
352 | ); |
352 | |
353 | |
353 | /* linux aio is oneshot: rearm fd. TODO: this does more work than needed */ |
354 | /* linux aio is oneshot: rearm fd. TODO: this does more work than strictly needed */ |
354 | linuxaio_fd_rearm (EV_A_ fd); |
355 | linuxaio_fd_rearm (EV_A_ fd); |
355 | |
356 | |
356 | --nr; |
357 | --nr; |
357 | ++ev; |
358 | ++ev; |
358 | } |
359 | } |