aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-04-28 10:50:41 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-04-28 10:50:41 -0400
commit1c032c03117c014512195f2e33c3af999f132146 (patch)
tree2032d1965331fb1882fdb306c678cf4497b35c10 /fs
parentae118962b9f8572b5ff00e85c053dbeede2314db (diff)
[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: David Teigland <teigland@redhat.com> Signed-off-by: Patrick Caulfield <pcaulfie@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/dlm/config.c2
-rw-r--r--fs/dlm/lowcomms.c21
-rw-r--r--fs/dlm/lowcomms.h1
-rw-r--r--fs/dlm/member.c1
4 files changed, 24 insertions, 1 deletions
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 87df9616415e..88553054bbfa 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -17,6 +17,7 @@
17#include <net/sock.h> 17#include <net/sock.h>
18 18
19#include "config.h" 19#include "config.h"
20#include "lowcomms.h"
20 21
21/* 22/*
22 * /config/dlm/<cluster>/spaces/<space>/nodes/<node>/nodeid 23 * /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 struct comm *cm = to_comm(i); 430 struct comm *cm = to_comm(i);
430 if (local_comm == cm) 431 if (local_comm == cm)
431 local_comm = NULL; 432 local_comm = NULL;
433 dlm_lowcomms_close(cm->nodeid);
432 while (cm->addr_count--) 434 while (cm->addr_count--)
433 kfree(cm->addr[cm->addr_count]); 435 kfree(cm->addr[cm->addr_count]);
434 config_item_put(i); 436 config_item_put(i);
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 09b0124f7fc4..cdd168e4bf45 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1063,6 +1063,27 @@ static void dealloc_nodeinfo(void)
1063 } 1063 }
1064} 1064}
1065 1065
1066int dlm_lowcomms_close(int nodeid)
1067{
1068 struct nodeinfo *ni;
1069
1070 ni = nodeid2nodeinfo(nodeid, 0);
1071 if (!ni)
1072 return -1;
1073
1074 spin_lock(&ni->lock);
1075 if (ni->assoc_id) {
1076 ni->assoc_id = 0;
1077 /* Don't send shutdown here, sctp will just queue it
1078 till the node comes back up! */
1079 }
1080 spin_unlock(&ni->lock);
1081
1082 clean_one_writequeue(ni);
1083 clear_bit(NI_INIT_PENDING, &ni->flags);
1084 return 0;
1085}
1086
1066static int write_list_empty(void) 1087static int write_list_empty(void)
1067{ 1088{
1068 int status; 1089 int status;
diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h
index 3af8035ff12f..6c04bb09cfa8 100644
--- a/fs/dlm/lowcomms.h
+++ b/fs/dlm/lowcomms.h
@@ -18,6 +18,7 @@ int dlm_lowcomms_init(void);
18void dlm_lowcomms_exit(void); 18void dlm_lowcomms_exit(void);
19int dlm_lowcomms_start(void); 19int dlm_lowcomms_start(void);
20void dlm_lowcomms_stop(void); 20void dlm_lowcomms_stop(void);
21int dlm_lowcomms_close(int nodeid);
21void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc); 22void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc);
22void dlm_lowcomms_commit_buffer(void *mh); 23void dlm_lowcomms_commit_buffer(void *mh);
23 24
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
index 926cd0cb6bff..cd0c51e724e0 100644
--- a/fs/dlm/member.c
+++ b/fs/dlm/member.c
@@ -15,7 +15,6 @@
15#include "member.h" 15#include "member.h"
16#include "recoverd.h" 16#include "recoverd.h"
17#include "recover.h" 17#include "recover.h"
18#include "lowcomms.h"
19#include "rcom.h" 18#include "rcom.h"
20#include "config.h" 19#include "config.h"
21 20