diff options
author | Breno Leitao <leitao@debian.org> | 2023-10-16 06:47:41 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-10-19 14:05:49 -0600 |
commit | 1406245c29454ff84919736be83e14cdaba7fec1 (patch) | |
tree | e2201c2cd13e781fc06824386b91193972b41140 /include | |
parent | 3f31e0d14d44ad491a81b7c1f83f32fbc300a867 (diff) |
net/socket: Break down __sys_setsockopt
Split __sys_setsockopt() into two functions by removing the core
logic into a sub-function (do_sock_setsockopt()). This will avoid
code duplication when doing the same operation in other callers, for
instance.
do_sock_setsockopt() will be called by io_uring setsockopt() command
operation in the following patch.
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20231016134750.1381153-4-leitao@debian.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sock.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index b770261fbdaf..24fbf7182386 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1867,6 +1867,8 @@ int sk_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval, unsigned int optlen); int sock_setsockopt(struct socket *sock, int level, int op, sockptr_t optval, unsigned int optlen); +int do_sock_setsockopt(struct socket *sock, bool compat, int level, + int optname, sockptr_t optval, int optlen); int sk_getsockopt(struct sock *sk, int level, int optname, sockptr_t optval, sockptr_t optlen); |