diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2017-11-30 14:11:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-01 15:25:15 -0500 |
commit | 2d746c93b6e55d34a98c8983b30d991707a2059b (patch) | |
tree | 8885dd05047a623f4148b651651fb6930b84b0f8 | |
parent | 4c94cc2d3d57a2e843ab10887f67faa82c2337f9 (diff) |
rds: tcp: remove redundant function rds_tcp_conn_paths_destroy()
A side-effect of Commit c14b0366813a ("rds: tcp: set linger to 1
when unloading a rds-tcp") is that we always send a RST on the tcp
connection for rds_conn_destroy(), so rds_tcp_conn_paths_destroy()
is not needed any more and is removed in this patch.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/rds/tcp.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/net/rds/tcp.c b/net/rds/tcp.c index 6b7ee71f40c6..222cc530e5b5 100644 --- a/net/rds/tcp.c +++ b/net/rds/tcp.c | |||
@@ -495,27 +495,6 @@ static struct pernet_operations rds_tcp_net_ops = { | |||
495 | .size = sizeof(struct rds_tcp_net), | 495 | .size = sizeof(struct rds_tcp_net), |
496 | }; | 496 | }; |
497 | 497 | ||
498 | /* explicitly send a RST on each socket, thereby releasing any socket refcnts | ||
499 | * that may otherwise hold up netns deletion. | ||
500 | */ | ||
501 | static void rds_tcp_conn_paths_destroy(struct rds_connection *conn) | ||
502 | { | ||
503 | struct rds_conn_path *cp; | ||
504 | struct rds_tcp_connection *tc; | ||
505 | int i; | ||
506 | struct sock *sk; | ||
507 | |||
508 | for (i = 0; i < RDS_MPATH_WORKERS; i++) { | ||
509 | cp = &conn->c_path[i]; | ||
510 | tc = cp->cp_transport_data; | ||
511 | if (!tc->t_sock) | ||
512 | continue; | ||
513 | sk = tc->t_sock->sk; | ||
514 | sk->sk_prot->disconnect(sk, 0); | ||
515 | tcp_done(sk); | ||
516 | } | ||
517 | } | ||
518 | |||
519 | static void rds_tcp_kill_sock(struct net *net) | 498 | static void rds_tcp_kill_sock(struct net *net) |
520 | { | 499 | { |
521 | struct rds_tcp_connection *tc, *_tc; | 500 | struct rds_tcp_connection *tc, *_tc; |
@@ -535,10 +514,8 @@ static void rds_tcp_kill_sock(struct net *net) | |||
535 | list_move_tail(&tc->t_tcp_node, &tmp_list); | 514 | list_move_tail(&tc->t_tcp_node, &tmp_list); |
536 | } | 515 | } |
537 | spin_unlock_irq(&rds_tcp_conn_lock); | 516 | spin_unlock_irq(&rds_tcp_conn_lock); |
538 | list_for_each_entry_safe(tc, _tc, &tmp_list, t_tcp_node) { | 517 | list_for_each_entry_safe(tc, _tc, &tmp_list, t_tcp_node) |
539 | rds_tcp_conn_paths_destroy(tc->t_cpath->cp_conn); | ||
540 | rds_conn_destroy(tc->t_cpath->cp_conn); | 518 | rds_conn_destroy(tc->t_cpath->cp_conn); |
541 | } | ||
542 | } | 519 | } |
543 | 520 | ||
544 | void *rds_tcp_listen_sock_def_readable(struct net *net) | 521 | void *rds_tcp_listen_sock_def_readable(struct net *net) |