diff options
| author | Breno Leitao <leitao@debian.org> | 2026-04-08 03:30:29 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-04-13 14:56:28 -0700 |
| commit | 67fab22a7adcec0279b9b057eb3dc669e32834f0 (patch) | |
| tree | 912a9227a1590fd17dd9c3159317e331edb669fe /drivers/ide/ppc/git@git.tavy.me:linux.git | |
| parent | 1b9707e6f1a9d5f9e1b91750f24743108b093e2b (diff) | |
net: add getsockopt_iter callback to proto_ops
Add a new getsockopt_iter callback to struct proto_ops that uses
sockopt_t, a type-safe wrapper around iov_iter. This provides a clean
interface for socket option operations that works with both user and
kernel buffers.
The sockopt_t type encapsulates an iov_iter and an optlen field.
The optlen field, although not suggested by Linus, serves as both input
(buffer size) and output (returned data size), allowing callbacks to
return random values independent of the bytes written via
copy_to_iter(), so, keep it separated from iov_iter.count.
This is preparatory work for removing the SOL_SOCKET level restriction
from io_uring getsockopt operations.
Keep in mind that both iter_out and iter_in always point to the same
data at all times, and we just have two of them to make the callback
implementation sane.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20260408-getsockopt-v3-1-061bb9cb355d@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/ide/ppc/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
