From e7fd41792fc0ee52a05fcaac87511f118328d147 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 18 Jan 2006 09:30:29 +0000 Subject: [DLM] The core of the DLM for GFS2/CLVM This is the core of the distributed lock manager which is required to use GFS2 as a cluster filesystem. It is also used by CLVM and can be used as a standalone lock manager independantly of either of these two projects. It implements VAX-style locking modes. Signed-off-by: David Teigland Signed-off-by: Steve Whitehouse --- fs/dlm/lowcomms.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 fs/dlm/lowcomms.h (limited to 'fs/dlm/lowcomms.h') diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h new file mode 100644 index 00000000000000..3af8035ff12fcd --- /dev/null +++ b/fs/dlm/lowcomms.h @@ -0,0 +1,25 @@ +/****************************************************************************** +******************************************************************************* +** +** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. +** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. +** +** This copyrighted material is made available to anyone wishing to use, +** modify, copy, or redistribute it subject to the terms and conditions +** of the GNU General Public License v.2. +** +******************************************************************************* +******************************************************************************/ + +#ifndef __LOWCOMMS_DOT_H__ +#define __LOWCOMMS_DOT_H__ + +int dlm_lowcomms_init(void); +void dlm_lowcomms_exit(void); +int dlm_lowcomms_start(void); +void dlm_lowcomms_stop(void); +void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc); +void dlm_lowcomms_commit_buffer(void *mh); + +#endif /* __LOWCOMMS_DOT_H__ */ + -- cgit 1.2.3-korg From 1c032c03117c014512195f2e33c3af999f132146 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Fri, 28 Apr 2006 10:50:41 -0400 Subject: [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 Signed-off-by: Patrick Caulfield Signed-off-by: Steven Whitehouse --- fs/dlm/config.c | 2 ++ fs/dlm/lowcomms.c | 21 +++++++++++++++++++++ fs/dlm/lowcomms.h | 1 + fs/dlm/member.c | 1 - 4 files changed, 24 insertions(+), 1 deletion(-) (limited to 'fs/dlm/lowcomms.h') diff --git a/fs/dlm/config.c b/fs/dlm/config.c index 87df9616415e5d..88553054bbfa4c 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c @@ -17,6 +17,7 @@ #include #include "config.h" +#include "lowcomms.h" /* * /config/dlm//spaces//nodes//nodeid @@ -429,6 +430,7 @@ static void drop_comm(struct config_group *g, struct config_item *i) struct comm *cm = to_comm(i); if (local_comm == cm) local_comm = NULL; + dlm_lowcomms_close(cm->nodeid); while (cm->addr_count--) kfree(cm->addr[cm->addr_count]); config_item_put(i); diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 09b0124f7fc41c..cdd168e4bf450c 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -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) { int status; diff --git a/fs/dlm/lowcomms.h b/fs/dlm/lowcomms.h index 3af8035ff12fcd..6c04bb09cfa8dc 100644 --- a/fs/dlm/lowcomms.h +++ b/fs/dlm/lowcomms.h @@ -18,6 +18,7 @@ int dlm_lowcomms_init(void); void dlm_lowcomms_exit(void); int dlm_lowcomms_start(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_commit_buffer(void *mh); diff --git a/fs/dlm/member.c b/fs/dlm/member.c index 926cd0cb6bffff..cd0c51e724e07a 100644 --- a/fs/dlm/member.c +++ b/fs/dlm/member.c @@ -15,7 +15,6 @@ #include "member.h" #include "recoverd.h" #include "recover.h" -#include "lowcomms.h" #include "rcom.h" #include "config.h" -- cgit 1.2.3-korg