aboutsummaryrefslogtreecommitdiff
path: root/net/rds/send.c
diff options
context:
space:
mode:
authorZach Brown <zach.brown@oracle.com>2010-05-24 13:14:36 -0700
committerAndy Grover <andy.grover@oracle.com>2010-09-08 18:15:18 -0700
commitf3c6808d3d8513db2b0543538fc35c25a60fe7a7 (patch)
tree84ef99e9d615351000c5cfa81cc08c8c8ffb4be6 /net/rds/send.c
parent3e0249f9c05cb77b66f7f09644ca9ca208d991a9 (diff)
RDS: introduce rds_conn_connect_if_down()
A few paths had the same block of code to queue a connection's connect work if it was in the right state. Let's move this in to a helper function. Signed-off-by: Zach Brown <zach.brown@oracle.com>
Diffstat (limited to 'net/rds/send.c')
-rw-r--r--net/rds/send.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/net/rds/send.c b/net/rds/send.c
index 437f1e72609..a6295993e3e 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -1036,13 +1036,7 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
goto out;
}
- /* If the connection is down, trigger a connect. We may
- * have scheduled a delayed reconnect however - in this case
- * we should not interfere.
- */
- if (rds_conn_state(conn) == RDS_CONN_DOWN &&
- !test_and_set_bit(RDS_RECONNECT_PENDING, &conn->c_flags))
- queue_delayed_work(rds_wq, &conn->c_conn_w, 0);
+ rds_conn_connect_if_down(conn);
ret = rds_cong_wait(conn->c_fcong, dport, nonblock, rs);
if (ret) {
@@ -1122,13 +1116,7 @@ rds_send_pong(struct rds_connection *conn, __be16 dport)
rm->m_daddr = conn->c_faddr;
rm->data.op_active = 1;
- /* If the connection is down, trigger a connect. We may
- * have scheduled a delayed reconnect however - in this case
- * we should not interfere.
- */
- if (rds_conn_state(conn) == RDS_CONN_DOWN &&
- !test_and_set_bit(RDS_RECONNECT_PENDING, &conn->c_flags))
- queue_delayed_work(rds_wq, &conn->c_conn_w, 0);
+ rds_conn_connect_if_down(conn);
ret = rds_cong_wait(conn->c_fcong, dport, 1, NULL);
if (ret)