Skip to content

Commit 2d746c9

Browse files
sowminivdavem330
authored andcommitted
rds: tcp: remove redundant function rds_tcp_conn_paths_destroy()
A side-effect of Commit c14b036 ("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 <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4c94cc2 commit 2d746c9

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

net/rds/tcp.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -495,27 +495,6 @@ static struct pernet_operations rds_tcp_net_ops = {
495495
.size = sizeof(struct rds_tcp_net),
496496
};
497497

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-
519498
static void rds_tcp_kill_sock(struct net *net)
520499
{
521500
struct rds_tcp_connection *tc, *_tc;
@@ -535,10 +514,8 @@ static void rds_tcp_kill_sock(struct net *net)
535514
list_move_tail(&tc->t_tcp_node, &tmp_list);
536515
}
537516
spin_unlock_irq(&rds_tcp_conn_lock);
538-
list_for_each_entry_safe(tc, _tc, &tmp_list, t_tcp_node) {
539-
rds_tcp_conn_paths_destroy(tc->t_cpath->cp_conn);
517+
list_for_each_entry_safe(tc, _tc, &tmp_list, t_tcp_node)
540518
rds_conn_destroy(tc->t_cpath->cp_conn);
541-
}
542519
}
543520

544521
void *rds_tcp_listen_sock_def_readable(struct net *net)

0 commit comments

Comments
 (0)