summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/clear.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/locks/src/clear.c')
-rw-r--r--xlators/features/locks/src/clear.c46
1 files changed, 19 insertions, 27 deletions
diff --git a/xlators/features/locks/src/clear.c b/xlators/features/locks/src/clear.c
index 6c6afe008..124b9ad0f 100644
--- a/xlators/features/locks/src/clear.c
+++ b/xlators/features/locks/src/clear.c
@@ -1,22 +1,12 @@
/*
- Copyright (c) 2006-2011 Gluster, Inc. <http://www.gluster.com>
- This file is part of GlusterFS.
-
- GlusterFS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3 of the License,
- or (at your option) any later version.
-
- GlusterFS is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see
- <http://www.gnu.org/licenses/>.
-*/
+ Copyright (c) 2006-2012 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
+*/
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
@@ -141,15 +131,15 @@ clrlk_parse_args (const char* cmd, clrlk_args *args)
if ((args->type == CLRLK_TYPE_MAX) || (args->kind == CLRLK_KIND_MAX))
goto out;
- /*optional args*/
- tok = strtok_r (NULL, ".", &sptr);
+ /*optional args, neither range nor basename can 'legally' contain
+ * "/" in them*/
+ tok = strtok_r (NULL, "/", &sptr);
if (tok)
args->opts = gf_strdup (tok);
ret = 0;
out:
- if (free_ptr)
- GF_FREE (free_ptr);
+ GF_FREE (free_ptr);
return ret;
}
@@ -193,8 +183,8 @@ clrlk_clear_posixlk (xlator_t *this, pl_inode_t *pl_inode, clrlk_args *args,
F_SETLKW, &plock->user_flock,
-1, EAGAIN, NULL);
- STACK_UNWIND (plock->frame, -1, EAGAIN,
- &plock->user_flock);
+ STACK_UNWIND_STRICT (lk, plock->frame, -1, EAGAIN,
+ &plock->user_flock, NULL);
} else {
gcount++;
@@ -261,7 +251,7 @@ blkd:
&ilock->user_flock, -1, EAGAIN,
ilock->volume);
STACK_UNWIND_STRICT (inodelk, ilock->frame, -1,
- EAGAIN);
+ EAGAIN, NULL);
//No need to take lock as the locks are only in one list
__pl_inodelk_unref (ilock);
}
@@ -335,6 +325,7 @@ blkd:
}
bcount++;
+
list_del_init (&elock->blocked_locks);
list_add_tail (&elock->blocked_locks, &released);
}
@@ -346,8 +337,9 @@ blkd:
entrylk_trace_out (this, elock->frame, elock->volume, NULL, NULL,
elock->basename, ENTRYLK_LOCK, elock->type,
-1, EAGAIN);
- STACK_UNWIND_STRICT (entrylk, elock->frame, -1, EAGAIN);
+ STACK_UNWIND_STRICT (entrylk, elock->frame, -1, EAGAIN, NULL);
GF_FREE ((char *) elock->basename);
+ GF_FREE (elock->connection_id);
GF_FREE (elock);
}
@@ -388,8 +380,8 @@ out:
int
clrlk_clear_lks_in_all_domains (xlator_t *this, pl_inode_t *pl_inode,
- clrlk_args *args, int *blkd, int *granted,
- int *op_errno)
+ clrlk_args *args, int *blkd, int *granted,
+ int *op_errno)
{
pl_dom_list_t *dom = NULL;
int ret = -1;