summaryrefslogtreecommitdiff
path: root/fs/dlm/config.h
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2020-09-24 17:31:26 +0300
committerDavid Teigland <teigland@redhat.com>2020-09-29 22:00:32 +0300
commit4798cbbfbd00c498339bdcf4cc2429f53eb374ec (patch)
tree97d35239f9ce8c5a3453234629b7a5b54732cb53 /fs/dlm/config.h
parent4e192ee68e5af301470a925b76700d788db35d96 (diff)
downloadlinux-4798cbbfbd00c498339bdcf4cc2429f53eb374ec.tar.xz
fs: dlm: rework receive handling
This patch reworks the current receive handling of dlm. As I tried to change the send handling to fix reorder issues I took a look into the receive handling and simplified it, it works as the following: Each connection has a preallocated receive buffer with a minimum length of 4096. On receive, the upper layer protocol will process all dlm message until there is not enough data anymore. If there exists "leftover" data at the end of the receive buffer because the dlm message wasn't fully received it will be copied to the begin of the preallocated receive buffer. Next receive more data will be appended to the previous "leftover" data and processing will begin again. This will remove a lot of code of the current mechanism. Inside the processing functionality we will ensure with a memmove() that the dlm message should be memory aligned. To have a dlm message always started at the beginning of the buffer will reduce some amount of memmove() calls because src and dest pointers are the same. The cluster attribute "buffer_size" becomes a new meaning, it's now the size of application layer receive buffer size. If this is changed during runtime the receive buffer will be reallocated. It's important that the receive buffer size has at minimum the size of the maximum possible dlm message size otherwise the received message cannot be placed inside the receive buffer size. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/config.h')
-rw-r--r--fs/dlm/config.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/dlm/config.h b/fs/dlm/config.h
index 3b284ae9aeeb..c210250a2581 100644
--- a/fs/dlm/config.h
+++ b/fs/dlm/config.h
@@ -12,6 +12,8 @@
#ifndef __CONFIG_DOT_H__
#define __CONFIG_DOT_H__
+#define DEFAULT_BUFFER_SIZE 4096
+
struct dlm_config_node {
int nodeid;
int weight;