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

parent
db10538a4b
commit
12abc5ee78
@@ -897,20 +897,11 @@ int iscsit_setup_np(
|
||||
/*
|
||||
* Set SO_REUSEADDR, and disable Nagel Algorithm with TCP_NODELAY.
|
||||
*/
|
||||
/* FIXME: Someone please explain why this is endian-safe */
|
||||
opt = 1;
|
||||
if (np->np_network_transport == ISCSI_TCP) {
|
||||
ret = kernel_setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
|
||||
(char *)&opt, sizeof(opt));
|
||||
if (ret < 0) {
|
||||
pr_err("kernel_setsockopt() for TCP_NODELAY"
|
||||
" failed: %d\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
if (np->np_network_transport == ISCSI_TCP)
|
||||
tcp_sock_set_nodelay(sock->sk);
|
||||
sock_set_reuseaddr(sock->sk);
|
||||
|
||||
opt = 1;
|
||||
ret = kernel_setsockopt(sock, IPPROTO_IP, IP_FREEBIND,
|
||||
(char *)&opt, sizeof(opt));
|
||||
if (ret < 0) {
|
||||
|
Reference in New Issue
Block a user