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
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
..
alpha af_unix: Introduce SO_INQ. 2025-07-08 18:05:25 -07:00
arc ARC fixes for 6.16 2025-06-12 08:17:56 -07:00
arm ARM: dts: Fix up wrv54g device tree 2025-06-27 15:14:53 -07:00
arm64 ARM: 2025-06-22 09:58:23 -07:00
csky mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
hexagon mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
loongarch LoongArch: KVM: Disable updating of "num_cpu" and "feature" 2025-06-27 18:27:44 +08:00
m68k mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
microblaze mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
mips af_unix: Introduce SO_INQ. 2025-07-08 18:05:25 -07:00
nios2 mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
openrisc mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
parisc af_unix: Introduce SO_INQ. 2025-07-08 18:05:25 -07:00
powerpc powerpc fixes for 6.16 #3 2025-06-16 08:49:58 -07:00
riscv RISC-V Fixes for 5.16-rc4 2025-06-27 20:22:18 -07:00
s390 s390/pci: Allow automatic recovery with minimal driver support 2025-06-28 18:59:00 +02:00
sh mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
sparc af_unix: Introduce SO_INQ. 2025-07-08 18:05:25 -07:00
um um: vector: Reduce stack usage in vector_eth_configure() 2025-06-25 09:28:17 +02:00
x86 - Make sure DR6 and DR7 are initialized to their architectural values and not 2025-06-29 08:28:24 -07:00
xtensa mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
.gitignore
Kconfig fs/resctrl: Add boiler plate for external resctrl code 2025-05-16 11:05:40 +02:00