summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/posix.c
diff options
context:
space:
mode:
authorPavan Vilas Sondur <pavan@dev.gluster.com>2009-09-23 06:02:55 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-23 06:27:30 -0700
commit231196910d9d36af9546ddc511b26da5628b3ab8 (patch)
treee12dd77d1739f4eb7777d27b0d66c1683966d409 /xlators/features/locks/src/posix.c
parent435b28132b8f276681d19ae14fa988d26a16f659 (diff)
Implemented entry locks and support for domains.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 222 (Enhance Internal locks to support multilple domains and rewrite inodelks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=222
Diffstat (limited to 'xlators/features/locks/src/posix.c')
-rw-r--r--xlators/features/locks/src/posix.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 5514d441495..cbad7844ea1 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -713,15 +713,18 @@ pl_forget (xlator_t *this,
pl_entry_lock_t *entry_tmp = NULL;
pl_entry_lock_t *entry_l = NULL;
+ pl_dom_list_t *dom = NULL;
+ pl_dom_list_t *dom_tmp = NULL;
+
pl_inode = pl_inode_get (this, inode);
if (!list_empty (&pl_inode->rw_list)) {
gf_log (this->name, GF_LOG_DEBUG,
"Pending R/W requests found, releasing.");
-
- list_for_each_entry_safe (rw_req, rw_tmp, &pl_inode->rw_list,
+
+ list_for_each_entry_safe (rw_req, rw_tmp, &pl_inode->rw_list,
list) {
-
+
list_del (&rw_req->list);
FREE (rw_req);
}
@@ -731,9 +734,9 @@ pl_forget (xlator_t *this,
gf_log (this->name, GF_LOG_DEBUG,
"Pending fcntl locks found, releasing.");
- list_for_each_entry_safe (ext_l, ext_tmp, &pl_inode->ext_list,
+ list_for_each_entry_safe (ext_l, ext_tmp, &pl_inode->ext_list,
list) {
-
+
__delete_lock (pl_inode, ext_l);
__destroy_lock (ext_l);
}
@@ -743,25 +746,32 @@ pl_forget (xlator_t *this,
gf_log (this->name, GF_LOG_DEBUG,
"Pending inode locks found, releasing.");
- list_for_each_entry_safe (int_l, int_tmp, &pl_inode->int_list,
+ list_for_each_entry_safe (int_l, int_tmp, &pl_inode->int_list,
list) {
-
+
__delete_lock (pl_inode, int_l);
__destroy_lock (int_l);
}
}
- if (!list_empty (&pl_inode->dir_list)) {
- gf_log (this->name, GF_LOG_DEBUG,
- "Pending entry locks found, releasing.");
-
- list_for_each_entry_safe (entry_l, entry_tmp,
- &pl_inode->dir_list, inode_list) {
-
- list_del (&entry_l->inode_list);
- FREE (entry_l);
+ list_for_each_entry_safe (dom, dom_tmp, &pl_inode->dom_list, inode_list) {
+ if (!list_empty (&dom->entrylk_list)) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Pending entry locks found, releasing.");
+
+ list_for_each_entry_safe (entry_l, entry_tmp, &dom->entrylk_list, domain_list) {
+ list_del_init (&entry_l->domain_list);
+ grant_blocked_entry_locks (this, pl_inode, entry_l, dom);
+ if (entry_l->basename)
+ FREE (entry_l->basename);
+ FREE (entry_l);
+ }
+
}
- }
+ list_del (&dom->inode_list);
+ FREE (dom->domain);
+ FREE (dom);
+ }
FREE (pl_inode);