2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/arch/sparc
Kuniyuki Iwashima df30285b36 af_unix: Introduce SO_INQ.
We have an application that uses almost the same code for TCP and
AF_UNIX (SOCK_STREAM).

TCP can use TCP_INQ, but AF_UNIX doesn't have it and requires an
extra syscall, ioctl(SIOCINQ) or getsockopt(SO_MEMINFO) as an
alternative.

Let's introduce the generic version of TCP_INQ.

If SO_INQ is enabled, recvmsg() will put a cmsg of SCM_INQ that
contains the exact value of ioctl(SIOCINQ).  The cmsg is also
included when msg->msg_get_inq is non-zero to make sockets
io_uring-friendly.

Note that SOCK_CUSTOM_SOCKOPT is flagged only for SOCK_STREAM to
override setsockopt() for SOL_SOCKET.

By having the flag in struct unix_sock, instead of struct sock, we
can later add SO_INQ support for TCP and reuse tcp_sk(sk)->recvmsg_inq.

Note also that supporting custom getsockopt() for SOL_SOCKET will need
preparation for other SOCK_CUSTOM_SOCKOPT users (UDP, vsock, MPTCP).

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250702223606.1054680-7-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-08 18:05:25 -07:00
..
boot kbuild: Abort make on install failures 2024-07-20 13:34:54 +09:00
configs crypto: tcrypt - rename CRYPTO_TEST to CRYPTO_BENCHMARK 2025-05-12 13:32:53 +08:00
crypto crypto: sparc/sha256 - implement library instead of shash 2025-05-05 18:20:44 +08:00
include af_unix: Introduce SO_INQ. 2025-07-08 18:05:25 -07:00
kernel treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
lib This update includes the following changes: 2025-05-26 13:47:28 -07:00
math-emu treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mm sparc64: mm: call ctor/dtor for kernel PTEs 2025-05-11 17:48:22 -07:00
net Modules changes for v6.10-rc1 2024-05-15 14:05:08 -07:00
power sparc64: Fix prototype warnings in hibernate.c 2024-07-11 15:58:28 +02:00
prom sparc64: Fix prototype warning for prom_get_mmu_ihandle 2024-07-11 15:58:28 +02:00
vdso sparc/vdso: Always reject undefined references during linking 2025-03-11 09:54:48 +01:00
video arch: Fix name collision with ACPI's video.o 2024-05-20 21:17:06 +00:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig sparc/crc32: expose CRC32 functions through lib 2024-12-01 17:23:01 -08:00
Kconfig.debug sparc: select FRAME_POINTER instead of redefining it 2024-02-16 16:50:26 +01:00
Makefile sparc/build: Put usage of -fcall-used* flags behind cc-option 2024-11-16 09:52:56 +01:00