Skip to content

Commit

Permalink
net: remove kernel_setsockopt
Browse files Browse the repository at this point in the history
No users left.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Christoph Hellwig authored and davem330 committed May 29, 2020
1 parent c0425a4 commit 5a892ff
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
2 changes: 0 additions & 2 deletions include/linux/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,6 @@ int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen,
int flags);
int kernel_getsockname(struct socket *sock, struct sockaddr *addr);
int kernel_getpeername(struct socket *sock, struct sockaddr *addr);
int kernel_setsockopt(struct socket *sock, int level, int optname, char *optval,
unsigned int optlen);
int kernel_sendpage(struct socket *sock, struct page *page, int offset,
size_t size, int flags);
int kernel_sendpage_locked(struct sock *sk, struct page *page, int offset,
Expand Down
31 changes: 0 additions & 31 deletions net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -3624,37 +3624,6 @@ int kernel_getpeername(struct socket *sock, struct sockaddr *addr)
}
EXPORT_SYMBOL(kernel_getpeername);

/**
* kernel_setsockopt - set a socket option (kernel space)
* @sock: socket
* @level: API level (SOL_SOCKET, ...)
* @optname: option tag
* @optval: option value
* @optlen: option length
*
* Returns 0 or an error.
*/

int kernel_setsockopt(struct socket *sock, int level, int optname,
char *optval, unsigned int optlen)
{
mm_segment_t oldfs = get_fs();
char __user *uoptval;
int err;

uoptval = (char __user __force *) optval;

set_fs(KERNEL_DS);
if (level == SOL_SOCKET)
err = sock_setsockopt(sock, level, optname, uoptval, optlen);
else
err = sock->ops->setsockopt(sock, level, optname, uoptval,
optlen);
set_fs(oldfs);
return err;
}
EXPORT_SYMBOL(kernel_setsockopt);

/**
* kernel_sendpage - send a &page through a socket (kernel space)
* @sock: socket
Expand Down

0 comments on commit 5a892ff

Please sign in to comment.