net: pass back data left in socket after receive
authorJens Axboe <axboe@kernel.dk>
Wed, 27 Apr 2022 17:20:14 +0000 (11:20 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 27 Apr 2022 19:45:04 +0000 (13:45 -0600)
commitb401d88339d015e9d2d9f176814ffaae4d7bc438
tree46a3ce6cd4d0b9ae414ceed017a27455812e6a6d
parent50fe413336cdcf737758181ae8d0293c7f8072dd
net: pass back data left in socket after receive

This is currently done for CMSG_INQ, add an ability to do so via struct
msghdr as well and have CMSG_INQ use that too. If the caller sets
msghdr->msg_get_inq, then we'll pass back the hint in msghdr->msg_inq.

Rearrange struct msghdr a bit so we can add this member while shrinking
it at the same time. On a 64-bit build, it was 96 bytes before this
change and 88 bytes afterwards.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/socket.h
net/ipv4/tcp.c