diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2016-06-30 16:11:16 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-01 16:45:17 -0400 |
commit | b04e8554f7637999af8f54cca4dcfcf49f2ae7c8 (patch) | |
tree | ff29f60508fe2d0ee6b10b7f0c66d317288b9308 /net/rds/tcp_connect.c | |
parent | 2da43c4a1b517d02e71d9611a2242273e7d399ba (diff) |
RDS: TCP: Hooks to set up a single connection path
This patch adds ->conn_path_connect callbacks in the rds_transport
that are used to set up a single connection path.
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/tcp_connect.c')
-rw-r--r-- | net/rds/tcp_connect.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/rds/tcp_connect.c b/net/rds/tcp_connect.c index 7eddce50e7a3..c916715fbe61 100644 --- a/net/rds/tcp_connect.c +++ b/net/rds/tcp_connect.c @@ -74,17 +74,17 @@ out: state_change(sk); } -int rds_tcp_conn_connect(struct rds_connection *conn) +int rds_tcp_conn_path_connect(struct rds_conn_path *cp) { struct socket *sock = NULL; struct sockaddr_in src, dest; int ret; - struct rds_tcp_connection *tc = conn->c_transport_data; - struct rds_conn_path *cp = &conn->c_path[0]; + struct rds_connection *conn = cp->cp_conn; + struct rds_tcp_connection *tc = cp->cp_transport_data; mutex_lock(&tc->t_conn_path_lock); - if (rds_conn_up(conn)) { + if (rds_conn_path_up(cp)) { mutex_unlock(&tc->t_conn_path_lock); return 0; } @@ -118,6 +118,7 @@ int rds_tcp_conn_connect(struct rds_connection *conn) ret = sock->ops->connect(sock, (struct sockaddr *)&dest, sizeof(dest), O_NONBLOCK); + cp->cp_outgoing = 1; rdsdebug("connect to address %pI4 returned %d\n", &conn->c_faddr, ret); if (ret == -EINPROGRESS) ret = 0; @@ -125,7 +126,7 @@ int rds_tcp_conn_connect(struct rds_connection *conn) rds_tcp_keepalive(sock); sock = NULL; } else { - rds_tcp_restore_callbacks(sock, conn->c_transport_data); + rds_tcp_restore_callbacks(sock, cp->cp_transport_data); } out: |