From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH dlm/next 6/9] fs: dlm: move connect callback in node creation
Date: Mon, 19 Oct 2020 14:59:13 -0400 [thread overview]
Message-ID: <20201019185916.707827-7-aahringo@redhat.com> (raw)
In-Reply-To: <20201019185916.707827-1-aahringo@redhat.com>
This patch moves the assignment for the connect callback to the node
creation instead of assign some dummy functionality. The assignment
which connect functionality will be used will be detected according to
the configfs setting.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/lowcomms.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 70a216a20dbb9..e8657ae023654 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -142,6 +142,8 @@ DEFINE_STATIC_SRCU(connections_srcu);
static void process_recv_sockets(struct work_struct *work);
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);
/* This is deliberately very simple because most clusters have simple
sequential nodeids, so we should be able to go straight to a connection
@@ -206,11 +208,15 @@ static struct connection *nodeid2con(int nodeid, gfp_t alloc)
if (con->nodeid) {
struct connection *zerocon = __find_con(0);
- con->connect_action = zerocon->connect_action;
if (!con->rx_action)
con->rx_action = zerocon->rx_action;
}
+ if (dlm_config.ci_protocol == 0)
+ con->connect_action = tcp_connect_to_sock;
+ else
+ con->connect_action = sctp_connect_to_sock;
+
r = nodeid_hash(nodeid);
spin_lock(&connections_lock);
@@ -1009,7 +1015,6 @@ static void sctp_connect_to_sock(struct connection *con)
sock_set_mark(sock->sk, mark);
con->rx_action = receive_from_sock;
- con->connect_action = sctp_connect_to_sock;
add_sock(sock, con);
/* Bind to all addresses. */
@@ -1107,7 +1112,6 @@ static void tcp_connect_to_sock(struct connection *con)
}
con->rx_action = receive_from_sock;
- con->connect_action = tcp_connect_to_sock;
con->shutdown_action = dlm_tcp_shutdown;
add_sock(sock, con);
@@ -1195,7 +1199,6 @@ static struct socket *tcp_create_listen_sock(struct connection *con,
sock->sk->sk_user_data = con;
save_listen_callbacks(sock);
con->rx_action = accept_from_sock;
- con->connect_action = tcp_connect_to_sock;
write_unlock_bh(&sock->sk->sk_callback_lock);
/* Bind to our port */
@@ -1278,7 +1281,6 @@ static int sctp_listen_for_all(void)
con->sock = sock;
con->sock->sk->sk_data_ready = lowcomms_data_ready;
con->rx_action = accept_from_sock;
- con->connect_action = sctp_connect_to_sock;
write_unlock_bh(&sock->sk->sk_callback_lock);
--
2.26.2
next prev parent reply other threads:[~2020-10-19 18:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 18:59 [Cluster-devel] [PATCH dlm/next 0/9] fs: dlm: fixes and change listen socket handling Alexander Aring
2020-10-19 18:59 ` [Cluster-devel] [PATCH dlm/next 1/9] fs: dlm: fix proper srcu api call Alexander Aring
2020-10-19 18:59 ` [Cluster-devel] [PATCH dlm/next 2/9] fs: dlm: define max send buffer Alexander Aring
2020-10-19 18:59 ` [Cluster-devel] [PATCH dlm/next 3/9] fs: dlm: add get buffer error handling Alexander Aring
2020-10-19 18:59 ` [Cluster-devel] [PATCH dlm/next 4/9] fs: dlm: flush othercon at close Alexander Aring
2020-10-19 18:59 ` [Cluster-devel] [PATCH dlm/next 5/9] fs: dlm: handle non blocked connect event Alexander Aring
2020-10-19 18:59 ` Alexander Aring [this message]
2020-10-19 18:59 ` [Cluster-devel] [PATCH dlm/next 7/9] fs: dlm: move shutdown action to node creation Alexander Aring
2020-10-19 18:59 ` [Cluster-devel] [PATCH dlm/next 8/9] fs: dlm: refactor sctp sock parameter Alexander Aring
2020-10-19 18:59 ` [Cluster-devel] [PATCH dlm/next 9/9] fs: dlm: listen socket out of connection hash Alexander Aring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201019185916.707827-7-aahringo@redhat.com \
--to=aahringo@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).