summary refs log tree commit diff
path: root/fs/dlm/midcomms.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2021-05-21 15:08:42 -0400
committerDavid Teigland <teigland@redhat.com>2021-05-25 09:22:20 -0500
commit8f2dc78dbc2010b497bb58e0460cb44c678a3c5b (patch)
tree63b4528cf5521cfbf0c5aa085693170223afc634 /fs/dlm/midcomms.c
parenta070a91cf1402b5328d3517d1fccbdeec58d3f2d (diff)
downloadlinux-8f2dc78dbc2010b497bb58e0460cb44c678a3c5b.tar.gz
fs: dlm: make buffer handling per msg
This patch makes the void pointer handle for lowcomms functionality per
message and not per page allocation entry. A refcount handling for the
handle was added to keep the message alive until the user doesn't need
it anymore.

There exists now a per message callback which will be called when
allocating a new buffer. This callback will be guaranteed to be called
according the order of the sending buffer, which can be used that the
caller increments a sequence number for the dlm message handle.

For transition process we cast the dlm_mhandle to dlm_msg and vice versa
until the midcomms layer will implement a specific dlm_mhandle structure.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/midcomms.c')
-rw-r--r--fs/dlm/midcomms.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c
index 1a280dda99d3..aadb3781bebe 100644
--- a/fs/dlm/midcomms.c
+++ b/fs/dlm/midcomms.c
@@ -31,12 +31,15 @@
 struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len,
 					     gfp_t allocation, char **ppc)
 {
-	return dlm_lowcomms_get_buffer(nodeid, len, allocation, ppc);
+	return (struct dlm_mhandle *)dlm_lowcomms_new_msg(nodeid, len,
+							  allocation, ppc,
+							  NULL, NULL);
 }
 
 void dlm_midcomms_commit_mhandle(struct dlm_mhandle *mh)
 {
-	dlm_lowcomms_commit_buffer(mh);
+	dlm_lowcomms_commit_msg((struct dlm_msg *)mh);
+	dlm_lowcomms_put_msg((struct dlm_msg *)mh);
 }
 
 void dlm_midcomms_add_member(int nodeid) { }