tcp: add tcp_sock_set_nodelay
Add a helper to directly set the TCP_NODELAY sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Sagi Grimberg <sagi@grimberg.me> Acked-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

父節點
db10538a4b
當前提交
12abc5ee78
@@ -490,15 +490,8 @@ static int ceph_tcp_connect(struct ceph_connection *con)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ceph_test_opt(from_msgr(con->msgr), TCP_NODELAY)) {
|
||||
int optval = 1;
|
||||
|
||||
ret = kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY,
|
||||
(char *)&optval, sizeof(optval));
|
||||
if (ret)
|
||||
pr_err("kernel_setsockopt(TCP_NODELAY) failed: %d",
|
||||
ret);
|
||||
}
|
||||
if (ceph_test_opt(from_msgr(con->msgr), TCP_NODELAY))
|
||||
tcp_sock_set_nodelay(sock->sk);
|
||||
|
||||
con->sock = sock;
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user