提交 1c032c03 编写于 作者: D David Teigland 提交者: Steven Whitehouse

[DLM] PATCH 2/3 dlm: lowcomms close

When a node is removed from a lockspace configuration, close our
connection to it, clearing any remaining messages for it.
Signed-off-by: NDavid Teigland <teigland@redhat.com>
Signed-off-by: NPatrick Caulfield <pcaulfie@redhat.com>
Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
上级 ae118962
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <net/sock.h> #include <net/sock.h>
#include "config.h" #include "config.h"
#include "lowcomms.h"
/* /*
* /config/dlm/<cluster>/spaces/<space>/nodes/<node>/nodeid * /config/dlm/<cluster>/spaces/<space>/nodes/<node>/nodeid
...@@ -429,6 +430,7 @@ static void drop_comm(struct config_group *g, struct config_item *i) ...@@ -429,6 +430,7 @@ static void drop_comm(struct config_group *g, struct config_item *i)
struct comm *cm = to_comm(i); struct comm *cm = to_comm(i);
if (local_comm == cm) if (local_comm == cm)
local_comm = NULL; local_comm = NULL;
dlm_lowcomms_close(cm->nodeid);
while (cm->addr_count--) while (cm->addr_count--)
kfree(cm->addr[cm->addr_count]); kfree(cm->addr[cm->addr_count]);
config_item_put(i); config_item_put(i);
......
...@@ -1063,6 +1063,27 @@ static void dealloc_nodeinfo(void) ...@@ -1063,6 +1063,27 @@ static void dealloc_nodeinfo(void)
} }
} }
int dlm_lowcomms_close(int nodeid)
{
struct nodeinfo *ni;
ni = nodeid2nodeinfo(nodeid, 0);
if (!ni)
return -1;
spin_lock(&ni->lock);
if (ni->assoc_id) {
ni->assoc_id = 0;
/* Don't send shutdown here, sctp will just queue it
till the node comes back up! */
}
spin_unlock(&ni->lock);
clean_one_writequeue(ni);
clear_bit(NI_INIT_PENDING, &ni->flags);
return 0;
}
static int write_list_empty(void) static int write_list_empty(void)
{ {
int status; int status;
......
...@@ -18,6 +18,7 @@ int dlm_lowcomms_init(void); ...@@ -18,6 +18,7 @@ int dlm_lowcomms_init(void);
void dlm_lowcomms_exit(void); void dlm_lowcomms_exit(void);
int dlm_lowcomms_start(void); int dlm_lowcomms_start(void);
void dlm_lowcomms_stop(void); void dlm_lowcomms_stop(void);
int dlm_lowcomms_close(int nodeid);
void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc); void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc);
void dlm_lowcomms_commit_buffer(void *mh); void dlm_lowcomms_commit_buffer(void *mh);
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "member.h" #include "member.h"
#include "recoverd.h" #include "recoverd.h"
#include "recover.h" #include "recover.h"
#include "lowcomms.h"
#include "rcom.h" #include "rcom.h"
#include "config.h" #include "config.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册