[PATCH net v2] net/socket: remove unused do_sock_{set,get}sockopt() exports

Breno Leitao <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
do_sock_setsockopt() and do_sock_getsockopt() have been exported since
they were split out of the syscall handlers for io_uring to reuse.

io_uring is the only caller outside net/socket.c, and it is never
modular: cmd_net.o is built under obj-$(CONFIG_NET), and both CONFIG_NET
and CONFIG_IO_URING are bool. The declarations in <net/sock.h> are all
it needs, so no module has ever been able to use these exports.

Drop the symbol exports.

Fixes: 1406245c2945 ("net/socket: Break down __sys_setsockopt")
Fixes: 0b05b0cd78c9 ("net/socket: Break down __sys_getsockopt")
Suggested-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Breno Leitao <[email protected]>
---
Changes in v2:
- s/export/exports/ in the commit message (hch)
- Link to v1: https://patch.msgid.link/[email protected]
---
 net/socket.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index 63c69a0fa74e1..ba3eca4324e7b 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2371,7 +2371,6 @@ int do_sock_setsockopt(struct socket *sock, bool compat, int level,
 out_put:
 	return err;
 }
-EXPORT_SYMBOL(do_sock_setsockopt);
 
 /* Set a socket option. Because we don't know the option lengths we have
  * to pass the user mode parameter for the protocols to sort out.
@@ -2484,7 +2483,6 @@ int do_sock_getsockopt(struct socket *sock, bool compat, int level,
 
 	return err;
 }
-EXPORT_SYMBOL(do_sock_getsockopt);
 
 /*
  *	Get a socket option. Because we don't know the option lengths we have

---
base-commit: 564973a259ec76f2dad0853420e7034cc43994c4
change-id: 20260819-hch_not_export-908dcceab01f

Best regards,
--  
Breno Leitao <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.