Skip to content

Commit

Permalink
fs: dlm: move shutdown action to node creation
Browse files Browse the repository at this point in the history
This patch move the assignment for the shutdown action callback to the
node creation functionality.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Alexander Aring authored and David Teigland committed Nov 10, 2020
1 parent 0672c3c commit 42873c9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -187,10 +188,12 @@ static int dlm_con_init(struct connection *con, int nodeid)
INIT_WORK(&con->rwork, process_recv_sockets);
init_waitqueue_head(&con->shutdown_wait);

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;
}

return 0;
}
Expand Down Expand Up @@ -1101,7 +1104,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
Expand Down

0 comments on commit 42873c9

Please sign in to comment.