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

Function soo_aio_queue

freebsd/kern/sys_socket.c:804–839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804static int
805soo_aio_queue(struct file *fp, struct kaiocb *job)
806{
807 struct socket *so;
808 struct sockbuf *sb;
809 int error;
810
811 so = fp->f_data;
812 error = (*so->so_proto->pr_usrreqs->pru_aio_queue)(so, job);
813 if (error == 0)
814 return (0);
815
816 switch (job->uaiocb.aio_lio_opcode & (LIO_WRITE | LIO_READ)) {
817 case LIO_READ:
818 sb = &so->so_rcv;
819 break;
820 case LIO_WRITE:
821 sb = &so->so_snd;
822 break;
823 default:
824 return (EINVAL);
825 }
826
827 SOCKBUF_LOCK(sb);
828 if (!aio_set_cancel_function(job, soo_aio_cancel))
829 panic("new job was cancelled");
830 TAILQ_INSERT_TAIL(&sb->sb_aiojobq, job, list);
831 if (!(sb->sb_flags & SB_AIO_RUNNING)) {
832 if (soaio_ready(so, sb))
833 sowakeup_aio(so, sb);
834 else
835 sb->sb_flags |= SB_AIO;
836 }
837 SOCKBUF_UNLOCK(sb);
838 return (0);
839}
840#endif

Callers

nothing calls this directly

Calls 4

aio_set_cancel_functionFunction · 0.85
soaio_readyFunction · 0.85
sowakeup_aioFunction · 0.85
panicFunction · 0.70

Tested by

no test coverage detected