]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vsock: Move lingering logic to af_vsock core
authorMichal Luczaj <mhal@rbox.co>
Wed, 21 May 2025 23:18:22 +0000 (01:18 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 27 May 2025 09:05:21 +0000 (11:05 +0200)
commit5ec40864aaecc4bd66fe67541d4a41091ed664a5
tree2385f434eeb0f735e308b4f3c0ca2078e989f5eb
parent1c39f5dbbfd2b44602d46936fe55361205196257
vsock: Move lingering logic to af_vsock core

Lingering should be transport-independent in the long run. In preparation
for supporting other transports, as well as the linger on shutdown(), move
code to core.

Generalize by querying vsock_transport::unsent_bytes(), guard against the
callback being unimplemented. Do not pass sk_lingertime explicitly. Pull
SOCK_LINGER check into vsock_linger().

Flatten the function. Remove the nested block by inverting the condition:
return early on !timeout.

Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Link: https://patch.msgid.link/20250522-vsock-linger-v6-2-2ad00b0e447e@rbox.co
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/af_vsock.h
net/vmw_vsock/af_vsock.c
net/vmw_vsock/virtio_transport_common.c