From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Aring Date: Mon, 19 Oct 2020 14:59:14 -0400 Subject: [Cluster-devel] [PATCH dlm/next 7/9] fs: dlm: move shutdown action to node creation In-Reply-To: <20201019185916.707827-1-aahringo@redhat.com> References: <20201019185916.707827-1-aahringo@redhat.com> Message-ID: <20201019185916.707827-8-aahringo@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch move the assignment for the shutdown action callback to the node creation functionality. Signed-off-by: Alexander Aring --- fs/dlm/lowcomms.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index e8657ae023654..bae4125c22deb 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -144,6 +144,7 @@ static void process_send_sockets(struct work_struct *work); static void sctp_connect_to_sock(struct connection *con); static void tcp_connect_to_sock(struct connection *con); +static void dlm_tcp_shutdown(struct connection *con); /* This is deliberately very simple because most clusters have simple sequential nodeids, so we should be able to go straight to a connection @@ -212,10 +213,12 @@ static struct connection *nodeid2con(int nodeid, gfp_t alloc) con->rx_action = zerocon->rx_action; } - if (dlm_config.ci_protocol == 0) + if (dlm_config.ci_protocol == 0) { con->connect_action = tcp_connect_to_sock; - else + con->shutdown_action = dlm_tcp_shutdown; + } else { con->connect_action = sctp_connect_to_sock; + } r = nodeid_hash(nodeid); @@ -1112,7 +1115,6 @@ static void tcp_connect_to_sock(struct connection *con) } con->rx_action = receive_from_sock; - con->shutdown_action = dlm_tcp_shutdown; add_sock(sock, con); /* Bind to our cluster-known address connecting to avoid -- 2.26.2