diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-05-31 03:38:34 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-05-31 03:46:38 +0000 |
commit | f083739350fbb541b37783a23e8d7fd2aba03e07 (patch) | |
tree | 10a90b6bfa12982e568cb20cf50b4f2d543e9f07 /sys/kern/sys_socket.c | |
parent | fe109d3113166c8e3b8557f0569c4e5a3597ac93 (diff) | |
download | src-f083739350fbb541b37783a23e8d7fd2aba03e07.tar.gz src-f083739350fbb541b37783a23e8d7fd2aba03e07.zip |
soo_aio_*: use socket buffer mutexes in struct socket directly
A miss from commit 4328318445a.
Diffstat (limited to 'sys/kern/sys_socket.c')
-rw-r--r-- | sys/kern/sys_socket.c | 18 |
1 files 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); } |