summaryrefslogtreecommitdiffstats
path: root/dlm
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2010-11-04 15:30:08 -0500
committerDavid Teigland <teigland@redhat.com>2010-11-04 15:30:08 -0500
commit47e1906aaef5a931cedb6d3bff4fd35498cbdaed (patch)
tree541091fd06c3164ed5a7b11ec0cbb23da1a0b5dd /dlm
parent74aa9290217af9e5cd5412c6a7189d4195207f07 (diff)
downloaddct-stuff-47e1906aaef5a931cedb6d3bff4fd35498cbdaed.tar.gz
dct-stuff-47e1906aaef5a931cedb6d3bff4fd35498cbdaed.tar.xz
dct-stuff-47e1906aaef5a931cedb6d3bff4fd35498cbdaed.zip
dlm_kill: dlm_lock release
to forcibly clear default lockspace Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'dlm')
-rw-r--r--dlm/dlm_kill/dlm_lock.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/dlm/dlm_kill/dlm_lock.c b/dlm/dlm_kill/dlm_lock.c
index fe15eac..7833570 100644
--- a/dlm/dlm_kill/dlm_lock.c
+++ b/dlm/dlm_kill/dlm_lock.c
@@ -32,6 +32,20 @@
static int ast_called = 0;
static int quit;
+static int do_release(void)
+{
+ static dlm_lshandle_t *dh;
+
+ dh = dlm_create_lockspace("default", 0600);
+ if (!dh) {
+ printf("dlm_lock create lockspace error\n");
+ return -1;
+ }
+
+ dlm_release_lockspace("default", dh, 1);
+ return 0;
+}
+
void sigterm_handler(int sig)
{
quit = 1;
@@ -114,6 +128,11 @@ int main(int argc, char *argv[])
printf("dlm_lock pid %d\n", getpid());
+ if (argc > 1 && !strcmp(argv[1], "release")) {
+ do_release();
+ return 0;
+ }
+
if (argc < 2)
count = 1;
else