diff options
author | Zach Brown <zach.brown@oracle.com> | 2010-05-24 16:14:36 -0400 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:15:18 -0400 |
commit | f3c6808d3d8513db2b0543538fc35c25a60fe7a7 (patch) | |
tree | 84ef99e9d615351000c5cfa81cc08c8c8ffb4be6 /net/rds/connection.c | |
parent | 3e0249f9c05cb77b66f7f09644ca9ca208d991a9 (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/connection.c')
-rw-r--r-- | net/rds/connection.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c index 180b83ab2607..5bd96d538fb9 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c | |||
@@ -540,6 +540,18 @@ void rds_conn_drop(struct rds_connection *conn) | |||
540 | EXPORT_SYMBOL_GPL(rds_conn_drop); | 540 | EXPORT_SYMBOL_GPL(rds_conn_drop); |
541 | 541 | ||
542 | /* | 542 | /* |
543 | * If the connection is down, trigger a connect. We may have scheduled a | ||
544 | * delayed reconnect however - in this case we should not interfere. | ||
545 | */ | ||
546 | void rds_conn_connect_if_down(struct rds_connection *conn) | ||
547 | { | ||
548 | if (rds_conn_state(conn) == RDS_CONN_DOWN && | ||
549 | !test_and_set_bit(RDS_RECONNECT_PENDING, &conn->c_flags)) | ||
550 | queue_delayed_work(rds_wq, &conn->c_conn_w, 0); | ||
551 | } | ||
552 | EXPORT_SYMBOL_GPL(rds_conn_connect_if_down); | ||
553 | |||
554 | /* | ||
543 | * An error occurred on the connection | 555 | * An error occurred on the connection |
544 | */ | 556 | */ |
545 | void | 557 | void |