diff options
author | David Teigland <teigland@redhat.com> | 2009-01-07 17:50:41 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2009-01-08 16:12:39 -0500 |
commit | c7be761a8163d2f1ac0b606c21e4316b7abc5af7 (patch) | |
tree | 1687373b56379c1c310f43b1c05ac486c67dec48 /fs/dlm/recover.c | |
parent | 892c4467e335e9050c95e0d8409c136c4dadaca2 (diff) |
dlm: change rsbtbl rwlock to spinlock
The rwlock is almost always used in write mode, so there's no reason
to not use a spinlock instead.
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/recover.c')
-rw-r--r-- | fs/dlm/recover.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/dlm/recover.c b/fs/dlm/recover.c index 80aba5bdd4a4..eda43f362616 100644 --- a/fs/dlm/recover.c +++ b/fs/dlm/recover.c | |||
@@ -726,7 +726,7 @@ int dlm_create_root_list(struct dlm_ls *ls) | |||
726 | } | 726 | } |
727 | 727 | ||
728 | for (i = 0; i < ls->ls_rsbtbl_size; i++) { | 728 | for (i = 0; i < ls->ls_rsbtbl_size; i++) { |
729 | read_lock(&ls->ls_rsbtbl[i].lock); | 729 | spin_lock(&ls->ls_rsbtbl[i].lock); |
730 | list_for_each_entry(r, &ls->ls_rsbtbl[i].list, res_hashchain) { | 730 | list_for_each_entry(r, &ls->ls_rsbtbl[i].list, res_hashchain) { |
731 | list_add(&r->res_root_list, &ls->ls_root_list); | 731 | list_add(&r->res_root_list, &ls->ls_root_list); |
732 | dlm_hold_rsb(r); | 732 | dlm_hold_rsb(r); |
@@ -737,7 +737,7 @@ int dlm_create_root_list(struct dlm_ls *ls) | |||
737 | but no other recovery steps should do anything with them. */ | 737 | but no other recovery steps should do anything with them. */ |
738 | 738 | ||
739 | if (dlm_no_directory(ls)) { | 739 | if (dlm_no_directory(ls)) { |
740 | read_unlock(&ls->ls_rsbtbl[i].lock); | 740 | spin_unlock(&ls->ls_rsbtbl[i].lock); |
741 | continue; | 741 | continue; |
742 | } | 742 | } |
743 | 743 | ||
@@ -745,7 +745,7 @@ int dlm_create_root_list(struct dlm_ls *ls) | |||
745 | list_add(&r->res_root_list, &ls->ls_root_list); | 745 | list_add(&r->res_root_list, &ls->ls_root_list); |
746 | dlm_hold_rsb(r); | 746 | dlm_hold_rsb(r); |
747 | } | 747 | } |
748 | read_unlock(&ls->ls_rsbtbl[i].lock); | 748 | spin_unlock(&ls->ls_rsbtbl[i].lock); |
749 | } | 749 | } |
750 | out: | 750 | out: |
751 | up_write(&ls->ls_root_sem); | 751 | up_write(&ls->ls_root_sem); |
@@ -775,7 +775,7 @@ void dlm_clear_toss_list(struct dlm_ls *ls) | |||
775 | int i; | 775 | int i; |
776 | 776 | ||
777 | for (i = 0; i < ls->ls_rsbtbl_size; i++) { | 777 | for (i = 0; i < ls->ls_rsbtbl_size; i++) { |
778 | write_lock(&ls->ls_rsbtbl[i].lock); | 778 | spin_lock(&ls->ls_rsbtbl[i].lock); |
779 | list_for_each_entry_safe(r, safe, &ls->ls_rsbtbl[i].toss, | 779 | list_for_each_entry_safe(r, safe, &ls->ls_rsbtbl[i].toss, |
780 | res_hashchain) { | 780 | res_hashchain) { |
781 | if (dlm_no_directory(ls) || !is_master(r)) { | 781 | if (dlm_no_directory(ls) || !is_master(r)) { |
@@ -783,7 +783,7 @@ void dlm_clear_toss_list(struct dlm_ls *ls) | |||
783 | dlm_free_rsb(r); | 783 | dlm_free_rsb(r); |
784 | } | 784 | } |
785 | } | 785 | } |
786 | write_unlock(&ls->ls_rsbtbl[i].lock); | 786 | spin_unlock(&ls->ls_rsbtbl[i].lock); |
787 | } | 787 | } |
788 | } | 788 | } |
789 | 789 | ||