diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-04-22 01:02:09 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-22 14:23:46 +0530 |
commit | df6d9e16817d952c17700d44ab478e6d6af704a0 (patch) | |
tree | 910356a487c84ed1b44dba29a48c72718b13088c /xlators/features | |
parent | 7eb63e30f22f7a9d785f6620be22d2b3aab77ada (diff) |
Release all pending locks in pl_forget().
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/locks/src/posix.c | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index ff557ed6693..09823b46d31 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -700,27 +700,67 @@ pl_forget (xlator_t *this, inode_t *inode) { pl_inode_t *pl_inode = NULL; + + posix_lock_t *ext_tmp = NULL; + posix_lock_t *ext_l = NULL; + + posix_lock_t *int_tmp = NULL; + posix_lock_t *int_l = NULL; + + pl_rw_req_t *rw_tmp = NULL; + pl_rw_req_t *rw_req = NULL; + + pl_entry_lock_t *entry_tmp = NULL; + pl_entry_lock_t *entry_l = NULL; pl_inode = pl_inode_get (this, inode); if (!list_empty (&pl_inode->rw_list)) { gf_log (this->name, GF_LOG_CRITICAL, - "pending R/W requests found!"); + "pending R/W requests found, releasing."); + + list_for_each_entry_safe (rw_req, rw_tmp, &pl_inode->rw_list, + list) { + + list_del (&rw_req->list); + FREE (rw_req); + } } if (!list_empty (&pl_inode->ext_list)) { gf_log (this->name, GF_LOG_CRITICAL, - "Pending fcntl locks found!"); + "Pending fcntl locks found, releasing."); + + list_for_each_entry_safe (ext_l, ext_tmp, &pl_inode->ext_list, + list) { + + __delete_lock (pl_inode, ext_l); + __destroy_lock (ext_l); + } } if (!list_empty (&pl_inode->int_list)) { gf_log (this->name, GF_LOG_CRITICAL, - "Pending internal locks found!"); + "Pending inode locks found, releasing."); + + 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_CRITICAL, - "Pending entry locks found!"); + "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); + } } FREE (pl_inode); |