mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
net: add sock_no_linger
Add a helper to directly set the SO_LINGER sockopt from kernel space with onoff set to true and a linger time of 0 without going through a fake uaccess. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
b58f0e8f38
commit
c433594c07
@@ -323,17 +323,9 @@ static int svc_tcp_has_wspace(struct svc_xprt *xprt)
|
||||
|
||||
static void svc_tcp_kill_temp_xprt(struct svc_xprt *xprt)
|
||||
{
|
||||
struct svc_sock *svsk;
|
||||
struct socket *sock;
|
||||
struct linger no_linger = {
|
||||
.l_onoff = 1,
|
||||
.l_linger = 0,
|
||||
};
|
||||
struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt);
|
||||
|
||||
svsk = container_of(xprt, struct svc_sock, sk_xprt);
|
||||
sock = svsk->sk_sock;
|
||||
kernel_setsockopt(sock, SOL_SOCKET, SO_LINGER,
|
||||
(char *)&no_linger, sizeof(no_linger));
|
||||
sock_no_linger(svsk->sk_sock->sk);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user