| 709 | } |
| 710 | |
| 711 | static void |
| 712 | soaio_process_sb(struct socket *so, struct sockbuf *sb) |
| 713 | { |
| 714 | struct kaiocb *job; |
| 715 | |
| 716 | CURVNET_SET(so->so_vnet); |
| 717 | SOCKBUF_LOCK(sb); |
| 718 | while (!TAILQ_EMPTY(&sb->sb_aiojobq) && soaio_ready(so, sb)) { |
| 719 | job = TAILQ_FIRST(&sb->sb_aiojobq); |
| 720 | TAILQ_REMOVE(&sb->sb_aiojobq, job, list); |
| 721 | if (!aio_clear_cancel_function(job)) |
| 722 | continue; |
| 723 | |
| 724 | soaio_process_job(so, sb, job); |
| 725 | } |
| 726 | |
| 727 | /* |
| 728 | * If there are still pending requests, the socket must not be |
| 729 | * ready so set SB_AIO to request a wakeup when the socket |
| 730 | * becomes ready. |
| 731 | */ |
| 732 | if (!TAILQ_EMPTY(&sb->sb_aiojobq)) |
| 733 | sb->sb_flags |= SB_AIO; |
| 734 | sb->sb_flags &= ~SB_AIO_RUNNING; |
| 735 | SOCKBUF_UNLOCK(sb); |
| 736 | |
| 737 | SOCK_LOCK(so); |
| 738 | sorele(so); |
| 739 | CURVNET_RESTORE(); |
| 740 | } |
| 741 | |
| 742 | void |
| 743 | soaio_rcv(void *context, int pending) |
no test coverage detected