From: Ilya Dryomov Date: Thu, 16 Jan 2014 17:25:08 +0000 (+0200) Subject: libceph: introduce con_fault_raise() and switch to it X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=38ff2a061c2fada5a7b87af756f2bda021291be4;p=ceph-client.git libceph: introduce con_fault_raise() and switch to it In preparation for connect timeout abstract ceph_connection fault-initiating logic into a separate function and start using it. Signed-off-by: Ilya Dryomov --- diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 2ed1304d22a7..c7e0143d24f1 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -378,6 +378,14 @@ static void con_sock_state_closed(struct ceph_connection *con) CON_SOCK_STATE_CLOSED); } + +static void con_fault_raise(struct ceph_connection *con) +{ + con_flag_set(con, CON_FLAG_SOCK_CLOSED); + queue_con(con); +} + + /* * socket callback functions */ @@ -434,8 +442,7 @@ static void ceph_sock_state_change(struct sock *sk) case TCP_CLOSE_WAIT: dout("%s TCP_CLOSE_WAIT\n", __func__); con_sock_state_closing(con); - con_flag_set(con, CON_FLAG_SOCK_CLOSED); - queue_con(con); + con_fault_raise(con); break; case TCP_ESTABLISHED: dout("%s TCP_ESTABLISHED\n", __func__);