MCPcopy Create free account
hub / github.com/F-Stack/f-stack / soaio_process_sb

Function soaio_process_sb

freebsd/kern/sys_socket.c:711–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711static void
712soaio_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
742void
743soaio_rcv(void *context, int pending)

Callers 2

soaio_rcvFunction · 0.85
soaio_sndFunction · 0.85

Calls 3

soaio_readyFunction · 0.85
soaio_process_jobFunction · 0.85

Tested by

no test coverage detected