tcp: add tcp_sock_set_cork
Add a helper to directly set the TCP_CORK 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> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
fe31a326a4
commit
db10538a4b
@@ -38,23 +38,18 @@
|
||||
#include "rds.h"
|
||||
#include "tcp.h"
|
||||
|
||||
static void rds_tcp_cork(struct socket *sock, int val)
|
||||
{
|
||||
kernel_setsockopt(sock, SOL_TCP, TCP_CORK, (void *)&val, sizeof(val));
|
||||
}
|
||||
|
||||
void rds_tcp_xmit_path_prepare(struct rds_conn_path *cp)
|
||||
{
|
||||
struct rds_tcp_connection *tc = cp->cp_transport_data;
|
||||
|
||||
rds_tcp_cork(tc->t_sock, 1);
|
||||
tcp_sock_set_cork(tc->t_sock->sk, true);
|
||||
}
|
||||
|
||||
void rds_tcp_xmit_path_complete(struct rds_conn_path *cp)
|
||||
{
|
||||
struct rds_tcp_connection *tc = cp->cp_transport_data;
|
||||
|
||||
rds_tcp_cork(tc->t_sock, 0);
|
||||
tcp_sock_set_cork(tc->t_sock->sk, false);
|
||||
}
|
||||
|
||||
/* the core send_sem serializes this with other xmit and shutdown */
|
||||
|
Reference in New Issue
Block a user