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/include
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
..
acpi Merge branches 'acpi-processor' and 'acpi-cppc' 2025-05-26 18:37:38 +02:00
asm-generic hyperv-next for v6.16 2025-06-03 08:39:20 -07:00
clocksource
crypto Crypto library fix for v6.16-rc4 2025-06-27 17:32:30 -07:00
cxl cxl/features: Remove the inline specifier from to_cxlfs() 2025-05-22 07:39:01 -07:00
drm drm for 6.16-rc1 2025-05-28 09:46:39 -07:00
dt-bindings USB/Thunderbolt changes for 6.16-rc1 2025-06-06 12:45:35 -07:00
hyperv hyperv-next for v6.16 2025-06-03 08:39:20 -07:00
keys
kunit I've recently moved computers (among other things) so I'm sending this from a 2025-05-30 09:15:40 -07:00
kvm KVM: arm64: Resolve vLPI by host IRQ in vgic_v4_unset_forwarding() 2025-05-30 09:11:29 +01:00
linux Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2025-07-08 16:59:57 -07:00
math-emu
media
memory
misc
net af_unix: Introduce SO_INQ. 2025-07-08 18:05:25 -07:00
pcmcia
ras
rdma Linux 6.15 2025-05-26 15:33:52 -03:00
rv
scsi SCSI misc on 20250529 2025-05-29 22:17:52 -07:00
soc - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
sound USB/Thunderbolt changes for 6.16-rc1 2025-06-06 12:45:35 -07:00
target scsi: target: core: Constify enabled() in struct target_opcode_descriptor 2025-05-20 22:11:03 -04:00
trace bpf-next-for-netdev 2025-06-26 17:13:17 -07:00
uapi af_unix: Introduce SO_INQ. 2025-07-08 18:05:25 -07:00
ufs
vdso
video fbdev: atyfb: Remove unused PCI vendor ID 2025-05-31 10:24:01 +02:00
xen
Kbuild