diff options
author | Christoph Hellwig <hch@lst.de> | 2020-05-28 08:12:19 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-28 21:11:45 +0300 |
commit | 12abc5ee7873a085cc280240822b8ac53c86fecd (patch) | |
tree | edd6a9fd7283c51007fd860b55ac1b210e9db135 /net/ceph/messenger.c | |
parent | db10538a4b997a77a1fd561adaaa58afc7dcfa2f (diff) | |
download | linux-12abc5ee7873a085cc280240822b8ac53c86fecd.tar.xz |
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>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r-- | net/ceph/messenger.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index f8ca5edc5f2c..27d6ab11f9ee 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -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; |