git: f083739350fb - main - soo_aio_*: use socket buffer mutexes in struct socket directly
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 31 May 2022 03:47:25 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=f083739350fbb541b37783a23e8d7fd2aba03e07 commit f083739350fbb541b37783a23e8d7fd2aba03e07 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2022-05-31 03:38:34 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2022-05-31 03:46:38 +0000 soo_aio_*: use socket buffer mutexes in struct socket directly A miss from commit 4328318445a. --- sys/kern/sys_socket.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index b1b47d3d3c26..3480af70832a 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -772,22 +772,25 @@ soo_aio_cancel(struct kaiocb *job) struct sockbuf *sb; long done; int opcode; + sb_which which; so = job->fd_file->f_data; opcode = job->uaiocb.aio_lio_opcode; - if (opcode & LIO_READ) + if (opcode & LIO_READ) { sb = &so->so_rcv; - else { + which = SO_RCV; + } else { MPASS(opcode & LIO_WRITE); sb = &so->so_snd; + which = SO_SND; } - SOCKBUF_LOCK(sb); + SOCK_BUF_LOCK(so, which); if (!aio_cancel_cleared(job)) TAILQ_REMOVE(&sb->sb_aiojobq, job, list); if (TAILQ_EMPTY(&sb->sb_aiojobq)) sb->sb_flags &= ~SB_AIO; - SOCKBUF_UNLOCK(sb); + SOCK_BUF_UNLOCK(so, which); done = job->aio_done; if (done != 0) @@ -826,10 +829,7 @@ soo_aio_queue(struct file *fp, struct kaiocb *job) } if (SOLISTENING(so)) { - if (sb == &so->so_rcv) - SOCK_RECVBUF_UNLOCK(so); - else - SOCK_SENDBUF_UNLOCK(so); + SOCK_BUF_UNLOCK(so, which); return (EINVAL); } @@ -842,6 +842,6 @@ soo_aio_queue(struct file *fp, struct kaiocb *job) else sb->sb_flags |= SB_AIO; } - SOCKBUF_UNLOCK(sb); + SOCK_BUF_UNLOCK(so, which); return (0); }