aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking/dlm/lock.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-06-04 10:06:21 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2008-06-27 04:39:50 -0400
commit31fcba00fe7145527b159f8893ec6c9cc61309fd (patch)
tree6fef1dc1b20166b881356159d9ac8208a9335978 /fs/gfs2/locking/dlm/lock.c
parentb2cad26cfc2091050574a460b304ed103a35dbda (diff)
[GFS2] Remove all_list from lock_dlm
I discovered that we had a list onto which every lock_dlm lock was being put. Its only function was to discover whether we'd got any locks left after umount. Since there was already a counter for that purpose as well, I removed the list. The saving is sizeof(struct list_head) per glock - well worth having. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/locking/dlm/lock.c')
-rw-r--r--fs/gfs2/locking/dlm/lock.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/fs/gfs2/locking/dlm/lock.c b/fs/gfs2/locking/dlm/lock.c
index 894df4567a03..2482c9047505 100644
--- a/fs/gfs2/locking/dlm/lock.c
+++ b/fs/gfs2/locking/dlm/lock.c
@@ -58,9 +58,6 @@ static void gdlm_delete_lp(struct gdlm_lock *lp)
58 spin_lock(&ls->async_lock); 58 spin_lock(&ls->async_lock);
59 if (!list_empty(&lp->delay_list)) 59 if (!list_empty(&lp->delay_list))
60 list_del_init(&lp->delay_list); 60 list_del_init(&lp->delay_list);
61 gdlm_assert(!list_empty(&lp->all_list), "%x,%llx", lp->lockname.ln_type,
62 (unsigned long long)lp->lockname.ln_number);
63 list_del_init(&lp->all_list);
64 ls->all_locks_count--; 61 ls->all_locks_count--;
65 spin_unlock(&ls->async_lock); 62 spin_unlock(&ls->async_lock);
66 63
@@ -397,7 +394,6 @@ static int gdlm_create_lp(struct gdlm_ls *ls, struct lm_lockname *name,
397 INIT_LIST_HEAD(&lp->delay_list); 394 INIT_LIST_HEAD(&lp->delay_list);
398 395
399 spin_lock(&ls->async_lock); 396 spin_lock(&ls->async_lock);
400 list_add(&lp->all_list, &ls->all_locks);
401 ls->all_locks_count++; 397 ls->all_locks_count++;
402 spin_unlock(&ls->async_lock); 398 spin_unlock(&ls->async_lock);
403 399
@@ -710,22 +706,3 @@ void gdlm_submit_delayed(struct gdlm_ls *ls)
710 wake_up(&ls->thread_wait); 706 wake_up(&ls->thread_wait);
711} 707}
712 708
713int gdlm_release_all_locks(struct gdlm_ls *ls)
714{
715 struct gdlm_lock *lp, *safe;
716 int count = 0;
717
718 spin_lock(&ls->async_lock);
719 list_for_each_entry_safe(lp, safe, &ls->all_locks, all_list) {
720 list_del_init(&lp->all_list);
721
722 if (lp->lvb && lp->lvb != junk_lvb)
723 kfree(lp->lvb);
724 kfree(lp);
725 count++;
726 }
727 spin_unlock(&ls->async_lock);
728
729 return count;
730}
731