diff options
author | David Teigland <teigland@redhat.com> | 2009-01-07 16:50:41 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2009-01-08 15:12:39 -0600 |
commit | c7be761a8163d2f1ac0b606c21e4316b7abc5af7 (patch) | |
tree | 1687373b56379c1c310f43b1c05ac486c67dec48 /fs/dlm/debug_fs.c | |
parent | 892c4467e335e9050c95e0d8409c136c4dadaca2 (diff) | |
download | linux-c7be761a8163d2f1ac0b606c21e4316b7abc5af7.tar.gz linux-c7be761a8163d2f1ac0b606c21e4316b7abc5af7.tar.bz2 linux-c7be761a8163d2f1ac0b606c21e4316b7abc5af7.zip |
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/debug_fs.c')
-rw-r--r-- | fs/dlm/debug_fs.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c index bc4af3ef65a3..1d1d27442235 100644 --- a/fs/dlm/debug_fs.c +++ b/fs/dlm/debug_fs.c @@ -416,7 +416,7 @@ static void *table_seq_start(struct seq_file *seq, loff_t *pos) if (seq->op == &format3_seq_ops) ri->format = 3; - read_lock(&ls->ls_rsbtbl[bucket].lock); + spin_lock(&ls->ls_rsbtbl[bucket].lock); if (!list_empty(&ls->ls_rsbtbl[bucket].list)) { list_for_each_entry(r, &ls->ls_rsbtbl[bucket].list, res_hashchain) { @@ -424,12 +424,12 @@ static void *table_seq_start(struct seq_file *seq, loff_t *pos) dlm_hold_rsb(r); ri->rsb = r; ri->bucket = bucket; - read_unlock(&ls->ls_rsbtbl[bucket].lock); + spin_unlock(&ls->ls_rsbtbl[bucket].lock); return ri; } } } - read_unlock(&ls->ls_rsbtbl[bucket].lock); + spin_unlock(&ls->ls_rsbtbl[bucket].lock); /* * move to the first rsb in the next non-empty bucket @@ -447,18 +447,18 @@ static void *table_seq_start(struct seq_file *seq, loff_t *pos) return NULL; } - read_lock(&ls->ls_rsbtbl[bucket].lock); + spin_lock(&ls->ls_rsbtbl[bucket].lock); if (!list_empty(&ls->ls_rsbtbl[bucket].list)) { r = list_first_entry(&ls->ls_rsbtbl[bucket].list, struct dlm_rsb, res_hashchain); dlm_hold_rsb(r); ri->rsb = r; ri->bucket = bucket; - read_unlock(&ls->ls_rsbtbl[bucket].lock); + spin_unlock(&ls->ls_rsbtbl[bucket].lock); *pos = n; return ri; } - read_unlock(&ls->ls_rsbtbl[bucket].lock); + spin_unlock(&ls->ls_rsbtbl[bucket].lock); } } @@ -477,7 +477,7 @@ static void *table_seq_next(struct seq_file *seq, void *iter_ptr, loff_t *pos) * move to the next rsb in the same bucket */ - read_lock(&ls->ls_rsbtbl[bucket].lock); + spin_lock(&ls->ls_rsbtbl[bucket].lock); rp = ri->rsb; next = rp->res_hashchain.next; @@ -485,12 +485,12 @@ static void *table_seq_next(struct seq_file *seq, void *iter_ptr, loff_t *pos) r = list_entry(next, struct dlm_rsb, res_hashchain); dlm_hold_rsb(r); ri->rsb = r; - read_unlock(&ls->ls_rsbtbl[bucket].lock); + spin_unlock(&ls->ls_rsbtbl[bucket].lock); dlm_put_rsb(rp); ++*pos; return ri; } - read_unlock(&ls->ls_rsbtbl[bucket].lock); + spin_unlock(&ls->ls_rsbtbl[bucket].lock); dlm_put_rsb(rp); /* @@ -509,18 +509,18 @@ static void *table_seq_next(struct seq_file *seq, void *iter_ptr, loff_t *pos) return NULL; } - read_lock(&ls->ls_rsbtbl[bucket].lock); + spin_lock(&ls->ls_rsbtbl[bucket].lock); if (!list_empty(&ls->ls_rsbtbl[bucket].list)) { r = list_first_entry(&ls->ls_rsbtbl[bucket].list, struct dlm_rsb, res_hashchain); dlm_hold_rsb(r); ri->rsb = r; ri->bucket = bucket; - read_unlock(&ls->ls_rsbtbl[bucket].lock); + spin_unlock(&ls->ls_rsbtbl[bucket].lock); *pos = n; return ri; } - read_unlock(&ls->ls_rsbtbl[bucket].lock); + spin_unlock(&ls->ls_rsbtbl[bucket].lock); } } |